name
string
code
string
asm
string
file
string
irr::io::CXMLReaderImpl<unsigned short, irr::io::IXMLBase>::equalsn(unsigned short const*, unsigned short const*, int)
bool equalsn(const char_type* str1, const char_type* str2, int len) { int i; for(i=0; str1[i] && str2[i] && i < len; ++i) if (str1[i] != str2[i]) return false; // if one (or both) of the strings was smaller then they // are only equal if they have the same lenght return (i == len) || (str1[i] == 0 &&...
movzwl (%rsi), %eax testw %ax, %ax je 0x5467f6 movslq %ecx, %r8 xorl %edi, %edi cmpq %r8, %rdi jge 0x546807 movzwl (%rdx,%rdi,2), %r9d testw %r9w, %r9w je 0x546807 cmpw %r9w, %ax jne 0x54680d movzwl 0x2(%rsi,%rdi,2), %eax incq %rdi testw %ax, %ax jne 0x5467cf movl %edi, %esi jmp 0x5467fa xorl %esi, %esi xorl %edi, %edi...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::core::string<unsigned short>::subString(int, int)
string<T> subString(s32 begin, s32 length) { if (length <= 0) return string<T>(""); string<T> o; o.reserve(length+1); for (s32 i=0; i<length; ++i) o.array[i] = array[i+begin]; o.array[length] = 0; o.used = o.allocated; return o; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx testl %ecx, %ecx jle 0x5468e7 movl %ecx, %r15d movl %edx, %ebp movq %rsi, %r14 movabsq $0x100000001, %rax # imm = 0x100000001 movq %rax, 0x8(%rbx) movl $0x2, %edi callq 0x1a57a0 movq %rax, (%rbx) movw $0x0, (%rax) leal 0x1(%r15), %esi movq %rbx...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/irrString.h
irr::io::CXMLReaderImpl<unsigned short, irr::io::IXMLBase>::getAttributeByName(unsigned short const*) const
const SAttribute* getAttributeByName(const char_type* name) const { if (!name) return 0; core::string<char_type> n = name; for (int i=0; i<(int)Attributes.size(); ++i) if (Attributes[i].Name == n) return &Attributes[i]; return 0; }
pushq %r14 pushq %rbx subq $0x18, %rsp testq %rsi, %rsi je 0x546dd8 movq %rdi, %rbx xorps %xmm0, %xmm0 movq %rsp, %r14 movaps %xmm0, (%r14) movq %r14, %rdi callq 0x546de6 movslq 0x7c(%rbx), %rax movq (%r14), %rdi testq %rax, %rax jle 0x546dca movq 0x70(%rbx), %rcx movl 0xc(%rsp), %edx xorl %esi, %esi movq %rsi, %rbx sh...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::createSpecialCharacterList()
void createSpecialCharacterList() { // list of strings containing special symbols, // the first character is the special character, // the following is the symbol string without trailing &. SpecialCharacters.push_back("&amp;"); SpecialCharacters.push_back("<lt;"); SpecialCharacters.push_back(">gt;"); S...
pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx addq $0x58, %rbx xorps %xmm0, %xmm0 movq %rsp, %r14 movaps %xmm0, (%r14) leaq 0x96fa9(%rip), %rsi # 0x5de044 movq %r14, %rdi callq 0x547802 movq %rbx, %rdi movq %r14, %rsi callq 0x54757e movq (%rsp), %rdi testq %rdi, %rdi je 0x5470bc callq 0x1a5610 xorps %xmm0,...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::read()
virtual bool read() { // if not end reached, parse the node if (P && (unsigned int)(P - TextBegin) < TextSize - 1 && *P != 0) { parseCurrentNode(); return true; } _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; }
movq 0x10(%rdi), %rax testq %rax, %rax je 0x547326 movq %rax, %rcx subq 0x18(%rdi), %rcx shrq $0x3, %rcx movl 0x20(%rdi), %edx decl %edx cmpl %ecx, %edx jbe 0x547326 cmpq $0x0, (%rax) je 0x547326 pushq %rax callq 0x5478d8 movb $0x1, %al addq $0x8, %rsp retq xorl %eax, %eax retq nop
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::getAttributeValueAsFloat(int) const
float getAttributeValueAsFloat(int idx) const { const char_type* attrvalue = getAttributeValue(idx); if (!attrvalue) return 0; core::stringc c = attrvalue; return static_cast<float>(atof(c.c_str())); //return fast_atof(c.c_str()); }
pushq %rbx subq $0x20, %rsp movq (%rdi), %rax callq *0x30(%rax) testq %rax, %rax je 0x547462 xorps %xmm0, %xmm0 leaq 0x10(%rsp), %rbx movaps %xmm0, (%rbx) movq %rbx, %rdi movq %rax, %rsi callq 0x54894c movq (%rbx), %rbx movq %rbx, %rdi callq 0x1a5f00 testq %rbx, %rbx je 0x54745c movq %rbx, %rdi movsd %xmm0, 0x8(%rsp) c...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
void irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::convertTextData<unsigned short>(unsigned short*, char*, int)
void convertTextData(src_char_type* source, char* pointerToStore, int sizeWithoutHeader) { // convert little to big endian if necessary if (sizeof(src_char_type) > 1 && isLittleEndian(TargetFormat) != isLittleEndian(SourceFormat)) convertToLittleEndian(source); // check if conversion is necessary: if (...
pushq %rbx movl %ecx, %eax movq %rdi, %rbx movl 0x2c(%rdi), %ecx cmpl $0x6, %ecx setb %dil movb $0x2b, %dl shrb %cl, %dl movl 0x28(%rbx), %ecx andb %dil, %dl cmpl $0x5, %ecx ja 0x54753f movl $0x2b, %edi btl %ecx, %edi jae 0x54753f testb %dl, %dl jne 0x547543 movzwl (%rsi), %ecx testw %cx, %cx je 0x547543 addq $0x2, %rs...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::core::array<irr::core::string<unsigned long>>::push_back(irr::core::string<unsigned long> const&)
void push_back(const T& element) { if (used + 1 > allocated) { // reallocate(used * 2 +1); // this doesn't work if the element is in the same array. So // we'll copy the element first to be sure we'll get no data // corruption T e; e = element; // copy element reallocate(used * 2 +1...
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %rsi, %r14 movq %rdi, %rbx movl 0xc(%rdi), %edi leal 0x1(%rdi), %eax cmpl 0x8(%rbx), %eax jbe 0x547606 movabsq $0x100000001, %rax # imm = 0x100000001 movq %rsp, %r15 movq %rax, 0x8(%r15) movl $0x8, %edi callq 0x1a57a0 movq %rax, (%r15) movq $0x0, (%rax) movq %...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/irrArray.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::parseClosingXMLElement()
void parseClosingXMLElement() { CurrentNodeType = EXN_ELEMENT_END; IsEmptyElement = false; Attributes.clear(); ++P; const char_type* pBeginClose = P; while(*P != L'>') ++P; // remove trailing whitespace, if any while( std::isspace( P[-1])) --P; NodeName = core::string<char_type>(pBeg...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx movl $0x2, 0x24(%rdi) movb $0x0, 0x50(%rdi) addq $0x70, %rdi callq 0x548490 movq 0x10(%rbx), %r14 addq $0x8, %r14 movq %r14, %r15 movq %r15, 0x10(%rbx) cmpq $0x3e, (%r15) leaq 0x8(%r15), %r15 jne 0x547a89 movl -0x10(%r15), %edi callq 0x1a5dc0 ...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::replaceSpecialCharacters(irr::core::string<unsigned long>&)
core::string<char_type> replaceSpecialCharacters( core::string<char_type>& origstr) { int pos = origstr.findFirst(L'&'); int oldPos = 0; if (pos == -1) return origstr; core::string<char_type> newstr; while(pos != -1 && pos < origstr.size()-2) { // check if it is one of the special characters ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdx, %r13 movq %rdi, %rbx movslq 0xc(%rdx), %rbp testq %rbp, %rbp jle 0x54807a movq %rsi, %r15 movq (%r13), %rax xorl %r12d, %r12d cmpq $0x26, (%rax,%r12,8) je 0x54809d incq %r12 cmpq %r12, %rbp jne 0x54806b xorps %xmm0, %xmm0 movu...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::equalsn(unsigned long const*, unsigned long const*, int)
bool equalsn(const char_type* str1, const char_type* str2, int len) { int i; for(i=0; str1[i] && str2[i] && i < len; ++i) if (str1[i] != str2[i]) return false; // if one (or both) of the strings was smaller then they // are only equal if they have the same lenght return (i == len) || (str1[i] == 0 &&...
movq (%rsi), %rax testq %rax, %rax je 0x54829d movslq %ecx, %r8 xorl %edi, %edi cmpq %r8, %rdi jge 0x5482ae movq (%rdx,%rdi,8), %r9 testq %r9, %r9 je 0x5482ae cmpq %r9, %rax jne 0x5482b4 movq 0x8(%rsi,%rdi,8), %rax incq %rdi testq %rax, %rax jne 0x548279 movl %edi, %esi jmp 0x5482a1 xorl %esi, %esi xorl %edi, %edi movb...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
irr::io::CXMLReaderImpl<unsigned long, irr::io::IXMLBase>::getAttributeByName(unsigned long const*) const
const SAttribute* getAttributeByName(const char_type* name) const { if (!name) return 0; core::string<char_type> n = name; for (int i=0; i<(int)Attributes.size(); ++i) if (Attributes[i].Name == n) return &Attributes[i]; return 0; }
pushq %r14 pushq %rbx subq $0x18, %rsp testq %rsi, %rsi je 0x54888d movq %rdi, %rbx xorps %xmm0, %xmm0 movq %rsp, %r14 movaps %xmm0, (%r14) movq %r14, %rdi callq 0x54889a movslq 0x7c(%rbx), %rax movq (%r14), %rdi testq %rax, %rax jle 0x54887f movq 0x70(%rbx), %rcx movl 0xc(%rsp), %edx xorl %esi, %esi movq %rsi, %rbx sh...
/hbina[P]fatuous/thirdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
MidiOutAlsa::setPortName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void MidiOutAlsa :: setPortName( const std::string &portName ) { AlsaMidiData *data = static_cast<AlsaMidiData *> (apiData_); snd_seq_port_info_t *pinfo; snd_seq_port_info_alloca( &pinfo ); snd_seq_get_port_info( data->seq, data->vport, pinfo ); snd_seq_port_info_set_name( pinfo, portName.c_str() ); snd_seq...
pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq 0x8(%rdi), %r15 callq 0x77b0 movq %rsp, %r14 addq $0xf, %rax andq $-0x10, %rax subq %rax, %r14 movq %r14, %rsp callq 0x77b0 movq %r14, %rdi xorl %esi, %esi movq %rax, %rdx callq 0x7230 movq (%r15), %rdi movl 0xc(%r15), %esi movq...
/samhocevar[P]midi2pico8/RtMidi.cpp
MidiOutAlsa::openVirtualPort(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void MidiOutAlsa :: openVirtualPort( const std::string &portName ) { AlsaMidiData *data = static_cast<AlsaMidiData *> (apiData_); if ( data->vport < 0 ) { data->vport = snd_seq_create_simple_port( data->seq, portName.c_str(), SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_S...
pushq %r15 pushq %r14 pushq %rbx subq $0x20, %rsp movq 0x8(%rdi), %r14 cmpl $0x0, 0xc(%r14) jns 0xad7b movq %rdi, %rbx movq (%r14), %rdi movq (%rsi), %rsi movl $0x21, %edx movl $0x100002, %ecx # imm = 0x100002 callq 0x7730 movl %eax, 0xc(%r14) testl %eax, %eax jns 0xad7b leaq 0x18(%rbx), %rdi movq 0x20(%rbx), %...
/samhocevar[P]midi2pico8/RtMidi.cpp
rtmidi_compiled_api_by_name
enum RtMidiApi rtmidi_compiled_api_by_name(const char *name) { RtMidi::Api api = RtMidi::UNSPECIFIED; if (name) { api = RtMidi::getCompiledApiByName(name); } return (enum RtMidiApi)api; }
pushq %r15 pushq %r14 pushq %rbx subq $0x20, %rsp testq %rdi, %rdi je 0xbc27 movq %rdi, %rbx leaq 0x10(%rsp), %r15 movq %r15, -0x10(%r15) callq 0x71a0 leaq (%rax,%rbx), %rdx movq %rsp, %r14 movq %r14, %rdi movq %rbx, %rsi callq 0x7120 movq %r14, %rdi callq 0x76a0 movl %eax, %ebx movq (%rsp), %rdi cmpq %r15, %rdi je 0xb...
/samhocevar[P]midi2pico8/rtmidi_c.cpp
rtmidi_in_set_callback
void rtmidi_in_set_callback (RtMidiInPtr device, RtMidiCCallback callback, void *userData) { device->data = (void*) new CallbackProxyUserData (callback, userData); try { ((RtMidiIn*) device->ptr)->setCallback (callback_proxy, device->data); } catch (const RtMidiError & err) { device->ok = f...
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movl $0x10, %edi callq 0x7460 movq %r15, (%rax) movq %r14, 0x8(%rax) leaq 0x8(%rbx), %r14 movq %rax, 0x8(%rbx) movq (%rbx), %rcx movq 0x8(%rcx), %rdi leaq 0x20(%rip), %rsi # 0xc1c9 movq %rax, %rdx callq 0x7090 popq %rbx popq %r14 po...
/samhocevar[P]midi2pico8/rtmidi_c.cpp
rtmidi_out_get_current_api
enum RtMidiApi rtmidi_out_get_current_api (RtMidiPtr device) { try { return (RtMidiApi) ((RtMidiOut*) device->ptr)->getCurrentApi (); } catch (const RtMidiError & err) { device->ok = false; device->msg = err.what (); return RTMIDI_API_UNSPECIFIED; } }
pushq %rax movq (%rdi), %rax movq 0x8(%rax), %rdi movq (%rdi), %rax callq *0x10(%rax) popq %rcx retq movq %rax, %rdi callq 0xb23f
/samhocevar[P]midi2pico8/rtmidi_c.cpp
blobCreate
blob_t blobCreate(size_t size) { size_t* ptr; if (size == 0) return 0; ptr = (size_t*)memAlloc(blobActualSize(size)); if (ptr == 0) return 0; *ptr = size; memSetZero(blobValueOf(ptr), size); return blobValueOf(ptr); }
pushq %r14 pushq %rbx pushq %rax testq %rdi, %rdi je 0x1092d movq %rdi, %r14 addq $0x407, %rdi # imm = 0x407 andq $-0x400, %rdi # imm = 0xFC00 callq 0xe530 testq %rax, %rax je 0x1092d movq %rax, %rbx movq %r14, (%rax) addq $0x8, %rbx movq %rbx, %rdi xorl %esi, %esi movq %r14, %rdx callq 0xf710 jmp ...
/agievich[P]bee2/src/core/blob.c
derTEnc
static size_t derTEnc(octet der[], u32 tag) { size_t t_count = 0; // проверить корректность if (!derTIsValid(tag)) return SIZE_MAX; // определить длину кода { u32 t = tag; for (; t; ++t_count, t >>= 8); if (t_count == 0) t_count = 1; } // кодировать if (der) { size_t pos = t_count; ASSERT(memIsV...
pushq %r14 pushq %rbx pushq %rax movl %esi, %ebx movq %rdi, %r14 movl %esi, %edi callq 0x11f93 testl %eax, %eax je 0x10f3a xorl %eax, %eax movl %ebx, %ecx testl %ecx, %ecx je 0x10f14 incq %rax shrl $0x8, %ecx jmp 0x10f08 cmpq $0x1, %rax adcq $0x0, %rax testq %r14, %r14 je 0x10f3d movq %rax, %rdx movq %rax, %rcx subq $0...
/agievich[P]bee2/src/core/der.c
derEnc
size_t derEnc(octet der[], u32 tag, const void* val, size_t len) { size_t t_count; size_t l_count; // t_count <- len(T) t_count = derTEnc(0, tag); if (t_count == SIZE_MAX) return SIZE_MAX; // l_count <- len(L) l_count = derLEnc(0, len); if (l_count == SIZE_MAX) return SIZE_MAX; // кодировать? if (der) { ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rcx, %rbx movq %rdx, %r12 movl %esi, %ebp movq %rdi, %r13 xorl %edi, %edi callq 0x10ef0 pushq $-0x1 popq %r14 cmpq $-0x1, %rax je 0x11028 movq %rax, %r15 movq %r12, 0x10(%rsp) xorl %edi, %edi movq %rbx, %rsi callq 0x10f45 cmpq $-0x...
/agievich[P]bee2/src/core/der.c
derTSIZEDec
size_t derTSIZEDec(size_t* val, const octet der[], size_t count, u32 tag) { u32 t; size_t t_count; size_t l_count; size_t len; // pre ASSERT(memIsNullOrValid(val, O_PER_S)); ASSERT(val == 0 || memIsDisjoint2(val, O_PER_S, der, count)); // декодировать T t_count = derTDec(&t, der, count); if (t_count == SIZE_M...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r14 movq %rdi, %rbx leaq 0xc(%rsp), %rdi callq 0x10d53 pushq $-0x1 popq %r12 cmpq $-0x1, %rax je 0x1157b cmpl %ebp, 0xc(%rsp) jne 0x1157b movq %rax, %r15 addq %rax, %r14 subq %rax, %r13 leaq 0x...
/agievich[P]bee2/src/core/der.c
derTUINTDec2
size_t derTUINTDec2(octet* val, const octet der[], size_t count, u32 tag, size_t len) { const octet* v; size_t l; size_t ex; // декодировать count = derDec2(&v, &l, der, count, tag); if (count == SIZE_MAX) return SIZE_MAX; // в значении менее одного октета? // установлен старший бит в первом (старшем) октете...
pushq %r15 pushq %r14 pushq %rbx subq $0x10, %rsp movq %r8, %rbx movl %ecx, %r8d movq %rdx, %rcx movq %rsi, %rdx movq %rdi, %r14 leaq 0x8(%rsp), %rdi movq %rsp, %rsi callq 0xfaf0 movq %rax, %r15 pushq $-0x1 popq %rax cmpq $-0x1, %r15 je 0x1178b movq (%rsp), %rcx testq %rcx, %rcx je 0x1178b movq 0x8(%rsp), %rsi cmpb $0x...
/agievich[P]bee2/src/core/der.c
derOIDEnc
size_t derOIDEnc(octet der[], const char* oid) { u32 d1; u32 val = 0; size_t pos = 0; size_t count = 0; // корректен? if (!oidIsValid(oid)) return SIZE_MAX; // pre ASSERT(oid[0] == '0' || oid[0] == '1' || oid[0] == '2'); ASSERT(oid[1] == '.'); // обработать d1 d1 = oid[0] - '0'; oid += 2; // цикл по симв...
pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdi, %rbx movq %rsi, %rdi callq 0xe110 testl %eax, %eax je 0x11b15 movsbl (%r14), %r9d addl $-0x30, %r9d addq $0x2, %r14 xorl %eax, %eax pushq $0x1 popq %rdx pushq $0x3 popq %rsi xorl %ecx, %ecx movq %rcx, %rdi incq %r14 xorl %r11d, %r11d movzbl -0x1(%r14), %r10d c...
/agievich[P]bee2/src/core/der.c
derOIDDec
size_t derOIDDec(char* oid, size_t* len, const octet der[], size_t count) { u32 d1 = 3; u32 val = 0; size_t l, pos, oid_len; // pre ASSERT(memIsValid(der, count)); // проверить тег и определить значение count = derDec2(&der, &l, der, count, 0x06); if (count == SIZE_MAX) return SIZE_MAX; // обработать sid fo...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rsi, %rbx movq %rdi, %r15 leaq 0x20(%rsp), %rdi movq %rdx, (%rdi) leaq 0x18(%rsp), %rsi pushq $0x6 popq %r8 callq 0xfaf0 pushq $-0x1 popq %rcx cmpq $-0x1, %rax je 0x11c23 movq %rax, 0x8(%rsp) movq %rbx, 0x10(%rsp) movq 0x18(%rsp), ...
/agievich[P]bee2/src/core/der.c
derSIDDec2
static size_t derSIDDec2(u32 val, const char* oid) { size_t count = 0, pos; u32 t = val; // число символов для val do t /= 10, count++; while (t > 0); // сравнение ASSERT(strIsValid(oid)); pos = count - 1; if (oid[pos] != '0' + (char)((t = val) % 10)) return SIZE_MAX; while (pos--) { t /= 10; if (oid...
movabsq $-0x1, %r9 movl $0xa, %r8d movl %edi, %ecx movl %ecx, %eax xorl %edx, %edx divl %r8d incq %r9 cmpl $0x9, %ecx movl %eax, %ecx ja 0x11db4 movsbl (%rsi,%r9), %r10d movl %edi, %eax xorl %edx, %edx divl %r8d orl $0x30, %edx movabsq $-0x1, %rcx cmpl %r10d, %edx jne 0x11e15 pushq %rbx leaq 0x1(%r9), %r10 movq %r9, %r...
/agievich[P]bee2/src/core/der.c
derTPSTRDec
size_t derTPSTRDec(char* val, size_t* len, const octet der[], size_t count, u32 tag) { const octet* v; size_t l; size_t pos; // декодировать count = derDec2(&v, &l, der, count, tag); if (count == SIZE_MAX) return SIZE_MAX; // проверить символы (см. strIsPrintable()) for (pos = 0; pos < l; ++pos) { registe...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rsi, %rbx movq %rdi, %r15 leaq 0x20(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0xfaf0 movq %rax, %r14 pushq $-0x1 popq %rax cmpq $-0x1, %r14 je 0x11f17 movq %r15, 0x18(%rsp) movq %rbx, 0x8(%rsp) movq 0x10(%rsp), %r12 movq 0x20(%rsp), ...
/agievich[P]bee2/src/core/der.c
derTIsValid
static bool_t derTIsValid(u32 tag) { if (tag == 0) return FALSE; else if (tag < 256) { // установлены 5 младших битов? if ((tag & 31) == 31) return FALSE; } // длинный код else { u32 t; u32 b; // установлен старший бит в последнем (младшем) октете? if (tag & 128) return FALSE; // пробегаем ...
xorl %eax, %eax testl %edi, %edi je 0x11fa9 cmpl $0xff, %edi ja 0x11faa notl %edi testb $0x1f, %dil jne 0x11fec retq testb %dil, %dil js 0x11fa9 movl %edi, %ecx andl $0x7f, %ecx movl %ecx, %edx cmpl $0x10000, %edi # imm = 0x10000 jb 0x11fda testw %di, %di jns 0x11fa9 cmpl $0x1ffffff, %ecx # imm = 0x1FFF...
/agievich[P]bee2/src/core/der.c
derTSEQEncStop
size_t derTSEQEncStop(octet der[], size_t pos, const der_anchor_t* anchor) { size_t t_count; size_t l_count; size_t len; size_t l_count1; ASSERT(memIsValid(anchor, sizeof(der_anchor_t))); ASSERT(anchor->der == 0 || der != 0 && anchor->der + pos == der + anchor->pos); // определить длину вложенных данных t_cou...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r12 movq %rsi, %rbx movq %rdi, %r14 movl 0x10(%rdx), %esi xorl %edi, %edi callq 0x10ef0 movq %rax, %rbp movq 0x18(%r12), %rsi xorl %edi, %edi callq 0x10f45 addq %rax, %rbp addq 0x8(%r12), %rbp pushq $-0x1 popq %r15 subq %rbp, %rbx ...
/agievich[P]bee2/src/core/der.c
derTSEQDecStart
size_t derTSEQDecStart(der_anchor_t* anchor, const octet der[], size_t count, u32 tag) { size_t t_count; size_t l_count; // pre ASSERT(memIsValid(anchor, sizeof(der_anchor_t))); // проверить тег if (!derTIsConstructive(tag)) return SIZE_MAX; // бросить якорь anchor->der = der; // декодировать тег t_count =...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r14 movq %rdi, %r15 movl %ecx, %edi callq 0x11ff0 pushq $-0x1 popq %r12 testl %eax, %eax je 0x12102 movq %r14, (%r15) leaq 0x10(%r15), %rbx movq %rbx, %rdi movq %r14, %rsi movq %r13, (%rsp) movq %r13...
/agievich[P]bee2/src/core/der.c
fileWrite
err_t fileWrite(size_t* written, const void* buf, size_t count, file_t file) { ASSERT(memIsValid(buf, count)); ASSERT(fileIsValid(file)); ASSERT(memIsValid(written, O_PER_S)); *written = fwrite(buf, 1, count, file); if (*written != count) return ERR_FILE_WRITE; return ERR_OK; }
pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx movq %rsi, %rax movq %rdi, %r14 pushq $0x1 popq %rsi movq %rax, %rdi callq 0xfdf0 movq %rax, (%r14) xorl %ecx, %ecx cmpq %rbx, %rax movl $0xce, %eax cmovel %ecx, %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/agievich[P]bee2/src/core/file.c
fileRead
err_t fileRead(size_t* read, void* buf, size_t count, file_t file) { ASSERT(memIsValid(buf, count)); ASSERT(fileIsValid(file)); ASSERT(memIsValid(read, O_PER_S)); *read = fread(buf, 1, count, file); if (*read != count) return feof(file) ? ERR_MAX : ERR_FILE_READ; return ERR_OK; }
pushq %r15 pushq %r14 pushq %rbx movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %rax movq %rdi, %r15 pushq $0x1 popq %rsi movq %rax, %rdi callq 0xe460 movq %rax, %rcx movq %rax, (%r15) xorl %eax, %eax cmpq %r14, %rcx je 0x1228a movq %rbx, %rdi callq 0xf050 movl %eax, %ecx xorl %eax, %eax negl %ecx sbbl %eax, %eax orl $0xcf...
/agievich[P]bee2/src/core/file.c
fileSize
size_t fileSize(file_t file) { size_t pos; size_t size; ASSERT(fileIsValid(file)); if ((pos = fileTell(file)) == SIZE_MAX || !fileSeek(file, 0, SEEK_END) || (size = fileTell(file)) == SIZE_MAX || !fileSeek(file, pos, SEEK_SET)) return SIZE_MAX; return size; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdi, %r14 callq 0xf010 pushq $-0x1 popq %rbx cmpq $-0x1, %rax je 0x1233c movq %rax, %r15 pushq $0x2 popq %rdx movq %r14, %rdi xorl %esi, %esi callq 0xe450 testl %eax, %eax je 0x1233c movq %r14, %rdi callq 0xf010 cmpq $-0x1, %rax je 0x1233c movq %rax, %r12 xor...
/agievich[P]bee2/src/core/file.c
memJoin
void memJoin(void* dest, const void* src1, size_t count1, const void* src2, size_t count2) { register octet o; size_t i; ASSERT(memIsValid(src1, count1)); ASSERT(memIsValid(src2, count2)); ASSERT(memIsValid(dest, count1 + count2)); repeat: if (memIsDisjoint2(dest, count1, src2, count2)) { memMove(dest, src1, ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp leaq (%rdi,%r8), %r9 leaq (%rdi,%rdx), %rax movq %rax, (%rsp) leaq (%rsi,%rdx), %rax pushq $0x1 popq %r10 subq %r8, %r10 movq %rdx, 0x10(%rsp) leaq (%r8,%rdx), %r11 movq %rdi, 0x20(%rsp) addq %rdi, %r11 movq %r9, %rdi leaq (%rcx,%r8), %r...
/agievich[P]bee2/src/core/mem.c
memXor
void memXor(void* dest, const void* src1, const void* src2, size_t count) { ASSERT(memIsSameOrDisjoint(src1, dest, count)); ASSERT(memIsSameOrDisjoint(src2, dest, count)); for (; count >= O_PER_W; count -= O_PER_W) { *(word*)dest = *(const word*)src1 ^ *(const word*)src2; src1 = (const word*)src1 + 1; src2 = ...
cmpq $0x7, %rcx jbe 0x12ac6 movq (%rdx), %rax xorq (%rsi), %rax movq %rax, (%rdi) addq $0x8, %rsi addq $0x8, %rdx addq $0x8, %rdi addq $-0x8, %rcx jmp 0x12aa5 xorl %eax, %eax cmpq %rax, %rcx je 0x12ade movb (%rdx,%rax), %r8b xorb (%rsi,%rax), %r8b movb %r8b, (%rdi,%rax) incq %rax jmp 0x12ac8 retq
/agievich[P]bee2/src/core/mem.c
memXor2
void memXor2(void* dest, const void* src, size_t count) { ASSERT(memIsSameOrDisjoint(src, dest, count)); for (; count >= O_PER_W; count -= O_PER_W) { *(word*)dest ^= *(const word*)src; src = (const word*)src + 1; dest = (word*)dest + 1; } while (count--) { *(octet*)dest ^= *(const octet*)src; src = (con...
cmpq $0x7, %rdx jbe 0x12af9 movq (%rsi), %rax xorq %rax, (%rdi) addq $0x8, %rsi addq $0x8, %rdi addq $-0x8, %rdx jmp 0x12adf xorl %eax, %eax cmpq %rax, %rdx je 0x12b0b movb (%rsi,%rax), %cl xorb %cl, (%rdi,%rax) incq %rax jmp 0x12afb retq
/agievich[P]bee2/src/core/mem.c
memSwap
void memSwap(void* buf1, void* buf2, size_t count) { ASSERT(memIsDisjoint(buf1, buf2, count)); for (; count >= O_PER_W; count -= O_PER_W) { SWAP(*(word*)buf1, *(word*)buf2); buf1 = (word*)buf1 + 1; buf2 = (word*)buf2 + 1; } while (count--) { SWAP(*(octet*)buf1, *(octet*)buf2); buf1 = (octet*)buf1 + 1; ...
cmpq $0x7, %rdx jbe 0x12b32 movq (%rdi), %rax xorq (%rsi), %rax movq %rax, (%rdi) xorq (%rsi), %rax movq %rax, (%rsi) xorq %rax, (%rdi) addq $0x8, %rdi addq $0x8, %rsi addq $-0x8, %rdx jmp 0x12b0c xorl %eax, %eax cmpq %rax, %rdx je 0x12b50 movb (%rdi,%rax), %cl xorb (%rsi,%rax), %cl movb %cl, (%rdi,%rax) xorb (%rsi,%ra...
/agievich[P]bee2/src/core/mem.c
mtCallOnce
bool_t mtCallOnce(size_t* once, void (*fn)()) { size_t t; // попытки вызова do // удается захватить триггер?... if ((t = mtAtomicCmpSwap(once, 0, SIZE_MAX)) == 0) { // ... да, обработать захват fn(), *once = 1; break; } // ... нет, ожидаем обработки захвата в другом потоке while (t == SIZE_MAX); ...
pushq %rbx movq %rdi, %rbx pushq $-0x1 popq %rcx xorl %eax, %eax lock cmpxchgq %rcx, (%rbx) cmpq $-0x1, %rax je 0x12bef testq %rax, %rax jne 0x12c0c xorl %eax, %eax callq *%rsi movq $0x1, (%rbx) pushq $0x1 popq %rax popq %rbx retq
/agievich[P]bee2/src/core/mt.c
hexIsValid
bool_t hexIsValid(const char* hex) { if (!strIsValid(hex) || strLen(hex) % 2) return FALSE; for (; *hex; ++hex) if (hex_dec_table[(octet)*hex] == 0xFF) return FALSE; return TRUE; }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 callq 0xe0d0 xorl %ebx, %ebx testl %eax, %eax je 0x12c72 movq %r14, %rdi callq 0xf210 testb $0x1, %al jne 0x12c72 pushq $0x1 popq %rax leaq 0x3ac34(%rip), %rcx # 0x4d890 movzbl (%r14), %edx testq %rdx, %rdx je 0x12c70 incq %r14 cmpb $-0x1, (%rdx,%rcx) jne 0x12c5c jmp...
/agievich[P]bee2/src/core/hex.c
hexUpper
void hexUpper(char* hex) { ASSERT(hexIsValid(hex)); for (; *hex; hex += 2) hexFromOUpper(hex, hexToO(hex)); }
leaq 0x3ac0d(%rip), %rax # 0x4d890 leaq 0x3ad06(%rip), %rcx # 0x4d990 movzbl (%rdi), %edx testq %rdx, %rdx je 0x12cbd movb (%rdx,%rax), %dl movzbl 0x1(%rdi), %esi movzbl (%rsi,%rax), %esi shlb $0x4, %dl orb %sil, %dl movzbl %dl, %edx shrl $0x4, %edx movb (%rdx,%rcx), %dl movb %dl, (%rdi) andl $0xf, %esi movb (%...
/agievich[P]bee2/src/core/hex.c
hexLower
void hexLower(char* hex) { ASSERT(hexIsValid(hex)); for (; *hex; hex += 2) hexFromOLower(hex, hexToO(hex)); }
leaq 0x3abcb(%rip), %rax # 0x4d890 leaq 0x3ace4(%rip), %rcx # 0x4d9b0 movzbl (%rdi), %edx testq %rdx, %rdx je 0x12cff movb (%rdx,%rax), %dl movzbl 0x1(%rdi), %esi movzbl (%rsi,%rax), %esi shlb $0x4, %dl orb %sil, %dl movzbl %dl, %edx shrl $0x4, %edx movb (%rdx,%rcx), %dl movb %dl, (%rdi) andl $0xf, %esi movb (%...
/agievich[P]bee2/src/core/hex.c
hexEq
bool_t SAFE(hexEq)(const void* buf, const char* hex) { register word diff = 0; size_t count; ASSERT(hexIsValid(hex)); ASSERT(memIsValid(buf, strLen(hex) / 2)); count = strLen(hex); for (; count; count -= 2, hex += 2, buf = (const octet*)buf + 1) diff |= *(const octet*)buf ^ hexToO(hex); return wordEq(diff, 0);...
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 xorl %ecx, %ecx leaq 0x3ab75(%rip), %rdx # 0x4d890 xorl %esi, %esi cmpq %rcx, %rax je 0x12d4b movzbl (%rbx,%rcx), %edi movb (%rdi,%rdx), %dil movzbl 0x1(%rbx,%rcx), %r8d shlb $0x4, %dil orb (%r8,%rdx), %dil xorb (%r14), %d...
/agievich[P]bee2/src/core/hex.c
hexEq_fast
bool_t FAST(hexEq)(const void* buf, const char* hex) { size_t count; ASSERT(hexIsValid(hex)); ASSERT(memIsValid(buf, strLen(hex) / 2)); count = strLen(hex); for (; count; count -= 2, hex += 2, buf = (const octet*)buf + 1) if (*(const octet*)buf != hexToO(hex)) return FALSE; return TRUE; }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 movq %rax, %rcx xorl %edx, %edx pushq $0x1 popq %rax leaq 0x3ab14(%rip), %rsi # 0x4d890 cmpq %rdx, %rcx je 0x12da7 movzbl (%rbx,%rdx), %edi movb (%rdi,%rsi), %dil movzbl 0x1(%rbx,%rdx), %r8d shlb $0x4, %dil orb (%r8,%rsi),...
/agievich[P]bee2/src/core/hex.c
hexEqRev
bool_t SAFE(hexEqRev)(const void* buf, const char* hex) { register word diff = 0; size_t count; ASSERT(hexIsValid(hex)); ASSERT(memIsValid(buf, strLen(hex) / 2)); count = strLen(hex); hex = hex + count; for (; count; count -= 2, buf = (const octet*)buf + 1) diff |= *(const octet*)buf ^ hexToO(hex -= 2); retur...
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 xorl %ecx, %ecx leaq 0x3aac6(%rip), %rdx # 0x4d890 testq %rax, %rax je 0x12df8 movzbl -0x2(%rbx,%rax), %esi movb (%rsi,%rdx), %sil movzbl -0x1(%rbx,%rax), %edi shlb $0x4, %sil orb (%rdi,%rdx), %sil xorb (%r14), %sil movzbl...
/agievich[P]bee2/src/core/hex.c
hexEqRev_fast
bool_t FAST(hexEqRev)(const void* buf, const char* hex) { size_t count; ASSERT(hexIsValid(hex)); ASSERT(memIsValid(buf, strLen(hex) / 2)); count = strLen(hex); hex = hex + count; for (; count; count -= 2, buf = (const octet*)buf + 1) if (*(const octet*)buf != hexToO(hex -= 2)) return FALSE; return TRUE; }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 movq %rax, %rcx pushq $0x1 popq %rax leaq 0x3aa69(%rip), %rdx # 0x4d890 testq %rcx, %rcx je 0x12e52 movzbl -0x2(%rbx,%rcx), %esi movb (%rsi,%rdx), %sil movzbl -0x1(%rbx,%rcx), %edi shlb $0x4, %sil orb (%rdi,%rdx), %sil cmp...
/agievich[P]bee2/src/core/hex.c
hexFrom
void hexFrom(char* dest, const void* src, size_t count) { ASSERT(memIsDisjoint2(src, count, dest, 2 * count + 1)); for (; count--; dest += 2, src = (const octet*)src + 1) hexFromOUpper(dest, *(const octet*)src); *dest = '\0'; }
xorl %eax, %eax leaq 0x3ab2d(%rip), %rcx # 0x4d990 cmpq %rax, %rdx je 0x12e8e movzbl (%rsi,%rax), %r8d movl %r8d, %r9d shrl $0x4, %r9d movb (%r9,%rcx), %r9b movb %r9b, (%rdi,%rax,2) andl $0xf, %r8d movb (%r8,%rcx), %r8b movb %r8b, 0x1(%rdi,%rax,2) incq %rax jmp 0x12e63 movb $0x0, (%rdi,%rax,2) retq
/agievich[P]bee2/src/core/hex.c
hexTo
void hexTo(void* dest, const char* src) { size_t count; ASSERT(hexIsValid(src)); ASSERT(memIsDisjoint2(src, strLen(src) + 1, dest, strLen(src) / 2)); count = strLen(src); for (; count; count -= 2, src += 2, dest = (octet*)dest + 1) *(octet*)dest = hexToO(src); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 xorl %ecx, %ecx leaq 0x3a9af(%rip), %rdx # 0x4d890 cmpq %rcx, %rax je 0x12f07 movzbl (%rbx,%rcx), %esi movb (%rsi,%rdx), %sil movzbl 0x1(%rbx,%rcx), %edi shlb $0x4, %sil orb (%rdi,%rdx), %sil movb %sil, (%r14) incq %r14 ad...
/agievich[P]bee2/src/core/hex.c
hexToRev
void hexToRev(void* dest, const char* src) { size_t count; ASSERT(hexIsValid(src)); ASSERT(memIsDisjoint2(src, strLen(src) + 1, dest, strLen(src) / 2)); count = strLen(src); src = src + count; for (; count; count -= 2, dest = (octet*)dest + 1) *(octet*)dest = hexToO(src -= 2); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rdi callq 0xf210 leaq 0x3a968(%rip), %rcx # 0x4d890 testq %rax, %rax je 0x12f4c movzbl -0x2(%rbx,%rax), %edx movb (%rdx,%rcx), %dl movzbl -0x1(%rbx,%rax), %esi shlb $0x4, %dl orb (%rsi,%rcx), %dl movb %dl, (%r14) addq $-0x2, %rax incq %r14...
/agievich[P]bee2/src/core/hex.c
objIsOperable2
bool_t objIsOperable2(const void* obj) { return memIsValid(obj, sizeof(obj_hdr_t)) && memIsValid(obj, objKeep(obj)) && objOCount(obj) <= objPCount(obj) && sizeof(obj_hdr_t) + sizeof(void*) * objPCount(obj) <= objKeep(obj); }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 pushq $0x18 popq %rsi callq 0xeeb0 xorl %ebx, %ebx testl %eax, %eax je 0x12f92 movq (%r14), %rsi movq %r14, %rdi callq 0xeeb0 testl %eax, %eax je 0x12f92 movq 0x8(%r14), %rax cmpq %rax, 0x10(%r14) ja 0x12f92 leaq 0x18(,%rax,8), %rax xorl %ebx, %ebx cmpq (%r14), %rax setb...
/agievich[P]bee2/src/core/obj.c
objIsOperable
bool_t objIsOperable(const void* obj) { size_t i; // проверить сам объект if (!objIsOperable2(obj)) return FALSE; // проверить ссылочные объекты for (i = 0; i < objOCount(obj); ++i) if (!objIsOperable(objCPtr(obj, i, void))) return FALSE; // все нормально return TRUE; }
pushq %rbp pushq %r14 pushq %rbx movq %rdi, %rbx callq 0xe7d0 testl %eax, %eax je 0x12fc9 xorl %r14d, %r14d pushq $0x1 popq %rbp cmpq 0x10(%rbx), %r14 jae 0x12fcb movq 0x18(%rbx,%r14,8), %rdi callq 0xf850 incq %r14 testl %eax, %eax jne 0x12fb2 xorl %ebp, %ebp movl %ebp, %eax popq %rbx popq %r14 popq %rbp retq
/agievich[P]bee2/src/core/obj.c
objCopy
void objCopy(void* dest, const void* src) { ASSERT(objIsOperable(src)); ASSERT(memIsValid(dest, objKeep(src))); // скопировать данные memMove(dest, src, objKeep(src)); // сдвинуть указатели objShiftPtrs(dest, (const octet*)dest - (const octet*)src); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq (%rsi), %rdx callq 0xe130 movq %r14, %rsi subq %rbx, %rsi movq %r14, %rdi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x12ff6
/agievich[P]bee2/src/core/obj.c
objShiftPtrs
static void objShiftPtrs(void* obj, ptrdiff_t diff) { size_t i; // просмотреть объекты for (i = 0; i < objOCount(obj); ++i) // вложенный объект? if ((octet*)obj <= objPtr(obj, i, octet) + diff && objPtr(obj, i, octet) + diff < objEnd(obj, octet)) { objShiftPtrs(objPtr(obj, i, void), diff); objPtr(obj...
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 xorl %r15d, %r15d cmpq 0x10(%r14), %r15 jae 0x13055 movq 0x18(%r14,%r15,8), %rdi leaq (%rdi,%rbx), %rax cmpq %r14, %rax jb 0x13030 movq (%r14), %rcx addq %r14, %rcx cmpq %rcx, %rax jae 0x13030 movq %rbx, %rsi callq 0x12ff6 addq %rbx, 0x18(%r14,%r15,8) inc...
/agievich[P]bee2/src/core/obj.c
objAppend
void objAppend(void* dest, const void* src, size_t i) { size_t t; // pre ASSERT(objIsOperable(src)); ASSERT(objIsOperable(dest)); ASSERT(memIsValid(objEnd(dest, void), objKeep(src))); ASSERT(i < objOCount(dest)); // запомнить размер src t = objKeep(src); // скопировать src в конец dest objCopy(objEnd(dest, vo...
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rdi, %r14 movq (%rsi), %r15 movq (%rdi), %rdi addq %r14, %rdi callq 0xfa50 movq (%r14), %rax addq %r14, %rax movq %rax, 0x18(%r14,%rbx,8) addq %r15, (%r14) popq %rbx popq %r14 popq %r15 retq nop
/agievich[P]bee2/src/core/obj.c
oidIsValid
bool_t oidIsValid(const char* oid) { u32 val = 0; u32 d1 = 0; size_t pos = 0; size_t n = 0; // pre if (!strIsValid(oid)) return FALSE; // цикл по символам oid while (1) { // закончили очередное число? if (oid[pos] == '.' || oid[pos] == '\0') { // пустое число? d1 > 2? d1 < 2 && d2 >= 40? // 40 * ...
pushq %rbx movq %rdi, %rbx callq 0xe0d0 testl %eax, %eax je 0x13165 xorl %ecx, %ecx xorl %edx, %edx xorl %edi, %edi xorl %esi, %esi movzbl (%rbx,%rsi), %r8d cmpl $0x2e, %r8d je 0x1310e testl %r8d, %r8d je 0x1310e leal -0x3a(%r8), %r9d xorl %eax, %eax cmpb $-0xa, %r9b jb 0x13167 cmpq $0x1, %rsi jne 0x130d8 cmpb $0x30, (...
/agievich[P]bee2/src/core/oid.c
prngCOMBOStart
void prngCOMBOStart(void* state, u32 seed) { prng_combo_st* s = (prng_combo_st*)state; ASSERT(memIsValid(s, sizeof(*s))); s->x = 0xF8B7BB93; s->y = 0xBEE3B54B; s->z = 0x1F6B7FBD + seed; if (s->z) ++s->z; s->reserved = 0; }
movabsq $-0x411c4ab40748446d, %rax # imm = 0xBEE3B54BF8B7BB93 movq %rax, (%rdi) leal 0x1f6b7fbe(%rsi), %eax xorl %ecx, %ecx cmpl $0xe0948043, %esi # imm = 0xE0948043 cmovnel %eax, %ecx movl %ecx, 0x8(%rdi) andq $0x0, 0x10(%rdi) retq
/agievich[P]bee2/src/core/prng.c
prngCOMBOStepR
void prngCOMBOStepR(void* buf, size_t count, void* state) { prng_combo_st* s = (prng_combo_st*)state; ASSERT(memIsValid(buf, count)); ASSERT(memIsValid(s, sizeof(*s))); // есть резерв? if (s->reserved) { if (s->reserved >= count) { memCopy(buf, s->r.block + 4 - s->reserved, count); s->reserved -= count;...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 leaq 0x10(%rdx), %rbp movq 0x10(%rdx), %rdx testq %rdx, %rdx je 0x13222 movq %rbp, %rsi subq %rdx, %rsi cmpq %rbx, %rdx jae 0x1326d movq %r14, %rdi callq 0xe970 movq (%rbp), %rax subq %rax, %rbx ...
/agievich[P]bee2/src/core/prng.c
prngCOMBOStep
static void prngCOMBOStep(prng_combo_st* s) { s->r.u32 = s->x * s->x; s->x = s->y; s->y = s->r.u32; s->z = (s->z & 0xFFFF) * 30903 + (s->z >> 16); s->r.u32 += s->z; #if (OCTET_ORDER == BIG_ENDIAN) s->r.u32 = u32Rev(s->r.u32); #endif }
movl (%rdi), %eax movl 0x4(%rdi), %ecx imull %eax, %eax movl %ecx, (%rdi) movl %eax, 0x4(%rdi) movl 0x8(%rdi), %ecx movzwl %cx, %edx imull $0x78b7, %edx, %edx # imm = 0x78B7 shrl $0x10, %ecx addl %edx, %ecx movl %ecx, 0x8(%rdi) addl %eax, %ecx movl %ecx, 0xc(%rdi) retq
/agievich[P]bee2/src/core/prng.c
prngEchoStart
void prngEchoStart(void* state, const void* seed, size_t seed_len) { prng_echo_st* s = (prng_echo_st*)state; ASSERT(memIsValid(s, sizeof(prng_echo_st))); ASSERT(seed_len > 0); ASSERT(memIsValid(seed, seed_len)); // инициализировать s->seed = (const octet*)seed; s->seed_len = seed_len; s->pos = 0; }
movq %rsi, (%rdi) movq %rdx, 0x8(%rdi) andq $0x0, 0x10(%rdi) retq
/agievich[P]bee2/src/core/prng.c
prngSTBStart
void prngSTBStart(void* state, const u16 z[31]) { prng_stb_st* s = (prng_stb_st*)state; size_t i; // pre ASSERT(memIsValid(s, sizeof(prng_stb_st))); ASSERT(memIsNullOrValid(z, 2 * 31)); // загрузить z for (i = 0; i < 31; ++i) { s->z[i] = z ? z[i] : (u16)(i + 1); ASSERT(s->z[i] > 0 && s->z[i] < 65257); } /...
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx pushq $0x4 popq %rax cmpq $0x23, %rax je 0x1332a testq %rsi, %rsi je 0x1331e movzwl -0x8(%rsi,%rax,2), %ecx jmp 0x13321 leal -0x3(%rax), %ecx movw %cx, (%rbx,%rax,2) incq %rax jmp 0x1330c andl $0x0, 0x46(%rbx) andq $0x0, (%rbx) movl $0x100, %r14d # imm = 0x100 ...
/agievich[P]bee2/src/core/prng.c
prngSTBClock
static void _prngSTBClock(prng_stb_st* s) { size_t j = (s->i + 10) % 31; // v <- v + z[i] s->v += s->z[s->i]; // w <- z[i + 20] + rotHi(w, 1) s->w = (s->w >> 1) | (s->w << 15); s->w += s->z[(s->i + 20) % 31]; // u <- v ^ w s->u = s->v ^ s->w; // z[i] <- (z[i - 31] - z[i - 21]) \mod 65257 ASSERT(s->z[s->i] < 6...
movq (%rdi), %r8 leaq 0xa(%r8), %rax pushq $0x1f popq %rsi xorl %edx, %edx divq %rsi movq %rdx, %rcx movzwl 0x46(%rdi), %r9d addw 0x8(%rdi,%r8,2), %r9w movw %r9w, 0x46(%rdi) movzwl 0x48(%rdi), %r10d rorw %r10w leaq 0x14(%r8), %rax xorl %edx, %edx divq %rsi movl %edx, %eax addw 0x8(%rdi,%rax,2), %r10w movw %r10w, 0x48(%...
/agievich[P]bee2/src/core/prng.c
rngTestFIPS1
bool_t rngTestFIPS1(const octet buf[2500]) { size_t s = 0; size_t count = W_OF_O(2500); ASSERT(memIsValid(buf, 2500)); if (O_OF_W(count) > 2500) { ASSERT(B_PER_W == 64); s = u32Weight(*(const u32*)(buf + 2496)); --count; } while (count--) s += wordWeight(((const word*)buf)[count]); return 9725 < s && s ...
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movl 0x9c0(%rdi), %edi callq 0xf6e0 movq %rax, %r14 movl $0x137, %r15d # imm = 0x137 cmpq $-0x1, %r15 je 0x13453 movq (%rbx,%r15,8), %rdi callq 0xeae0 addq %rax, %r14 decq %r15 jmp 0x1343c addq $-0x25fe, %r14 # imm = 0xDA02 xorl %eax, %eax cmpq $0x225,...
/agievich[P]bee2/src/core/rng.c
rngTestFIPS2
bool_t rngTestFIPS2(const octet buf[2500]) { u32 s[16]; size_t i = 2500; ASSERT(memIsValid(buf, 2500)); memSetZero(s, sizeof(s)); while (i--) ++s[buf[i] & 15], ++s[buf[i] >> 4]; s[0] *= s[0]; for (i = 1; i < 16; ++i) s[0] += s[i] * s[i]; s[0] = 16 * s[0] - 5000 * 5000; return 10800 < s[0] && s[0] < 230850;...
pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq %rsp, %rdi pushq $0x40 popq %rdx xorl %esi, %esi callq 0xf710 movl $0x9c4, %ecx # imm = 0x9C4 movl $0x9c4, %eax # imm = 0x9C4 subq $0x1, %rax jb 0x134a9 movzbl -0x1(%rbx,%rcx), %ecx movl %ecx, %edx andl $0xf, %edx incl (%rsp,%rdx,4) shrl $0x4, %ecx ...
/agievich[P]bee2/src/core/rng.c
rngTestFIPS3
bool_t rngTestFIPS3(const octet buf[2500]) { word s[2][7]; octet b; size_t l; size_t i; ASSERT(memIsValid(buf, 2500)); memSetZero(s, sizeof(s)); b = buf[0] & 1; l = 1; for (i = 1; i < 20000; ++i) if ((buf[i / 8] >> i % 8 & 1) == b) ++l; else ++s[b][MIN2(l, 6)], b = !b, l = 1; ++s[b][MIN2(l, 6)]; re...
pushq %rbx subq $0x70, %rsp movq %rdi, %rbx movq %rsp, %rdi pushq $0x70 popq %rdx xorl %esi, %esi callq 0xf710 movb (%rbx), %dil andb $0x1, %dil pushq $0x1 popq %rcx pushq $0x6 popq %rax movq %rcx, %rsi movq %rcx, %rdx movzbl %dil, %r8d cmpq $0x4e20, %rdx # imm = 0x4E20 je 0x13560 movq %rdx, %r9 shrq $0x3, %r...
/agievich[P]bee2/src/core/rng.c
rngTestFIPS4
bool_t rngTestFIPS4(const octet buf[2500]) { octet b; size_t l; size_t i; ASSERT(memIsValid(buf, 2500)); b = buf[0] & 1; l = 1; for (i = 1; i < 20000; ++i) if ((buf[i / 8] >> i % 8 & 1) == b) ++l; else { if (l >= 26) return FALSE; b = !b, l = 1; } return l < 26; }
movb (%rdi), %al andb $0x1, %al pushq $0x1 popq %rcx movq %rcx, %rsi movq %rcx, %rdx cmpq $0x4e20, %rdx # imm = 0x4E20 je 0x136c0 movq %rdx, %r8 shrq $0x3, %r8 movzbl (%rdi,%r8), %r8d movl %edx, %r9d andl $0x7, %r9d xorl %r10d, %r10d btl %r9d, %r8d setb %r10b movzbl %al, %r8d cmpl %r8d, %r10d jne 0x136ad incq...
/agievich[P]bee2/src/core/rng.c
rngESRead
err_t rngESRead(size_t* read, void* buf, size_t count, const char* source) { if (strEq(source, "trng")) return rngTRNGRead(buf, read, count); else if (strEq(source, "trng2")) return rngTRNG2Read(buf, read, count); else if (strEq(source, "timer")) return rngTimerRead(buf, read, count); else if (strEq(source, "...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rcx, %r12 movq %rdx, %rbx movq %rsi, 0x8(%rsp) movq %rdi, %r15 leaq 0x3a2d1(%rip), %rsi # 0x4d9c1 movq %rcx, %rdi callq 0xebd0 testl %eax, %eax je 0x137db leaq 0x3a2bf(%rip), %rsi # 0x4d9c6 movq %r12, %rdi callq 0xebd0 test...
/agievich[P]bee2/src/core/rng.c
rngESHealth2
err_t rngESHealth2() { const char* sources[] = { "trng", "trng2" }; size_t pos; // проверить физические источники for (pos = 0; pos < COUNT_OF(sources); ++pos) if (rngESTest(sources[pos]) == ERR_OK) return ERR_OK; // работоспособные источники не найдены return ERR_NOT_ENOUGH_ENTROPY; }
pushq %r14 pushq %rbx pushq %rax xorl %ebx, %ebx leaq 0x39f26(%rip), %r14 # 0x4da4c cmpq $0x8, %rbx je 0x13b44 movslq (%rbx,%r14), %rdi addq %r14, %rdi callq 0xfc30 addq $0x4, %rbx testl %eax, %eax jne 0x13b26 xorl %eax, %eax jmp 0x13b49 movl $0x12f, %eax # imm = 0x12F addq $0x8, %rsp popq %rbx popq %r14...
/agievich[P]bee2/src/core/rng.c
rngESHealth
err_t rngESHealth() { const char* sources[] = { "sys", "sys2", "timer" }; size_t valid_sources = 0; size_t pos; // есть работоспособный физический источник? if (rngESHealth2() == ERR_OK) return ERR_OK; // проверить остальные источники for (pos = 0; pos < COUNT_OF(sources); ++pos) { if (rngESTest(sources[pos...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax callq 0xeac0 testl %eax, %eax je 0x13b97 xorl %ebx, %ebx leaq 0x39ee9(%rip), %r14 # 0x4da54 pushq $0x1 popq %r15 xorl %r12d, %r12d cmpq $0xc, %rbx je 0x13b9b movslq (%rbx,%r14), %rdi addq %r14, %rdi callq 0xfc30 testl %eax, %eax jne 0x13b91 cmpq $0x1, %r12 movq...
/agievich[P]bee2/src/core/rng.c
rngCreate
err_t rngCreate(read_i source, void* source_state) { const char* sources[] = { "trng", "trng2", "sys", "timer" }; size_t read, count, pos; // инициализировать однократно if (!mtCallOnce(&_once, rngInit) || !_inited) return ERR_FILE_CREATE; // заблокировать мьютекс mtMtxLock(_mtx); // состояние уже создано? if...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x548a3(%rip), %rdi # 0x684a0 leaq 0x406(%rip), %rsi # 0x1400a callq 0xf2f0 movl $0xc9, %r15d testl %eax, %eax je 0x13c76 testb $0x1, 0x5488e(%rip) # 0x684a8 je 0x13c76 leaq 0x5488d(%rip...
/agievich[P]bee2/src/core/rng.c
rngIsValid
bool_t rngIsValid() { bool_t b; if (!_inited) return FALSE; mtMtxLock(_mtx); b = rngIsValid_internal(); mtMtxUnlock(_mtx); return b; }
pushq %rbx xorl %ebx, %ebx cmpb $0x1, 0x546a7(%rip) # 0x684a8 jne 0x13e48 leaq 0x546a6(%rip), %rdi # 0x684b0 callq 0xfc50 cmpq $0x0, 0x546c1(%rip) # 0x684d8 setne %al movq 0x546bf(%rip), %rdi # 0x684e0 testq %rdi, %rdi setne %cl andb %al, %cl xorl %ebx, %ebx cmpb $0x1, %cl jne 0x13e3c callq 0xffb0 xorl ...
/agievich[P]bee2/src/core/rng.c
rngClose
void rngClose() { ASSERT(_inited); mtMtxLock(_mtx); ASSERT(rngIsValid_internal()); if (--_ctr == 0) blobClose(_state), _state = 0; mtMtxUnlock(_mtx); }
pushq %rax leaq 0x5465c(%rip), %rdi # 0x684b0 callq 0xfc50 decq 0x54678(%rip) # 0x684d8 jne 0x13e76 movq 0x54677(%rip), %rdi # 0x684e0 callq 0xe920 andq $0x0, 0x5466a(%rip) # 0x684e0 leaq 0x54633(%rip), %rdi # 0x684b0 popq %rax jmp 0x101b0
/agievich[P]bee2/src/core/rng.c
rngStepR
void rngStepR(void* buf, size_t count, void* state) { const char* sources[] = {"trng", "trng2", "sys", "sys2", "timer"}; size_t read, r, pos; // блокировать мьютекс ASSERT(_inited); mtMtxLock(_mtx); // опросить источники read = pos = 0; while (read < count && pos < COUNT_OF(sources)) { if (rngESRead(&r, (oct...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 leaq 0x545d8(%rip), %rdi # 0x684b0 callq 0xfc50 leaq 0x39b8c(%rip), %rbp # 0x4da70 xorl %r13d, %r13d movq %rbp, %r15 xorl %r12d, %r12d movq %rbx, %rdx subq %r13, %rdx jbe 0x13f2b cmpq $0x4, %r12 ja 0x13f...
/agievich[P]bee2/src/core/rng.c
rngRekey
void rngRekey() { // блокировать мьютекс ASSERT(_inited); mtMtxLock(_mtx); // сгенерировать новый ключ ASSERT(rngIsValid_internal()); brngCTRStepR(_state->block, 32, _state->alg_state); // пересоздать brngCTR brngCTRStart(_state->alg_state, _state->block, 0); memWipe(_state->block, 32); // снять блокировку m...
pushq %r14 pushq %rbx pushq %rax leaq 0x5454a(%rip), %rbx # 0x684b0 movq %rbx, %rdi callq 0xfc50 movq 0x5456b(%rip), %rdi # 0x684e0 leaq 0x20(%rdi), %rdx pushq $0x20 popq %r14 movq %r14, %rsi callq 0xff40 movq 0x54554(%rip), %rsi # 0x684e0 leaq 0x20(%rsi), %rdi xorl %edx, %edx callq 0xe280 movq 0x54542(%rip...
/agievich[P]bee2/src/core/rng.c
rngCPUIDIsManufId
static bool_t rngCPUIDIsManufId(const u32 info[4], const char id[12 + 1]) { ASSERT(strIsValid(id)); ASSERT(strLen(id) == 12); return memEq(info + 1, id + 0, 4) && memEq(info + 3, id + 4, 4) && memEq(info + 2, id + 8, 4); }
pushq %rbp pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 addq $0x4, %rdi pushq $0x4 popq %rdx callq 0xf140 xorl %ebp, %ebp testl %eax, %eax je 0x14003 leaq 0xc(%r14), %rdi leaq 0x4(%rbx), %rsi pushq $0x4 popq %rdx callq 0xf140 testl %eax, %eax je 0x14003 addq $0x8, %r14 addq $0x8, %rbx pushq $0x4 popq %rdx movq...
/agievich[P]bee2/src/core/rng.c
rngInit
static void rngInit() { ASSERT(!_inited); // создать мьютекс if (!mtMtxCreate(_mtx)) return; // зарегистрировать деструктор if (!utilOnExit(rngDestroy)) { mtMtxClose(_mtx); return; } _inited = TRUE; }
pushq %rax leaq 0x5449e(%rip), %rdi # 0x684b0 callq 0xe620 testl %eax, %eax je 0x14032 leaq 0x1f(%rip), %rdi # 0x14041 callq 0xe9d0 testl %eax, %eax je 0x14034 movb $0x1, 0x54476(%rip) # 0x684a8 popq %rax retq leaq 0x54475(%rip), %rdi # 0x684b0 popq %rax jmp 0xff00
/agievich[P]bee2/src/core/rng.c
rngDestroy
static void rngDestroy() { // закрыть состояние (могли забыть) mtMtxLock(_mtx); blobClose(_state), _state = 0, _ctr = 0; mtMtxUnlock(_mtx); // закрыть мьютекс mtMtxClose(_mtx); }
pushq %rbx leaq 0x54467(%rip), %rbx # 0x684b0 movq %rbx, %rdi callq 0xfc50 movq 0x54488(%rip), %rdi # 0x684e0 callq 0xe920 andq $0x0, 0x5447b(%rip) # 0x684e0 andq $0x0, 0x5446b(%rip) # 0x684d8 movq %rbx, %rdi callq 0x101b0 movq %rbx, %rdi popq %rbx jmp 0xff00 nop
/agievich[P]bee2/src/core/rng.c
strIsAlphanumeric
bool_t strIsAlphanumeric(const char* str) { ASSERT(strIsValid(str)); for (; *str; ++str) if ((*str < '0' || *str > '9') && (*str < 'A' || *str > 'Z') && (*str < 'a' || *str > 'z')) return FALSE; return TRUE; }
pushq $0x1 popq %rax movb (%rdi), %cl testb %cl, %cl je 0x14120 leal -0x3a(%rcx), %edx incq %rdi cmpb $-0xb, %dl ja 0x14102 andb $-0x21, %cl addb $-0x5b, %cl cmpb $-0x1b, %cl ja 0x14102 xorl %eax, %eax retq
/agievich[P]bee2/src/core/str.c
strIsPrintable
bool_t strIsPrintable(const char* str) { ASSERT(strIsValid(str)); for (; *str; ++str) if ((*str < '0' || *str > '9') && (*str < 'A' || *str > 'Z') && (*str < 'a' || *str > 'z') && strchr(" '()+,-./:=?", *str) == 0) return FALSE; return TRUE; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdi, %r14 pushq $0x1 popq %rbx leaq 0x390de(%rip), %r15 # 0x4d214 pushq $0xd popq %r12 movsbl (%r14), %esi testl %esi, %esi je 0x1416a leal -0x3a(%rsi), %eax cmpb $-0xb, %al ja 0x14163 movl %esi, %eax andb $-0x21, %al addb $-0x5b, %al cmpb $-0x1b, %al ja ...
/agievich[P]bee2/src/core/str.c
strStartsWith
bool_t strStartsWith(const char* str, const char* prefix) { ASSERT(strIsValid(str)); ASSERT(strIsValid(prefix)); for(; *prefix; ++prefix, ++str) if (*str != *prefix) return FALSE; return TRUE; }
xorl %ecx, %ecx pushq $0x1 popq %rax movb (%rsi,%rcx), %dl testb %dl, %dl je 0x141a2 cmpb %dl, (%rdi,%rcx) jne 0x141a0 incq %rcx jmp 0x1418f xorl %eax, %eax retq
/agievich[P]bee2/src/core/str.c
strEndsWith
bool_t strEndsWith(const char* str, const char* suffix) { ASSERT(strIsValid(str)); ASSERT(strIsValid(suffix)); if (strLen(str) < strLen(suffix)) return FALSE; for(str += strLen(str) - strLen(suffix); *suffix; ++suffix, ++str) if (*str != *suffix) return FALSE; return TRUE; }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 callq 0xe750 movq %rax, %r15 movq %rbx, %rdi callq 0xe750 subq %rax, %r15 jae 0x141cb xorl %eax, %eax popq %rbx popq %r14 popq %r15 retq addq %r15, %r14 xorl %ecx, %ecx pushq $0x1 popq %rax movb (%rbx,%rcx), %dl testb %dl, %dl je 0x141c5 cmpb %dl, (%r14,%...
/agievich[P]bee2/src/core/str.c
strRev
void strRev(char* str) { size_t i, j; ASSERT(strIsValid(str)); for (i = 0, j = strLen(str); i + 1 < j;) { str[i] ^= str[--j]; str[j] ^= str[i]; str[i++] ^= str[j]; } }
pushq %rbx movq %rdi, %rbx callq 0xe750 pushq $0x1 popq %rcx cmpq %rax, %rcx jae 0x14216 movb -0x1(%rbx,%rcx), %dl xorb -0x1(%rbx,%rax), %dl movb %dl, -0x1(%rbx,%rcx) xorb -0x1(%rbx,%rax), %dl movb %dl, -0x1(%rbx,%rax) xorb %dl, -0x1(%rbx,%rcx) decq %rax incq %rcx jmp 0x141f1 popq %rbx retq
/agievich[P]bee2/src/core/str.c
tmDate
bool_t tmDate(size_t* y, size_t* m, size_t* d) { struct tm lt; time_t et; // входной контроль ASSERT(memIsNullOrValid(y, O_PER_S)); ASSERT(memIsNullOrValid(m, O_PER_S)); ASSERT(memIsNullOrValid(d, O_PER_S)); // получить отметку времени if (time(&et) == -1 || !localtime_r(&et, &lt)) return FALSE; // возвратит...
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x48, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x8(%rsp), %rdi callq 0xf230 xorl %ebp, %ebp cmpq $-0x1, %rax je 0x1431e leaq 0x8(%rsp), %rdi leaq 0x10(%rsp), %rsi callq 0xe2f0 testq %rax, %rax je 0x1431e testq %r15, %r15 je 0x142fe movslq 0x24(%rsp), %r...
/agievich[P]bee2/src/core/tm.c
tmDateIsValid2
bool_t tmDateIsValid2(const octet date[6]) { return memIsValid(date, 6) && tmDateIsValid( (size_t)10 * date[0] + date[1] + 2000, (size_t)10 * date[2] + date[3], (size_t)10 * date[4] + date[5]); }
pushq %rbx movq %rdi, %rbx pushq $0x6 popq %rsi callq 0xeeb0 testl %eax, %eax je 0x1447a movzbl (%rbx), %eax imulq $0xa, %rax, %rax movzbl 0x1(%rbx), %ecx leaq (%rcx,%rax), %rdi addq $0x7d0, %rdi # imm = 0x7D0 movzbl 0x2(%rbx), %eax imulq $0xa, %rax, %rax movzbl 0x3(%rbx), %esi addq %rax, %rsi movzbl 0x4(%rb...
/agievich[P]bee2/src/core/tm.c
tmCalcFreq
static void tmCalcFreq() { tm_ticks_t start; tm_ticks_t overhead; start = tmTicks(); overhead = tmTicks() - start; start = tmTicks(); mtSleep(100); _freq = tmTicks(); _freq = (_freq - start - overhead) * 10; }
pushq %r15 pushq %r14 pushq %rbx rdtsc movq %rdx, %rbx shlq $0x20, %rbx orq %rax, %rbx rdtsc movq %rdx, %r14 shlq $0x20, %r14 orq %rax, %r14 rdtsc movq %rdx, %r15 shlq $0x20, %r15 orq %rax, %r15 pushq $0x64 popq %rdi callq 0xefe0 rdtsc shlq $0x20, %rdx orq %rax, %rdx addq %r14, %r15 subq %r15, %rbx addq %rdx, %rbx imul...
/agievich[P]bee2/src/core/tm.c
u16CLZ_fast
size_t FAST(u16CLZ)(register u16 w) { register size_t l = 16; register u16 t; if (t = w >> 8) l -= 8, w = t; if (t = w >> 4) l -= 4, w = t; if (t = w >> 2) l -= 2, w = t; t = 0; return (w >> 1) ? l - 2 : l - (w ? 1 : 0); }
movl %edi, %eax shrl $0x8, %eax xorl %ecx, %ecx cmpw $0x100, %di # imm = 0x100 setb %cl cmovbl %edi, %eax shll $0x3, %ecx leaq 0x8(%rcx), %rdx movl %eax, %esi shrl $0x4, %esi orq $0x4, %rcx cmpw $0x10, %ax cmovbl %eax, %esi cmovbq %rdx, %rcx movl %esi, %eax shrl $0x2, %eax leaq -0x2(%rcx), %rdx cmpw $0x4, %...
/agievich[P]bee2/src/core/u16.c
u16Shuffle
u16 u16Shuffle(register u16 w) { register u16 t; t = (w ^ (w >> 4)) & 0x00F0, w ^= t ^ (t << 4); t = (w ^ (w >> 2)) & 0x0C0C, w ^= t ^ (t << 2); t = (w ^ (w >> 1)) & 0x2222, w ^= t ^ (t << 1); t = 0; return w; }
movl %edi, %eax shrl $0x4, %eax xorl %edi, %eax andl $0xf0, %eax imull $0x11, %eax, %eax xorl %edi, %eax movl %eax, %ecx shrl $0x2, %ecx xorl %eax, %ecx andl $0xc0c, %ecx # imm = 0xC0C leal (%rcx,%rcx,4), %ecx xorl %eax, %ecx movl %ecx, %eax shrl %eax xorl %ecx, %eax andl $0x2222, %eax # imm = 0x22...
/agievich[P]bee2/src/core/u16.c
u16Deshuffle
u16 u16Deshuffle(register u16 w) { register u16 t; t = (w ^ (w >> 1)) & 0x2222, w ^= t ^ (t << 1); t = (w ^ (w >> 2)) & 0x0C0C, w ^= t ^ (t << 2); t = (w ^ (w >> 4)) & 0x00F0, w ^= t ^ (t << 4); t = 0; return w; }
movl %edi, %eax shrl %eax xorl %edi, %eax andl $0x2222, %eax # imm = 0x2222 leal (%rax,%rax,2), %eax xorl %edi, %eax movl %eax, %ecx shrl $0x2, %ecx xorl %eax, %ecx andl $0xc0c, %ecx # imm = 0xC0C leal (%rcx,%rcx,4), %ecx xorl %eax, %ecx movl %ecx, %eax shrl $0x4, %eax xorl %ecx, %eax andl $0xf0, %...
/agievich[P]bee2/src/core/u16.c
u16NegInv
u16 u16NegInv(register u16 w) { register u16 ret = w; ASSERT(w & 1); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); w = 0; return ret; }
movl %edi, %eax imull %edi, %eax orl $0x2, %eax imull %edi, %eax movl %eax, %ecx imull %edi, %ecx addl $0x2, %ecx imull %eax, %ecx movl %ecx, %edx imull %edi, %edx addl $0x2, %edx imull %ecx, %edx imull %edx, %edi leal 0x2(%rdi), %eax imull %edx, %eax retq
/agievich[P]bee2/src/core/u16.c
u16From
void u16From(u16 dest[], const void* src, size_t count) { ASSERT(memIsValid(src, count)); ASSERT(memIsValid(dest, count + count % 2)); memMove(dest, src, count); if (count % 2) ((octet*)dest)[count] = 0; #if (OCTET_ORDER == BIG_ENDIAN) for (count = (count + 1) / 2; count--;) dest[count] = u16Rev(dest[count]); ...
pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx movq %rdi, %r14 callq 0xe130 testb $0x1, %bl je 0x14712 movb $0x0, (%r14,%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq
/agievich[P]bee2/src/core/u16.c
u16To
void u16To(void* dest, size_t count, const u16 src[]) { ASSERT(memIsValid(src, count + count % 2)); ASSERT(memIsValid(dest, count)); memMove(dest, src, count); #if (OCTET_ORDER == BIG_ENDIAN) if (count % 2) { register u16 u = src[--count / 2]; ((octet*)dest)[count] = (octet)u; u = 0; } for (count /= 2; cou...
movq %rsi, %rax movq %rdx, %rsi movq %rax, %rdx jmp 0xe130
/agievich[P]bee2/src/core/u16.c
u32Bitrev
u32 u32Bitrev(register u32 w) { w = ((w >> 1) & 0x55555555) | ((w & 0x55555555) << 1); w = ((w >> 2) & 0x33333333) | ((w & 0x33333333) << 2); w = ((w >> 4) & 0x0F0F0F0F) | ((w & 0x0F0F0F0F) << 4); w = ((w >> 8) & 0x00FF00FF) | ((w & 0x00FF00FF) << 8); w = (w >> 16) | (w << 16); return w; }
bswapl %edi movl %edi, %eax shrl $0x4, %eax movl $0xf0f0f0f, %ecx # imm = 0xF0F0F0F andl %ecx, %eax andl %ecx, %edi shll $0x4, %edi orl %eax, %edi movl $0x33333333, %eax # imm = 0x33333333 movl %edi, %ecx andl %eax, %ecx shrl $0x2, %edi andl %eax, %edi leal (%rdi,%rcx,4), %eax movl $0x55555555, %ecx ...
/agievich[P]bee2/src/core/u32.c
u32Weight
size_t u32Weight(register u32 w) { w -= ((w >> 1) & 0x55555555); w = (w & 0x33333333) + ((w >> 2) & 0x33333333); w = (w + (w >> 4)) & 0x0F0F0F0F; w += w >> 8; w += w >> 16; return (size_t)(w & 0x0000003F); }
movl %edi, %eax shrl %eax andl $0x55555555, %eax # imm = 0x55555555 subl %eax, %edi movl $0x33333333, %eax # imm = 0x33333333 movl %edi, %ecx andl %eax, %ecx shrl $0x2, %edi andl %eax, %edi addl %ecx, %edi movl %edi, %eax shrl $0x4, %eax addl %edi, %eax andl $0xf0f0f0f, %eax # imm = 0xF0F0F0F movl %e...
/agievich[P]bee2/src/core/u32.c
u32Parity
bool_t u32Parity(register u32 w) { w ^= w >> 1; w ^= w >> 2; w ^= w >> 4; w ^= w >> 8; w ^= w >> 16; return (bool_t)(w & U32_1); }
movl %edi, %eax shrl %eax xorl %edi, %eax movl %eax, %ecx shrl $0x2, %ecx xorl %eax, %ecx movl %ecx, %eax shrl $0x4, %eax xorl %ecx, %eax movl %eax, %ecx shrl $0x8, %ecx xorl %eax, %ecx movl %ecx, %eax shrl $0x10, %eax xorl %ecx, %eax andl $0x1, %eax retq
/agievich[P]bee2/src/core/u32.c
u32CTZ_fast
size_t FAST(u32CTZ)(register u32 w) { register size_t l = 32; register u32 t; // дихотомия if (t = w << 16) l -= 16, w = t; if (t = w << 8) l -= 8, w = t; if (t = w << 4) l -= 4, w = t; if (t = w << 2) l -= 2, w = t; // возврат t = 0; return ((u32)(w << 1)) ? l - 2 : l - (w ? 1 : 0); }
xorl %eax, %eax movl %edi, %ecx shll $0x10, %ecx sete %al cmovel %edi, %ecx shll $0x4, %eax leaq 0x10(%rax), %rdx movl %ecx, %esi shll $0x8, %esi orq $0x8, %rax testl %esi, %esi cmovel %ecx, %esi cmoveq %rdx, %rax movl %esi, %ecx shll $0x4, %ecx testl %ecx, %ecx cmovel %esi, %ecx leaq -0x4(%rax), %rdx cmoveq %rax, %rdx...
/agievich[P]bee2/src/core/u32.c
u32CLZ
size_t SAFE(u32CLZ)(register u32 w) { w = w | w >> 1; w = w | w >> 2; w = w | w >> 4; w = w | w >> 8; w = w | w >> 16; return u32Weight(~w); }
movl %edi, %eax shrl %eax orl %eax, %edi movl %edi, %eax shrl $0x2, %eax orl %eax, %edi movl %edi, %eax shrl $0x4, %eax orl %eax, %edi movl %edi, %eax shrl $0x8, %eax orl %eax, %edi movl %edi, %eax shrl $0x10, %eax orl %eax, %edi notl %edi jmp 0xf6e0
/agievich[P]bee2/src/core/u32.c
u32CLZ_fast
size_t FAST(u32CLZ)(register u32 w) { register size_t l = 32; register u32 t; // дихотомия if (t = w >> 16) l -= 16, w = t; if (t = w >> 8) l -= 8, w = t; if (t = w >> 4) l -= 4, w = t; if (t = w >> 2) l -= 2, w = t; // возврат t = 0; return (w >> 1) ? l - 2 : l - (w ? 1 : 0); }
movl %edi, %eax shrl $0x10, %eax xorl %ecx, %ecx cmpl $0x10000, %edi # imm = 0x10000 setb %cl cmovbl %edi, %eax shll $0x4, %ecx leaq 0x10(%rcx), %rdx movl %eax, %esi shrl $0x8, %esi orq $0x8, %rcx cmpl $0x100, %eax # imm = 0x100 cmovbl %eax, %esi cmovbq %rdx, %rcx movl %esi, %eax shrl $0x4, %eax lea...
/agievich[P]bee2/src/core/u32.c
u32Shuffle
u32 u32Shuffle(register u32 w) { register u32 t; t = (w ^ (w >> 8)) & 0x0000FF00, w ^= t ^ (t << 8); t = (w ^ (w >> 4)) & 0x00F000F0, w ^= t ^ (t << 4); t = (w ^ (w >> 2)) & 0x0C0C0C0C, w ^= t ^ (t << 2); t = (w ^ (w >> 1)) & 0x22222222, w ^= t ^ (t << 1); t = 0; return w; }
movl %edi, %eax shrl $0x8, %eax xorl %edi, %eax andl $0xff00, %eax # imm = 0xFF00 imull $0x101, %eax, %eax # imm = 0x101 xorl %edi, %eax movl %eax, %ecx shrl $0x4, %ecx xorl %eax, %ecx andl $0xf000f0, %ecx # imm = 0xF000F0 imull $0x11, %ecx, %ecx xorl %eax, %ecx movl %ecx, %eax shrl $0x2, %eax xo...
/agievich[P]bee2/src/core/u32.c
u32Deshuffle
u32 u32Deshuffle(register u32 w) { register u32 t; t = (w ^ (w >> 1)) & 0x22222222, w ^= t ^ (t << 1); t = (w ^ (w >> 2)) & 0x0C0C0C0C, w ^= t ^ (t << 2); t = (w ^ (w >> 4)) & 0x00F000F0, w ^= t ^ (t << 4); t = (w ^ (w >> 8)) & 0x0000FF00, w ^= t ^ (t << 8); t = 0; return w; }
movl %edi, %eax shrl %eax xorl %edi, %eax andl $0x22222222, %eax # imm = 0x22222222 leal (%rax,%rax,2), %eax xorl %edi, %eax movl %eax, %ecx shrl $0x2, %ecx xorl %eax, %ecx andl $0xc0c0c0c, %ecx # imm = 0xC0C0C0C leal (%rcx,%rcx,4), %ecx xorl %eax, %ecx movl %ecx, %eax shrl $0x4, %eax xorl %ecx, %eax andl ...
/agievich[P]bee2/src/core/u32.c
u32NegInv
u32 u32NegInv(register u32 w) { register u32 ret = w; ASSERT(w & 1); // для t = 1,...,k: ret <- ret * (w * ret + 2) ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); ret = ret * (w * ret + 2); w = 0; return ret; }
movl %edi, %eax imull %edi, %eax orl $0x2, %eax imull %edi, %eax movl %eax, %ecx imull %edi, %ecx addl $0x2, %ecx imull %eax, %ecx movl %ecx, %eax imull %edi, %eax addl $0x2, %eax imull %ecx, %eax movl %eax, %ecx imull %edi, %ecx addl $0x2, %ecx imull %eax, %ecx imull %ecx, %edi leal 0x2(%rdi), %eax imull %ecx, %eax re...
/agievich[P]bee2/src/core/u32.c
u32From
void u32From(u32 dest[], const void* src, size_t count) { ASSERT(memIsValid(src, count)); ASSERT(memIsValid(dest, ((count + 3) / 4) * 4)); memMove(dest, src, count); if (count % 4) memSetZero((octet*)dest + count, 4 - count % 4); #if (OCTET_ORDER == BIG_ENDIAN) for (count = (count + 3) / 4; count--;) dest[coun...
pushq %r14 pushq %rbx pushq %rax movq %rdx, %r14 movq %rdi, %rbx callq 0xe130 movq %r14, %rax andq $0x3, %rax je 0x149d9 addq %r14, %rbx pushq $0x4 popq %rdx subq %rax, %rdx movq %rbx, %rdi xorl %esi, %esi addq $0x8, %rsp popq %rbx popq %r14 jmp 0xf710 addq $0x8, %rsp popq %rbx popq %r14 retq
/agievich[P]bee2/src/core/u32.c
u32To
void u32To(void* dest, size_t count, const u32 src[]) { ASSERT(memIsValid(src, (count + 3) / 4 * 4)); ASSERT(memIsValid(dest, count)); memMove(dest, src, count); #if (OCTET_ORDER == BIG_ENDIAN) if (count % 4) { size_t t = count / 4; register u32 u = src[t]; for (t *= 4; t < count; ++t, u >>= 8) ((octet*)d...
movq %rsi, %rax movq %rdx, %rsi movq %rax, %rdx jmp 0xe130 nop
/agievich[P]bee2/src/core/u32.c
u64Weight
size_t u64Weight(register u64 w) { w -= ((w >> 1) & 0x5555555555555555); w = (w & 0x3333333333333333) + ((w >> 2) & 0x3333333333333333); w = (w + (w >> 4)) & 0x0F0F0F0F0F0F0F0F; w += w >> 8; w += w >> 16; w += w >> 32; return (size_t)(w & 0x000000000000007F); }
movq %rdi, %rax shrq %rax movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555 andq %rax, %rcx subq %rcx, %rdi movabsq $0x3333333333333333, %rax # imm = 0x3333333333333333 movq %rdi, %rcx andq %rax, %rcx shrq $0x2, %rdi andq %rdi, %rax addq %rcx, %rax movq %rax, %rcx shrq $0x4, %rcx addq %rax, %rcx movabsq $0xf...
/agievich[P]bee2/src/core/u64.c