index
int64
0
66.5k
func_name
stringlengths
2
5.36k
func_dep
stringlengths
16
2.19k
func
stringlengths
8
55.3k
test
stringlengths
0
7.07k
opt
stringclasses
4 values
language
stringclasses
2 values
asm
stringlengths
0
45.4k
ida_asm
stringlengths
0
44.7k
ida_pseudo
stringlengths
0
44.3k
ghidra_asm
stringlengths
0
49.1k
ghidra_pseudo
stringlengths
0
64.7k
2,900
get_length
eloqsql/strings/my_vsnprintf.c
static const char *get_length(const char *fmt, size_t *length, uint *pre_zero) { for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) { *length= *length * 10 + (uint)(*fmt - '0'); if (!*length) *pre_zero|= PREZERO_ARG; /* first digit was 0 */ } return fmt; }
O3
c
get_length: pushq %rbp movq %rsp, %rbp movq %rdi, %rax leaq 0x2bbde6(%rip), %rcx # 0x314760 movq 0x40(%rcx), %r8 movzbl (%rdi), %edi testb $0x4, 0x1(%r8,%rdi) je 0x589b2 movq (%rsi), %r8 leaq (%r8,%r8,4), %r8 addq %r8, %r8 movsbl %dil, %edi addl $-0x30, %edi addq %r8, %rdi movq %rdi, (%rsi) jne 0x589a5 orb $0x4, (%rdx) movq 0x40(%rcx), %r8 movzbl 0x1(%rax), %edi incq %rax jmp 0x58981 popq %rbp retq
get_length: push rbp mov rbp, rsp mov rax, rdi lea rcx, my_charset_latin1 mov r8, [rcx+40h] movzx edi, byte ptr [rdi] loc_58981: test byte ptr [r8+rdi+1], 4 jz short loc_589B2 mov r8, [rsi] lea r8, [r8+r8*4] add r8, r8 movsx edi, dil add edi, 0FFFFFFD0h add rdi, r8 mov [rsi], rdi jnz short loc_589A5 or byte ptr [rdx], 4 loc_589A5: mov r8, [rcx+40h] movzx edi, byte ptr [rax+1] inc rax jmp short loc_58981 loc_589B2: pop rbp retn
unsigned __int8 * get_length(unsigned __int8 *a1, _QWORD *a2, _BYTE *a3) { unsigned __int8 *result; // rax long long v4; // r8 long long i; // rdi long long v6; // r8 long long v7; // rdi result = a1; v4 = *(_QWORD *)&my_charset_latin1[16]; for ( i = *a1; (*(_BYTE *)(v4 + i + 1) & 4) != 0; i = *++result ) { v6 = 10LL * *a2; v7 = (unsigned int)((char)i - 48); *a2 = v6 + v7; if ( !(v6 + v7) ) *a3 |= 4u; v4 = *(_QWORD *)&my_charset_latin1[16]; } return result; }
get_length: PUSH RBP MOV RBP,RSP MOV RAX,RDI LEA RCX,[0x414760] MOV R8,qword ptr [RCX + 0x40] MOVZX EDI,byte ptr [RDI] LAB_00158981: TEST byte ptr [R8 + RDI*0x1 + 0x1],0x4 JZ 0x001589b2 MOV R8,qword ptr [RSI] LEA R8,[R8 + R8*0x4] ADD R8,R8 MOVSX EDI,DIL ADD EDI,-0x30 ADD RDI,R8 MOV qword ptr [RSI],RDI JNZ 0x001589a5 OR byte ptr [RDX],0x4 LAB_001589a5: MOV R8,qword ptr [RCX + 0x40] MOVZX EDI,byte ptr [RAX + 0x1] INC RAX JMP 0x00158981 LAB_001589b2: POP RBP RET
void get_length(byte *param_1,long *param_2,byte *param_3) { byte bVar1; long lVar2; bVar1 = *param_1; while ((PTR_ctype_latin1_004147a0[(ulong)bVar1 + 1] & 4) != 0) { lVar2 = (ulong)((int)(char)bVar1 - 0x30) + *param_2 * 10; *param_2 = lVar2; if (lVar2 == 0) { *param_3 = *param_3 | 4; } bVar1 = param_1[1]; param_1 = param_1 + 1; } return; }
2,901
decltype(fp0.reserve(std::declval<std::vector<int, std::allocator<int>>::size_type>()), fp.get<std::vector<int, std::allocator<int>>::value_type>(), (void)()) nlohmann::json_abi_v3_11_3::detail::from_json_array_impl<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>, std::vector<int, std::allocator<int>>, 0>(nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void> const&, std::vector<int, std::allocator<int>>&, nlohmann::json_abi_v3_11_3::detail::priority_tag<1u>)
monkey531[P]llama/common/./json.hpp
auto from_json_array_impl(const BasicJsonType& j, ConstructibleArrayType& arr, priority_tag<1> /*unused*/) -> decltype( arr.reserve(std::declval<typename ConstructibleArrayType::size_type>()), j.template get<typename ConstructibleArrayType::value_type>(), void()) { using std::end; ConstructibleArrayType ret; ret.reserve(j.size()); std::transform(j.begin(), j.end(), std::inserter(ret, end(ret)), [](const BasicJsonType & i) { // get<BasicJsonType>() returns *this, this won't call a from_json // method when value_type is BasicJsonType return i.template get<typename ConstructibleArrayType::value_type>(); }); arr = std::move(ret); }
O2
cpp
decltype(fp0.reserve(std::declval<std::vector<int, std::allocator<int>>::size_type>()), fp.get<std::vector<int, std::allocator<int>>::value_type>(), (void)()) nlohmann::json_abi_v3_11_3::detail::from_json_array_impl<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>, std::vector<int, std::allocator<int>>, 0>(nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void> const&, std::vector<int, std::allocator<int>>&, nlohmann::json_abi_v3_11_3::detail::priority_tag<1u>): pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rsi, %rbx movq %rdi, %r14 xorps %xmm0, %xmm0 movq %rsp, %r15 movaps %xmm0, (%r15) andq $0x0, 0x10(%r15) callq 0x4f050 movq %r15, %rdi movq %rax, %rsi callq 0x7805c leaq 0x38(%rsp), %r15 movq %r15, %rdi movq %r14, %rsi callq 0x6d29e leaq 0x18(%rsp), %r12 movq %r12, %rdi movq %r14, %rsi callq 0x6d332 movq %rsp, %rdx movq 0x8(%rdx), %rcx movq %r15, %rdi movq %r12, %rsi callq 0x780f2 movq %rsp, %r14 movq %rbx, %rdi movq %r14, %rsi callq 0x6b4d4 movq %r14, %rdi callq 0x3e8f8 addq $0x58, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %rax, %rbx movq %rsp, %rdi callq 0x3e8f8 movq %rbx, %rdi callq 0x293c0
_ZN8nlohmann16json_abi_v3_11_36detail20from_json_array_implINS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES5_IhSaIhEEvEES5_IiSaIiEETnNSt9enable_ifIXsr3std13is_assignableIRT0_SJ_EE5valueEiE4typeELi0EEEDTcmcmcldtfp0_7reserveclsr3stdE7declvalINSJ_9size_typeEEEEcldtfp_3getINSJ_10value_typeEEEcvv_EERKT_SK_NS1_12priority_tagILj1EEE: push r15 push r14 push r12 push rbx sub rsp, 58h mov rbx, rsi mov r14, rdi xorps xmm0, xmm0 mov r15, rsp movaps xmmword ptr [r15], xmm0 and qword ptr [r15+10h], 0 call _ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4sizeEv; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::size(void) mov rdi, r15 mov rsi, rax call _ZNSt6vectorIiSaIiEE7reserveEm; std::vector<int>::reserve(ulong) lea r15, [rsp+78h+var_40] mov rdi, r15 mov rsi, r14 call _ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE6cbeginEv; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::cbegin(void) lea r12, [rsp+78h+var_60] mov rdi, r12 mov rsi, r14 call _ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4cendEv; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::cend(void) mov rdx, rsp mov rcx, [rdx+8] mov rdi, r15 mov rsi, r12 call _ZSt9transformIN8nlohmann16json_abi_v3_11_36detail9iter_implIKNS1_10basic_jsonINS1_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS1_14adl_serializerES6_IhSaIhEEvEEEESt15insert_iteratorIS6_IiSaIiEEEZNS2_20from_json_array_implISG_SL_TnNSt9enable_ifIXsr3std13is_assignableIRT0_SP_EE5valueEiE4typeELi0EEEDTcmcmcldtfL0p0_7reserveclsr3stdE7declvalINSP_9size_typeEEEEcldtfL0p_3getINSP_10value_typeEEEcvv_EERKT_SQ_NS2_12priority_tagILj1EEEEUlRSH_E_ESP_SW_SW_SP_T1_ mov r14, rsp mov rdi, rbx mov rsi, r14 call _ZNSt6vectorIiSaIiEE14_M_move_assignEOS1_St17integral_constantIbLb1EE; std::vector<int>::_M_move_assign(std::vector<int>&&,std::integral_constant<bool,true>) mov rdi, r14 call _ZNSt12_Vector_baseIiSaIiEED2Ev; std::_Vector_base<int>::~_Vector_base() add rsp, 58h pop rbx pop r12 pop r14 pop r15 retn mov rbx, rax mov rdi, rsp call _ZNSt12_Vector_baseIiSaIiEED2Ev; std::_Vector_base<int>::~_Vector_base() mov rdi, rbx call __Unwind_Resume
long long ZN8nlohmann16json_abi_v3_11_36detail20from_json_array_implINS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES5_IhSaIhEEvEES5_IiSaIiEETnNSt9enable_ifIXsr3std13is_assignableIRT0_SJ_EE5valueEiE4typeELi0EEEDTcmcmcldtfp0_7reserveclsr3stdE7declvalINSJ_9size_typeEEEEcldtfp_3getINSJ_10value_typeEEEcvv_EERKT_SK_NS1_12priority_tagILj1EEE( unsigned __int8 *a1, long long a2) { long long v2; // rax long long result; // rax __int128 v4; // [rsp+0h] [rbp-78h] BYREF long long v5; // [rsp+10h] [rbp-68h] _BYTE v6[32]; // [rsp+18h] [rbp-60h] BYREF _BYTE v7[64]; // [rsp+38h] [rbp-40h] BYREF v4 = 0LL; v5 = 0LL; v2 = nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::size(a1); std::vector<int>::reserve(&v4, v2); nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::cbegin( (long long)v7, (long long)a1); nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::cend( (long long)v6, (long long)a1); ZSt9transformIN8nlohmann16json_abi_v3_11_36detail9iter_implIKNS1_10basic_jsonINS1_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS1_14adl_serializerES6_IhSaIhEEvEEEESt15insert_iteratorIS6_IiSaIiEEEZNS2_20from_json_array_implISG_SL_TnNSt9enable_ifIXsr3std13is_assignableIRT0_SP_EE5valueEiE4typeELi0EEEDTcmcmcldtfL0p0_7reserveclsr3stdE7declvalINSP_9size_typeEEEEcldtfL0p_3getINSP_10value_typeEEEcvv_EERKT_SQ_NS2_12priority_tagILj1EEEEUlRSH_E_ESP_SW_SW_SP_T1_( v7, v6, &v4, *((_QWORD *)&v4 + 1)); result = std::vector<int>::_M_move_assign(a2, &v4); std::_Vector_base<int>::~_Vector_base(&v4); return result; }
_ZN8nlohmann16json_abi_v3_11_36detail20from_json_array_implINS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES5_IhSaIhEEvEES5_IiSaIiEETnNSt9enable_ifIXsr3std13is_assignableIRT0_SJ_EE5valueEiE4typeELi0EEEDTcmcmcldtfp0_7reserveclsr3stdE7declvalINSJ_9size_typeEEEEcldtfp_3getINSJ_10value_typeEEEcvv_EERKT_SK_NS1_12priority_tagILj1EEE: PUSH R15 PUSH R14 PUSH R12 PUSH RBX SUB RSP,0x58 MOV RBX,RSI MOV R14,RDI XORPS XMM0,XMM0 MOV R15,RSP MOVAPS xmmword ptr [R15],XMM0 AND qword ptr [R15 + 0x10],0x0 CALL 0x0014f050 LAB_00177fc9: MOV RDI,R15 MOV RSI,RAX CALL 0x0017805c LEA R15,[RSP + 0x38] MOV RDI,R15 MOV RSI,R14 CALL 0x0016d29e LEA R12,[RSP + 0x18] MOV RDI,R12 MOV RSI,R14 CALL 0x0016d332 MOV RDX,RSP MOV RCX,qword ptr [RDX + 0x8] MOV RDI,R15 MOV RSI,R12 CALL 0x001780f2 LAB_00178006: MOV R14,RSP MOV RDI,RBX MOV RSI,R14 CALL 0x0016b4d4 MOV RDI,R14 CALL 0x0013e8f8 ADD RSP,0x58 POP RBX POP R12 POP R14 POP R15 RET
void _ZN8nlohmann16json_abi_v3_11_36detail20from_json_array_implINS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES5_IhSaIhEEvEES5_IiSaIiEETnNSt9enable_ifIXsr3std13is_assignableIRT0_SJ_EE5valueEiE4typeELi0EEEDTcmcmcldtfp0_7reserveclsr3stdE7declvalINSJ_9size_typeEEEEcldtfp_3getINSJ_10value_typeEEEcvv_EERKT_SK_NS1_12priority_tagILj1EEE (basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> *param_1,int8 param_2) { ulong uVar1; int8 local_78; int8 uStack_70; int8 local_68; int1 local_60 [32]; int1 local_40 [32]; local_78 = 0; uStack_70 = 0; local_68 = 0; uVar1 = nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::size(param_1); /* try { // try from 00177fc9 to 00178005 has its CatchHandler @ 00178028 */ std::vector<int,std::allocator<int>>::reserve((vector<int,std::allocator<int>> *)&local_78,uVar1); nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::cbegin(); nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::cend(); _ZSt9transformIN8nlohmann16json_abi_v3_11_36detail9iter_implIKNS1_10basic_jsonINS1_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS1_14adl_serializerES6_IhSaIhEEvEEEESt15insert_iteratorIS6_IiSaIiEEEZNS2_20from_json_array_implISG_SL_TnNSt9enable_ifIXsr3std13is_assignableIRT0_SP_EE5valueEiE4typeELi0EEEDTcmcmcldtfL0p0_7reserveclsr3stdE7declvalINSP_9size_typeEEEEcldtfL0p_3getINSP_10value_typeEEEcvv_EERKT_SQ_NS2_12priority_tagILj1EEEEUlRSH_E_ESP_SW_SW_SP_T1_ (local_40,local_60,&local_78,uStack_70); std::vector<int,std::allocator<int>>::_M_move_assign(param_2,&local_78); std::_Vector_base<int,std::allocator<int>>::~_Vector_base ((_Vector_base<int,std::allocator<int>> *)&local_78); return; }
2,902
my_init_mysys_psi_keys
eloqsql/mysys/my_init.c
void my_init_mysys_psi_keys() { const char* category= "mysys"; int count; count= sizeof(all_mysys_mutexes)/sizeof(all_mysys_mutexes[0]); mysql_mutex_register(category, all_mysys_mutexes, count); count= sizeof(all_mysys_conds)/sizeof(all_mysys_conds[0]); mysql_cond_register(category, all_mysys_conds, count); count= sizeof(all_mysys_rwlocks)/sizeof(all_mysys_rwlocks[0]); mysql_rwlock_register(category, all_mysys_rwlocks, count); count= sizeof(all_mysys_threads)/sizeof(all_mysys_threads[0]); mysql_thread_register(category, all_mysys_threads, count); count= sizeof(all_mysys_files)/sizeof(all_mysys_files[0]); mysql_file_register(category, all_mysys_files, count); count= array_elements(all_mysys_stages); mysql_stage_register(category, all_mysys_stages, count); }
O3
c
my_init_mysys_psi_keys: pushq %rbp movq %rsp, %rbp pushq %r14 pushq %rbx leaq 0x2e355b(%rip), %r14 # 0x34e118 movq (%r14), %rax leaq 0x3db61(%rip), %rbx # 0xa8728 leaq 0x2e2d22(%rip), %rsi # 0x34d8f0 movq %rbx, %rdi movl $0x13, %edx callq *(%rax) movq (%r14), %rax leaq 0x2e2ede(%rip), %rsi # 0x34dac0 movq %rbx, %rdi movl $0x7, %edx callq *0x10(%rax) movq (%r14), %rax leaq 0x2e2f79(%rip), %rsi # 0x34db70 movq %rbx, %rdi movl $0x1, %edx callq *0x8(%rax) movq (%r14), %rax leaq 0x2e2f84(%rip), %rsi # 0x34db90 movq %rbx, %rdi movl $0x1, %edx callq *0x18(%rax) movq (%r14), %rax leaq 0x2e2f8f(%rip), %rsi # 0x34dbb0 movq %rbx, %rdi movl $0x2, %edx callq *0x20(%rax) movq (%r14), %rax movq 0x28(%rax), %rax leaq 0x2e2ca6(%rip), %rsi # 0x34d8e0 movq %rbx, %rdi movl $0x1, %edx popq %rbx popq %r14 popq %rbp jmpq *%rax
my_init_mysys_psi_keys: push rbp mov rbp, rsp push r14 push rbx lea r14, PSI_server mov rax, [r14] lea rbx, aMysys; "mysys" lea rsi, all_mysys_mutexes mov rdi, rbx mov edx, 13h call qword ptr [rax] mov rax, [r14] lea rsi, all_mysys_conds mov rdi, rbx mov edx, 7 call qword ptr [rax+10h] mov rax, [r14] lea rsi, all_mysys_rwlocks mov rdi, rbx mov edx, 1 call qword ptr [rax+8] mov rax, [r14] lea rsi, all_mysys_threads mov rdi, rbx mov edx, 1 call qword ptr [rax+18h] mov rax, [r14] lea rsi, all_mysys_files mov rdi, rbx mov edx, 2 call qword ptr [rax+20h] mov rax, [r14] mov rax, [rax+28h] lea rsi, all_mysys_stages mov rdi, rbx mov edx, 1 pop rbx pop r14 pop rbp jmp rax
long long my_init_mysys_psi_keys() { (*(void ( **)(const char *, _UNKNOWN **, long long))PSI_server)("mysys", &all_mysys_mutexes, 19LL); (*((void ( **)(const char *, _UNKNOWN **, long long))PSI_server + 2))("mysys", &all_mysys_conds, 7LL); (*((void ( **)(const char *, _UNKNOWN **, long long))PSI_server + 1))("mysys", &all_mysys_rwlocks, 1LL); (*((void ( **)(const char *, _UNKNOWN **, long long))PSI_server + 3))("mysys", &all_mysys_threads, 1LL); (*((void ( **)(const char *, _UNKNOWN **, long long))PSI_server + 4))("mysys", &all_mysys_files, 2LL); return (*((long long ( **)(const char *, _UNKNOWN **, long long))PSI_server + 5))( "mysys", &all_mysys_stages, 1LL); }
my_init_mysys_psi_keys: PUSH RBP MOV RBP,RSP PUSH R14 PUSH RBX LEA R14,[0x44e118] MOV RAX,qword ptr [R14] LEA RBX,[0x1a8728] LEA RSI,[0x44d8f0] MOV RDI,RBX MOV EDX,0x13 CALL qword ptr [RAX] MOV RAX,qword ptr [R14] LEA RSI,[0x44dac0] MOV RDI,RBX MOV EDX,0x7 CALL qword ptr [RAX + 0x10] MOV RAX,qword ptr [R14] LEA RSI,[0x44db70] MOV RDI,RBX MOV EDX,0x1 CALL qword ptr [RAX + 0x8] MOV RAX,qword ptr [R14] LEA RSI,[0x44db90] MOV RDI,RBX MOV EDX,0x1 CALL qword ptr [RAX + 0x18] MOV RAX,qword ptr [R14] LEA RSI,[0x44dbb0] MOV RDI,RBX MOV EDX,0x2 CALL qword ptr [RAX + 0x20] MOV RAX,qword ptr [R14] MOV RAX,qword ptr [RAX + 0x28] LEA RSI,[0x44d8e0] MOV RDI,RBX MOV EDX,0x1 POP RBX POP R14 POP RBP JMP RAX
void my_init_mysys_psi_keys(void) { (**(code **)PSI_server)(&DAT_001a8728,all_mysys_mutexes,0x13); (**(code **)(PSI_server + 0x10))(&DAT_001a8728,all_mysys_conds,7); (**(code **)(PSI_server + 8))(&DAT_001a8728,all_mysys_rwlocks,1); (**(code **)(PSI_server + 0x18))(&DAT_001a8728,all_mysys_threads,1); (**(code **)(PSI_server + 0x20))(&DAT_001a8728,all_mysys_files,2); /* WARNING: Could not recover jumptable at 0x0016ac46. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(PSI_server + 0x28))(&DAT_001a8728,&all_mysys_stages,1); return; }
2,903
inline_mysql_file_fclose
eloqsql/include/mysql/psi/mysql_file.h
static inline int inline_mysql_file_fclose( #ifdef HAVE_PSI_FILE_INTERFACE const char *src_file, uint src_line, #endif MYSQL_FILE *file, myf flags) { int result= 0; if (likely(file != NULL)) { #ifdef HAVE_PSI_FILE_INTERFACE if (psi_likely(file->m_psi)) { struct PSI_file_locker *locker; PSI_file_locker_state state; locker= PSI_FILE_CALL(get_thread_file_stream_locker)(&state, file->m_psi, PSI_FILE_STREAM_CLOSE); if (likely(locker != NULL)) { PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); result= my_fclose(file->m_file, flags); PSI_FILE_CALL(end_file_close_wait)(locker, result); my_free(file); return result; } } #endif result= my_fclose(file->m_file, flags); my_free(file); } return result; }
O0
c
inline_mysql_file_fclose: pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl $0x0, -0x2c(%rbp) cmpq $0x0, -0x20(%rbp) setne %al andb $0x1, %al movzbl %al, %eax cmpl $0x0, %eax setne %al andb $0x1, %al movzbl %al, %eax cltq cmpq $0x0, %rax je 0x37ab4 movq -0x20(%rbp), %rax cmpq $0x0, 0x8(%rax) setne %al andb $0x1, %al movzbl %al, %eax cltq cmpq $0x0, %rax je 0x37a98 leaq 0x1a24ff(%rip), %rax # 0x1d9ef8 movq (%rax), %rax movq 0x150(%rax), %rax movq -0x20(%rbp), %rcx movq 0x8(%rcx), %rsi leaq -0x80(%rbp), %rdi movl $0x5, %edx callq *%rax movq %rax, -0x38(%rbp) cmpq $0x0, -0x38(%rbp) setne %al andb $0x1, %al movzbl %al, %eax cmpl $0x0, %eax setne %al andb $0x1, %al movzbl %al, %eax cltq cmpq $0x0, %rax je 0x37a96 leaq 0x1a24b7(%rip), %rax # 0x1d9ef8 movq (%rax), %rax movq 0x220(%rax), %rax movq -0x38(%rbp), %rdi movq -0x10(%rbp), %rsi movl -0x14(%rbp), %edx callq *%rax movq -0x20(%rbp), %rax movq (%rax), %rdi movq -0x28(%rbp), %rsi callq 0x3c170 movl %eax, -0x2c(%rbp) leaq 0x1a2486(%rip), %rax # 0x1d9ef8 movq (%rax), %rax movq 0x228(%rax), %rax movq -0x38(%rbp), %rdi movl -0x2c(%rbp), %esi callq *%rax movq -0x20(%rbp), %rdi callq 0x2e3e0 movl -0x2c(%rbp), %eax movl %eax, -0x4(%rbp) jmp 0x37aba jmp 0x37a98 movq -0x20(%rbp), %rax movq (%rax), %rdi movq -0x28(%rbp), %rsi callq 0x3c170 movl %eax, -0x2c(%rbp) movq -0x20(%rbp), %rdi callq 0x2e3e0 movl -0x2c(%rbp), %eax movl %eax, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x80, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
inline_mysql_file_fclose: push rbp mov rbp, rsp sub rsp, 80h mov [rbp+var_10], rdi mov [rbp+var_14], esi mov [rbp+var_20], rdx mov [rbp+var_28], rcx mov [rbp+var_2C], 0 cmp [rbp+var_20], 0 setnz al and al, 1 movzx eax, al cmp eax, 0 setnz al and al, 1 movzx eax, al cdqe cmp rax, 0 jz loc_37AB4 mov rax, [rbp+var_20] cmp qword ptr [rax+8], 0 setnz al and al, 1 movzx eax, al cdqe cmp rax, 0 jz loc_37A98 lea rax, PSI_server mov rax, [rax] mov rax, [rax+150h] mov rcx, [rbp+var_20] mov rsi, [rcx+8] lea rdi, [rbp+var_80] mov edx, 5 call rax mov [rbp+var_38], rax cmp [rbp+var_38], 0 setnz al and al, 1 movzx eax, al cmp eax, 0 setnz al and al, 1 movzx eax, al cdqe cmp rax, 0 jz short loc_37A96 lea rax, PSI_server mov rax, [rax] mov rax, [rax+220h] mov rdi, [rbp+var_38] mov rsi, [rbp+var_10] mov edx, [rbp+var_14] call rax mov rax, [rbp+var_20] mov rdi, [rax] mov rsi, [rbp+var_28] call my_fclose mov [rbp+var_2C], eax lea rax, PSI_server mov rax, [rax] mov rax, [rax+228h] mov rdi, [rbp+var_38] mov esi, [rbp+var_2C] call rax mov rdi, [rbp+var_20] call my_free mov eax, [rbp+var_2C] mov [rbp+var_4], eax jmp short loc_37ABA loc_37A96: jmp short $+2 loc_37A98: mov rax, [rbp+var_20] mov rdi, [rax] mov rsi, [rbp+var_28] call my_fclose mov [rbp+var_2C], eax mov rdi, [rbp+var_20] call my_free loc_37AB4: mov eax, [rbp+var_2C] mov [rbp+var_4], eax loc_37ABA: mov eax, [rbp+var_4] add rsp, 80h pop rbp retn
long long inline_mysql_file_fclose(long long a1, unsigned int a2, _QWORD *a3, long long a4) { _BYTE v5[72]; // [rsp+0h] [rbp-80h] BYREF long long v6; // [rsp+48h] [rbp-38h] unsigned int v7; // [rsp+54h] [rbp-2Ch] long long v8; // [rsp+58h] [rbp-28h] _QWORD *v9; // [rsp+60h] [rbp-20h] unsigned int v10; // [rsp+6Ch] [rbp-14h] long long v11; // [rsp+70h] [rbp-10h] v11 = a1; v10 = a2; v9 = a3; v8 = a4; v7 = 0; if ( !a3 ) return v7; if ( !v9[1] || (v6 = (*((long long ( **)(_BYTE *, _QWORD, long long))PSI_server[0] + 42))(v5, v9[1], 5LL)) == 0 ) { v7 = my_fclose(*v9, v8); my_free((long long)v9); return v7; } (*((void ( **)(long long, long long, _QWORD))PSI_server[0] + 68))(v6, v11, v10); v7 = my_fclose(*v9, v8); (*((void ( **)(long long, _QWORD))PSI_server[0] + 69))(v6, v7); my_free((long long)v9); return v7; }
inline_mysql_file_fclose: PUSH RBP MOV RBP,RSP SUB RSP,0x80 MOV qword ptr [RBP + -0x10],RDI MOV dword ptr [RBP + -0x14],ESI MOV qword ptr [RBP + -0x20],RDX MOV qword ptr [RBP + -0x28],RCX MOV dword ptr [RBP + -0x2c],0x0 CMP qword ptr [RBP + -0x20],0x0 SETNZ AL AND AL,0x1 MOVZX EAX,AL CMP EAX,0x0 SETNZ AL AND AL,0x1 MOVZX EAX,AL CDQE CMP RAX,0x0 JZ 0x00137ab4 MOV RAX,qword ptr [RBP + -0x20] CMP qword ptr [RAX + 0x8],0x0 SETNZ AL AND AL,0x1 MOVZX EAX,AL CDQE CMP RAX,0x0 JZ 0x00137a98 LEA RAX,[0x2d9ef8] MOV RAX,qword ptr [RAX] MOV RAX,qword ptr [RAX + 0x150] MOV RCX,qword ptr [RBP + -0x20] MOV RSI,qword ptr [RCX + 0x8] LEA RDI,[RBP + -0x80] MOV EDX,0x5 CALL RAX MOV qword ptr [RBP + -0x38],RAX CMP qword ptr [RBP + -0x38],0x0 SETNZ AL AND AL,0x1 MOVZX EAX,AL CMP EAX,0x0 SETNZ AL AND AL,0x1 MOVZX EAX,AL CDQE CMP RAX,0x0 JZ 0x00137a96 LEA RAX,[0x2d9ef8] MOV RAX,qword ptr [RAX] MOV RAX,qword ptr [RAX + 0x220] MOV RDI,qword ptr [RBP + -0x38] MOV RSI,qword ptr [RBP + -0x10] MOV EDX,dword ptr [RBP + -0x14] CALL RAX MOV RAX,qword ptr [RBP + -0x20] MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RBP + -0x28] CALL 0x0013c170 MOV dword ptr [RBP + -0x2c],EAX LEA RAX,[0x2d9ef8] MOV RAX,qword ptr [RAX] MOV RAX,qword ptr [RAX + 0x228] MOV RDI,qword ptr [RBP + -0x38] MOV ESI,dword ptr [RBP + -0x2c] CALL RAX MOV RDI,qword ptr [RBP + -0x20] CALL 0x0012e3e0 MOV EAX,dword ptr [RBP + -0x2c] MOV dword ptr [RBP + -0x4],EAX JMP 0x00137aba LAB_00137a96: JMP 0x00137a98 LAB_00137a98: MOV RAX,qword ptr [RBP + -0x20] MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RBP + -0x28] CALL 0x0013c170 MOV dword ptr [RBP + -0x2c],EAX MOV RDI,qword ptr [RBP + -0x20] CALL 0x0012e3e0 LAB_00137ab4: MOV EAX,dword ptr [RBP + -0x2c] MOV dword ptr [RBP + -0x4],EAX LAB_00137aba: MOV EAX,dword ptr [RBP + -0x4] ADD RSP,0x80 POP RBP RET
int4 inline_mysql_file_fclose (int8 param_1,int4 param_2,int8 *param_3,int8 param_4) { int1 local_88 [72]; long local_40; int4 local_34; int8 local_30; int8 *local_28; int4 local_1c; int8 local_18; local_34 = 0; if (param_3 != (int8 *)0x0) { local_30 = param_4; local_28 = param_3; local_1c = param_2; local_18 = param_1; if (param_3[1] != 0) { local_40 = (**(code **)(PSI_server + 0x150))(local_88,param_3[1],5); if (local_40 != 0) { (**(code **)(PSI_server + 0x220))(local_40,local_18,local_1c); local_34 = my_fclose(*local_28,local_30); (**(code **)(PSI_server + 0x228))(local_40,local_34); my_free(local_28); return local_34; } local_40 = 0; } local_34 = my_fclose(*local_28,local_30); my_free(local_28); } return local_34; }
2,904
testing::internal::GetRandomSeedFromFlag(int)
AlayaLite/build_O0/_deps/googletest-src/googletest/src/gtest-internal-inl.h
inline int GetRandomSeedFromFlag(int32_t random_seed_flag) { const unsigned int raw_seed = (random_seed_flag == 0) ? static_cast<unsigned int>(GetTimeInMillis()) : static_cast<unsigned int>(random_seed_flag); // Normalizes the actual seed to range [1, kMaxRandomSeed] such that // it's easy to type. const int normalized_seed = static_cast<int>((raw_seed - 1U) % static_cast<unsigned int>(kMaxRandomSeed)) + 1; return normalized_seed; }
O0
c
testing::internal::GetRandomSeedFromFlag(int): subq $0x18, %rsp movl %edi, 0x14(%rsp) cmpl $0x0, 0x14(%rsp) jne 0x4e70a callq 0x22d90 movl %eax, 0x8(%rsp) jmp 0x4e712 movl 0x14(%rsp), %eax movl %eax, 0x8(%rsp) movl 0x8(%rsp), %eax movl %eax, 0x10(%rsp) movl 0x10(%rsp), %eax subl $0x1, %eax movl $0x1869f, %ecx # imm = 0x1869F xorl %edx, %edx divl %ecx addl $0x1, %edx movl %edx, 0xc(%rsp) movl 0xc(%rsp), %eax addq $0x18, %rsp retq nopw (%rax,%rax)
_ZN7testing8internal21GetRandomSeedFromFlagEi: sub rsp, 18h mov [rsp+18h+var_4], edi cmp [rsp+18h+var_4], 0 jnz short loc_4E70A call _ZN7testing8internal15GetTimeInMillisEv; testing::internal::GetTimeInMillis(void) mov [rsp+18h+var_10], eax jmp short loc_4E712 loc_4E70A: mov eax, [rsp+18h+var_4] mov [rsp+18h+var_10], eax loc_4E712: mov eax, [rsp+18h+var_10] mov [rsp+18h+var_8], eax mov eax, [rsp+18h+var_8] sub eax, 1 mov ecx, 1869Fh xor edx, edx div ecx add edx, 1 mov [rsp+18h+var_C], edx mov eax, [rsp+18h+var_C] add rsp, 18h retn
long long testing::internal::GetRandomSeedFromFlag(testing::internal *this, long long a2) { int TimeInMillis; // [rsp+8h] [rbp-10h] if ( (_DWORD)this ) TimeInMillis = (int)this; else TimeInMillis = testing::internal::GetTimeInMillis(this, a2); return (TimeInMillis - 1) % 0x1869Fu + 1; }
GetRandomSeedFromFlag: SUB RSP,0x18 MOV dword ptr [RSP + 0x14],EDI CMP dword ptr [RSP + 0x14],0x0 JNZ 0x0014e70a CALL 0x00122d90 MOV dword ptr [RSP + 0x8],EAX JMP 0x0014e712 LAB_0014e70a: MOV EAX,dword ptr [RSP + 0x14] MOV dword ptr [RSP + 0x8],EAX LAB_0014e712: MOV EAX,dword ptr [RSP + 0x8] MOV dword ptr [RSP + 0x10],EAX MOV EAX,dword ptr [RSP + 0x10] SUB EAX,0x1 MOV ECX,0x1869f XOR EDX,EDX DIV ECX ADD EDX,0x1 MOV dword ptr [RSP + 0xc],EDX MOV EAX,dword ptr [RSP + 0xc] ADD RSP,0x18 RET
/* testing::internal::GetRandomSeedFromFlag(int) */ int testing::internal::GetRandomSeedFromFlag(int param_1) { int local_10; local_10 = param_1; if (param_1 == 0) { local_10 = GetTimeInMillis(); } return (local_10 - 1U) % 99999 + 1; }
2,905
testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter()
seiftnesse[P]memoryallocator/build_O1/_deps/googletest-src/googletest/src/gtest.cc
ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() { internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); if (intercept_mode_ == INTERCEPT_ALL_THREADS) { impl->SetGlobalTestPartResultReporter(old_reporter_); } else { impl->SetTestPartResultReporterForCurrentThread(old_reporter_); } }
O1
cpp
testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter(): pushq %rbx movq %rdi, %rbx leaq 0x38d4b(%rip), %rax # 0x58e10 movq %rax, (%rdi) callq 0x1d29e movq 0x413de8c(%rip), %rdi # 0x415df60 cmpl $0x1, 0x8(%rbx) movq 0x10(%rbx), %rbx jne 0x200e8 movq %rbx, %rsi callq 0x20088 jmp 0x200f7 addq $0x90, %rdi callq 0x3da10 movq %rbx, (%rax) popq %rbx retq movq %rax, %rdi callq 0xf6fa nop
_ZN7testing32ScopedFakeTestPartResultReporterD2Ev: push rbx; Alternative name is 'testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter()' mov rbx, rdi lea rax, off_58E10 mov [rdi], rax call _ZN7testing8UnitTest11GetInstanceEv; testing::UnitTest::GetInstance(void) mov rdi, cs:qword_415DF60; this cmp dword ptr [rbx+8], 1 mov rbx, [rbx+10h] jnz short loc_200E8 mov rsi, rbx; testing::TestPartResultReporterInterface * call _ZN7testing8internal12UnitTestImpl31SetGlobalTestPartResultReporterEPNS_31TestPartResultReporterInterfaceE; testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(testing::TestPartResultReporterInterface *) jmp short loc_200F7 loc_200E8: add rdi, 90h call _ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv; testing::internal::ThreadLocal<testing::TestPartResultReporterInterface *>::GetOrCreateValue(void) mov [rax], rbx loc_200F7: pop rbx retn mov rdi, rax call __clang_call_terminate
void testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter( testing::TestPartResultReporterInterface **this, int a2) { int v2; // edx int v3; // ecx int v4; // r8d int v5; // r9d testing::TestPartResultReporterInterface *v6; // rbx *this = (testing::TestPartResultReporterInterface *)off_58E10; testing::UnitTest::GetInstance((testing::UnitTest *)this); v6 = this[2]; if ( *((_DWORD *)this + 2) == 1 ) testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(qword_415DF60, v6); else *(_QWORD *)testing::internal::ThreadLocal<testing::TestPartResultReporterInterface *>::GetOrCreateValue( (int)qword_415DF60 + 144, a2, v2, v3, v4, v5) = v6; }
~ScopedFakeTestPartResultReporter: PUSH RBX MOV RBX,RDI LEA RAX,[0x158e10] MOV qword ptr [RDI],RAX LAB_001200c8: CALL 0x0011d29e MOV RDI,qword ptr [0x0425df60] CMP dword ptr [RBX + 0x8],0x1 MOV RBX,qword ptr [RBX + 0x10] JNZ 0x001200e8 MOV RSI,RBX CALL 0x00120088 JMP 0x001200f7 LAB_001200e8: ADD RDI,0x90 CALL 0x0013da10 MOV qword ptr [RAX],RBX LAB_001200f7: POP RBX RET
/* testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() */ void __thiscall testing::ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter (ScopedFakeTestPartResultReporter *this) { TestPartResultReporterInterface *pTVar1; int8 *puVar2; *(int ***)this = &PTR__ScopedFakeTestPartResultReporter_00158e10; /* try { // try from 001200c8 to 001200f3 has its CatchHandler @ 001200f9 */ UnitTest::GetInstance(); pTVar1 = *(TestPartResultReporterInterface **)(this + 0x10); if (*(int *)(this + 8) == 1) { internal::UnitTestImpl::SetGlobalTestPartResultReporter ((UnitTestImpl *)UnitTest::GetInstance()::instance._64_8_,pTVar1); } else { puVar2 = (int8 *) internal::ThreadLocal<testing::TestPartResultReporterInterface*>::GetOrCreateValue ((ThreadLocal<testing::TestPartResultReporterInterface*> *) (UnitTest::GetInstance()::instance._64_8_ + 0x90)); *puVar2 = pTVar1; } return; }
2,906
allocate_dynamic
eloqsql/mysys/array.c
my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements) { DBUG_ENTER("allocate_dynamic"); if (max_elements >= array->max_element) { uint size; uchar *new_ptr; size= (max_elements + array->alloc_increment)/array->alloc_increment; size*= array->alloc_increment; if (array->malloc_flags & MY_INIT_BUFFER_USED) { /* In this senerio, the buffer is statically preallocated, so we have to create an all-new malloc since we overflowed */ if (!(new_ptr= (uchar *) my_malloc(array->m_psi_key, size * array->size_of_element, MYF(array->malloc_flags | MY_WME)))) DBUG_RETURN(0); memcpy(new_ptr, array->buffer, array->elements * array->size_of_element); array->malloc_flags&= ~MY_INIT_BUFFER_USED; } else if (!(new_ptr= (uchar*) my_realloc(array->m_psi_key, array->buffer,size * array->size_of_element, MYF(MY_WME | MY_ALLOW_ZERO_PTR | array->malloc_flags)))) DBUG_RETURN(TRUE); array->buffer= new_ptr; array->max_element= size; } DBUG_RETURN(FALSE); }
O0
c
allocate_dynamic: pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movl -0x14(%rbp), %eax movq -0x10(%rbp), %rcx cmpl 0xc(%rcx), %eax jb 0xdcae5 movl -0x14(%rbp), %eax movq -0x10(%rbp), %rcx addl 0x10(%rcx), %eax movq -0x10(%rbp), %rcx xorl %edx, %edx divl 0x10(%rcx) movl %eax, -0x18(%rbp) movq -0x10(%rbp), %rax movl 0x10(%rax), %eax imull -0x18(%rbp), %eax movl %eax, -0x18(%rbp) movq -0x10(%rbp), %rax movq 0x20(%rax), %rax andq $0x100, %rax # imm = 0x100 cmpq $0x0, %rax je 0xdca8e movq -0x10(%rbp), %rax movl 0x18(%rax), %edi movl -0x18(%rbp), %eax movq -0x10(%rbp), %rcx imull 0x14(%rcx), %eax movl %eax, %eax movl %eax, %esi movq -0x10(%rbp), %rax movq 0x20(%rax), %rdx orq $0x10, %rdx callq 0xfc020 movq %rax, -0x20(%rbp) cmpq $0x0, %rax jne 0xdca53 jmp 0xdca4a movb $0x0, -0x1(%rbp) jmp 0xdcaeb movq -0x20(%rbp), %rdi movq -0x10(%rbp), %rax movq (%rax), %rsi movq -0x10(%rbp), %rax movl 0x8(%rax), %eax movq -0x10(%rbp), %rcx imull 0x14(%rcx), %eax movl %eax, %eax movl %eax, %edx callq 0x2a0b0 movq -0x10(%rbp), %rax movabsq $0xfffffeff, %rcx # imm = 0xFFFFFEFF andq 0x20(%rax), %rcx movq %rcx, 0x20(%rax) jmp 0xdcad0 movq -0x10(%rbp), %rax movl 0x18(%rax), %edi movq -0x10(%rbp), %rax movq (%rax), %rsi movl -0x18(%rbp), %eax movq -0x10(%rbp), %rcx imull 0x14(%rcx), %eax movl %eax, %eax movl %eax, %edx movq -0x10(%rbp), %rax movq 0x20(%rax), %rcx orq $0x50, %rcx callq 0xfc1f0 movq %rax, -0x20(%rbp) cmpq $0x0, %rax jne 0xdcace jmp 0xdcac8 movb $0x1, -0x1(%rbp) jmp 0xdcaeb jmp 0xdcad0 movq -0x20(%rbp), %rcx movq -0x10(%rbp), %rax movq %rcx, (%rax) movl -0x18(%rbp), %ecx movq -0x10(%rbp), %rax movl %ecx, 0xc(%rax) jmp 0xdcae7 movb $0x0, -0x1(%rbp) movb -0x1(%rbp), %al addq $0x20, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
allocate_dynamic: push rbp mov rbp, rsp sub rsp, 20h mov [rbp+var_10], rdi mov [rbp+var_14], esi mov eax, [rbp+var_14] mov rcx, [rbp+var_10] cmp eax, [rcx+0Ch] jb loc_DCAE5 mov eax, [rbp+var_14] mov rcx, [rbp+var_10] add eax, [rcx+10h] mov rcx, [rbp+var_10] xor edx, edx div dword ptr [rcx+10h] mov [rbp+var_18], eax mov rax, [rbp+var_10] mov eax, [rax+10h] imul eax, [rbp+var_18] mov [rbp+var_18], eax mov rax, [rbp+var_10] mov rax, [rax+20h] and rax, 100h cmp rax, 0 jz short loc_DCA8E mov rax, [rbp+var_10] mov edi, [rax+18h] mov eax, [rbp+var_18] mov rcx, [rbp+var_10] imul eax, [rcx+14h] mov eax, eax mov esi, eax mov rax, [rbp+var_10] mov rdx, [rax+20h] or rdx, 10h call my_malloc mov [rbp+var_20], rax cmp rax, 0 jnz short loc_DCA53 jmp short $+2 loc_DCA4A: mov [rbp+var_1], 0 jmp loc_DCAEB loc_DCA53: mov rdi, [rbp+var_20] mov rax, [rbp+var_10] mov rsi, [rax] mov rax, [rbp+var_10] mov eax, [rax+8] mov rcx, [rbp+var_10] imul eax, [rcx+14h] mov eax, eax mov edx, eax call _memcpy mov rax, [rbp+var_10] mov rcx, 0FFFFFEFFh and rcx, [rax+20h] mov [rax+20h], rcx jmp short loc_DCAD0 loc_DCA8E: mov rax, [rbp+var_10] mov edi, [rax+18h] mov rax, [rbp+var_10] mov rsi, [rax] mov eax, [rbp+var_18] mov rcx, [rbp+var_10] imul eax, [rcx+14h] mov eax, eax mov edx, eax mov rax, [rbp+var_10] mov rcx, [rax+20h] or rcx, 50h call my_realloc mov [rbp+var_20], rax cmp rax, 0 jnz short loc_DCACE jmp short $+2 loc_DCAC8: mov [rbp+var_1], 1 jmp short loc_DCAEB loc_DCACE: jmp short $+2 loc_DCAD0: mov rcx, [rbp+var_20] mov rax, [rbp+var_10] mov [rax], rcx mov ecx, [rbp+var_18] mov rax, [rbp+var_10] mov [rax+0Ch], ecx loc_DCAE5: jmp short $+2 loc_DCAE7: mov [rbp+var_1], 0 loc_DCAEB: mov al, [rbp+var_1] add rsp, 20h pop rbp retn
char allocate_dynamic(long long a1, unsigned int a2) { long long v3; // [rsp+0h] [rbp-20h] unsigned int v4; // [rsp+8h] [rbp-18h] if ( a2 < *(_DWORD *)(a1 + 12) ) return 0; v4 = (*(_DWORD *)(a1 + 16) + a2) / *(_DWORD *)(a1 + 16) * *(_DWORD *)(a1 + 16); if ( (*(_QWORD *)(a1 + 32) & 0x100LL) == 0 ) { v3 = my_realloc(*(unsigned int *)(a1 + 24), *(_QWORD *)a1, *(_DWORD *)(a1 + 20) * v4, *(_QWORD *)(a1 + 32) | 0x50LL); if ( !v3 ) return 1; goto LABEL_8; } v3 = my_malloc(*(unsigned int *)(a1 + 24), *(_DWORD *)(a1 + 20) * v4, *(_QWORD *)(a1 + 32) | 0x10LL); if ( v3 ) { memcpy(v3, *(_QWORD *)a1, (unsigned int)(*(_DWORD *)(a1 + 20) * *(_DWORD *)(a1 + 8))); *(_QWORD *)(a1 + 32) &= 0xFFFFFEFFuLL; LABEL_8: *(_QWORD *)a1 = v3; *(_DWORD *)(a1 + 12) = v4; return 0; } return 0; }
allocate_dynamic: PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + -0x10],RDI MOV dword ptr [RBP + -0x14],ESI MOV EAX,dword ptr [RBP + -0x14] MOV RCX,qword ptr [RBP + -0x10] CMP EAX,dword ptr [RCX + 0xc] JC 0x001dcae5 MOV EAX,dword ptr [RBP + -0x14] MOV RCX,qword ptr [RBP + -0x10] ADD EAX,dword ptr [RCX + 0x10] MOV RCX,qword ptr [RBP + -0x10] XOR EDX,EDX DIV dword ptr [RCX + 0x10] MOV dword ptr [RBP + -0x18],EAX MOV RAX,qword ptr [RBP + -0x10] MOV EAX,dword ptr [RAX + 0x10] IMUL EAX,dword ptr [RBP + -0x18] MOV dword ptr [RBP + -0x18],EAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX + 0x20] AND RAX,0x100 CMP RAX,0x0 JZ 0x001dca8e MOV RAX,qword ptr [RBP + -0x10] MOV EDI,dword ptr [RAX + 0x18] MOV EAX,dword ptr [RBP + -0x18] MOV RCX,qword ptr [RBP + -0x10] IMUL EAX,dword ptr [RCX + 0x14] MOV EAX,EAX MOV ESI,EAX MOV RAX,qword ptr [RBP + -0x10] MOV RDX,qword ptr [RAX + 0x20] OR RDX,0x10 CALL 0x001fc020 MOV qword ptr [RBP + -0x20],RAX CMP RAX,0x0 JNZ 0x001dca53 JMP 0x001dca4a LAB_001dca4a: MOV byte ptr [RBP + -0x1],0x0 JMP 0x001dcaeb LAB_001dca53: MOV RDI,qword ptr [RBP + -0x20] MOV RAX,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RAX] MOV RAX,qword ptr [RBP + -0x10] MOV EAX,dword ptr [RAX + 0x8] MOV RCX,qword ptr [RBP + -0x10] IMUL EAX,dword ptr [RCX + 0x14] MOV EAX,EAX MOV EDX,EAX CALL 0x0012a0b0 MOV RAX,qword ptr [RBP + -0x10] MOV RCX,0xfffffeff AND RCX,qword ptr [RAX + 0x20] MOV qword ptr [RAX + 0x20],RCX JMP 0x001dcad0 LAB_001dca8e: MOV RAX,qword ptr [RBP + -0x10] MOV EDI,dword ptr [RAX + 0x18] MOV RAX,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RAX] MOV EAX,dword ptr [RBP + -0x18] MOV RCX,qword ptr [RBP + -0x10] IMUL EAX,dword ptr [RCX + 0x14] MOV EAX,EAX MOV EDX,EAX MOV RAX,qword ptr [RBP + -0x10] MOV RCX,qword ptr [RAX + 0x20] OR RCX,0x50 CALL 0x001fc1f0 MOV qword ptr [RBP + -0x20],RAX CMP RAX,0x0 JNZ 0x001dcace JMP 0x001dcac8 LAB_001dcac8: MOV byte ptr [RBP + -0x1],0x1 JMP 0x001dcaeb LAB_001dcace: JMP 0x001dcad0 LAB_001dcad0: MOV RCX,qword ptr [RBP + -0x20] MOV RAX,qword ptr [RBP + -0x10] MOV qword ptr [RAX],RCX MOV ECX,dword ptr [RBP + -0x18] MOV RAX,qword ptr [RBP + -0x10] MOV dword ptr [RAX + 0xc],ECX LAB_001dcae5: JMP 0x001dcae7 LAB_001dcae7: MOV byte ptr [RBP + -0x1],0x0 LAB_001dcaeb: MOV AL,byte ptr [RBP + -0x1] ADD RSP,0x20 POP RBP RET
int1 allocate_dynamic(int8 *param_1,uint param_2) { int iVar1; void *local_28; if (*(uint *)((long)param_1 + 0xc) <= param_2) { iVar1 = *(int *)(param_1 + 2) * ((param_2 + *(int *)(param_1 + 2)) / *(uint *)(param_1 + 2)); if ((param_1[4] & 0x100) == 0) { local_28 = (void *)my_realloc(*(int4 *)(param_1 + 3),*param_1, iVar1 * *(int *)((long)param_1 + 0x14),param_1[4] | 0x50); if (local_28 == (void *)0x0) { return 1; } } else { local_28 = (void *)my_malloc(*(int4 *)(param_1 + 3), iVar1 * *(int *)((long)param_1 + 0x14),param_1[4] | 0x10); if (local_28 == (void *)0x0) { return 0; } memcpy(local_28,(void *)*param_1, (ulong)(uint)(*(int *)(param_1 + 1) * *(int *)((long)param_1 + 0x14))); param_1[4] = param_1[4] & 0xfffffeff; } *param_1 = local_28; *(int *)((long)param_1 + 0xc) = iVar1; } return 0; }
2,907
ftxui::CellToGlyphIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Andrewchistyakov[P]flashcards_lyc/build_O1/_deps/ftxui-src/src/ftxui/screen/string.cpp
std::vector<int> CellToGlyphIndex(const std::string& input) { int x = -1; std::vector<int> out; out.reserve(input.size()); size_t start = 0; size_t end = 0; while (start < input.size()) { uint32_t codepoint = 0; const bool eaten = EatCodePoint(input, start, &end, &codepoint); start = end; // Ignore invalid / control characters. if (!eaten || IsControl(codepoint)) { continue; } // Combining characters are put with the previous glyph they are modifying. if (IsCombining(codepoint)) { if (x == -1) { ++x; out.push_back(x); } continue; } // Fullwidth characters take two cells. The second is made of the empty // string to reserve the space the first is taking. if (IsFullWidth(codepoint)) { ++x; out.push_back(x); out.push_back(x); continue; } // Normal characters: ++x; out.push_back(x); } return out; }
O1
cpp
ftxui::CellToGlyphIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r14 movq %rdi, %rbx movl $0xffffffff, (%rsp) # imm = 0xFFFFFFFF xorps %xmm0, %xmm0 movups %xmm0, (%rdi) movq $0x0, 0x10(%rdi) movq 0x8(%rsi), %rsi callq 0x3c0ee movq $0x0, 0x10(%rsp) cmpq $0x0, 0x8(%r14) je 0x3bbff leaq 0x8(%rbx), %rax movq %rax, 0x8(%rsp) xorl %ebp, %ebp leaq 0x10(%rsp), %r15 leaq 0x4(%rsp), %r12 movl $0x0, 0x4(%rsp) movq %r14, %rdi movq %rbp, %rsi movq %r15, %rdx movq %r12, %rcx callq 0x3b334 movq 0x10(%rsp), %rbp testb %al, %al je 0x3bbf5 movl 0x4(%rsp), %r13d testl %r13d, %r13d je 0x3bbf5 xorl %eax, %eax cmpl $0xa, %r13d setne %al leal -0x7f(%r13), %ecx xorl %edx, %edx cmpl $0x21, %ecx setb %dl cmpl $0x20, %r13d cmovbl %eax, %edx testb %dl, %dl jne 0x3bbf5 movl %r13d, %edi callq 0x3b450 testb %al, %al je 0x3bb86 cmpl $-0x1, (%rsp) jne 0x3bbf5 movl $0x0, (%rsp) movq 0x8(%rbx), %rsi cmpq 0x10(%rbx), %rsi je 0x3bbea movl $0x0, (%rsi) jmp 0x3bbdc movl %r13d, %edi callq 0x3b4b2 movl (%rsp), %ecx incl %ecx movl %ecx, (%rsp) testb %al, %al je 0x3bbb4 movq 0x8(%rbx), %rsi cmpq 0x10(%rbx), %rsi je 0x3bbc2 movl %ecx, (%rsi) addq $0x4, %rsi movq 0x8(%rsp), %rax movq %rsi, (%rax) jmp 0x3bbcd movq 0x8(%rbx), %rsi cmpq 0x10(%rbx), %rsi je 0x3bbea movl %ecx, (%rsi) jmp 0x3bbdc movq %rbx, %rdi movq %rsp, %rdx callq 0x1fd90 movq 0x8(%rbx), %rsi cmpq 0x10(%rbx), %rsi je 0x3bbea movl (%rsp), %eax movl %eax, (%rsi) addq $0x4, %rsi movq 0x8(%rsp), %rax movq %rsi, (%rax) jmp 0x3bbf5 movq %rbx, %rdi movq %rsp, %rdx callq 0x1fd90 cmpq 0x8(%r14), %rbp jb 0x3baff movq %rbx, %rax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x3bc13 movq %rax, %r14 movq (%rbx), %rdi testq %rdi, %rdi je 0x3bc2a movq 0x10(%rbx), %rsi subq %rdi, %rsi callq 0xb400 movq %r14, %rdi callq 0xb780
_ZN5ftxui16CellToGlyphIndexERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 18h mov r14, rsi mov rbx, rdi mov [rsp+48h+var_48], 0FFFFFFFFh xorps xmm0, xmm0 movups xmmword ptr [rdi], xmm0 mov qword ptr [rdi+10h], 0 mov rsi, [rsi+8] call _ZNSt6vectorIiSaIiEE7reserveEm; std::vector<int>::reserve(ulong) mov [rsp+48h+var_38], 0 cmp qword ptr [r14+8], 0 jz loc_3BBFF lea rax, [rbx+8] mov [rsp+48h+var_44+4], rax xor ebp, ebp lea r15, [rsp+48h+var_38] lea r12, [rsp+48h+var_44] loc_3BAFF: mov dword ptr [rsp+48h+var_44], 0 mov rdi, r14 mov rsi, rbp; unsigned int mov rdx, r15 mov rcx, r12 call _ZN5ftxui12EatCodePointERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmPmPj; ftxui::EatCodePoint(std::string const&,ulong,ulong *,uint *) mov rbp, [rsp+48h+var_38] test al, al jz loc_3BBF5 mov r13d, dword ptr [rsp+48h+var_44] test r13d, r13d jz loc_3BBF5 xor eax, eax cmp r13d, 0Ah setnz al lea ecx, [r13-7Fh] xor edx, edx cmp ecx, 21h ; '!' setb dl cmp r13d, 20h ; ' ' cmovb edx, eax test dl, dl jnz loc_3BBF5 mov edi, r13d; this call _ZN5ftxui11IsCombiningEj; ftxui::IsCombining(uint) test al, al jz short loc_3BB86 cmp [rsp+48h+var_48], 0FFFFFFFFh jnz loc_3BBF5 mov [rsp+48h+var_48], 0 mov rsi, [rbx+8] cmp rsi, [rbx+10h] jz short loc_3BBEA mov dword ptr [rsi], 0 jmp short loc_3BBDC loc_3BB86: mov edi, r13d; this call _ZN5ftxui11IsFullWidthEj; ftxui::IsFullWidth(uint) mov ecx, [rsp+48h+var_48] inc ecx mov [rsp+48h+var_48], ecx test al, al jz short loc_3BBB4 mov rsi, [rbx+8] cmp rsi, [rbx+10h] jz short loc_3BBC2 mov [rsi], ecx add rsi, 4 mov rax, [rsp+48h+var_44+4] mov [rax], rsi jmp short loc_3BBCD loc_3BBB4: mov rsi, [rbx+8] cmp rsi, [rbx+10h] jz short loc_3BBEA mov [rsi], ecx jmp short loc_3BBDC loc_3BBC2: mov rdi, rbx mov rdx, rsp call _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_; std::vector<int>::_M_realloc_insert<int const&>(__gnu_cxx::__normal_iterator<int *,std::vector<int>>,int const&) loc_3BBCD: mov rsi, [rbx+8] cmp rsi, [rbx+10h] jz short loc_3BBEA mov eax, [rsp+48h+var_48] mov [rsi], eax loc_3BBDC: add rsi, 4 mov rax, [rsp+48h+var_44+4] mov [rax], rsi jmp short loc_3BBF5 loc_3BBEA: mov rdi, rbx mov rdx, rsp call _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_; std::vector<int>::_M_realloc_insert<int const&>(__gnu_cxx::__normal_iterator<int *,std::vector<int>>,int const&) loc_3BBF5: cmp rbp, [r14+8] jb loc_3BAFF loc_3BBFF: mov rax, rbx add rsp, 18h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn jmp short $+2 loc_3BC13: mov r14, rax mov rdi, [rbx]; void * test rdi, rdi jz short loc_3BC2A mov rsi, [rbx+10h] sub rsi, rdi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_3BC2A: mov rdi, r14 call __Unwind_Resume
long long ftxui::CellToGlyphIndex(long long a1, long long *a2) { unsigned long long v3; // rbp char v4; // al unsigned int v5; // r13d bool v6; // dl int *v7; // rsi bool IsFullWidth; // al int v9; // ecx int *v10; // rsi int v12; // [rsp+0h] [rbp-48h] BYREF int v13[3]; // [rsp+4h] [rbp-44h] BYREF unsigned long long v14[7]; // [rsp+10h] [rbp-38h] BYREF v12 = -1; *(_OWORD *)a1 = 0LL; *(_QWORD *)(a1 + 16) = 0LL; std::vector<int>::reserve(a1, a2[1]); v14[0] = 0LL; if ( a2[1] ) { *(_QWORD *)&v13[1] = a1 + 8; v3 = 0LL; while ( 1 ) { v13[0] = 0; v4 = ftxui::EatCodePoint(a2, v3, v14, v13); v3 = v14[0]; if ( !v4 ) goto LABEL_22; v5 = v13[0]; if ( !v13[0] ) goto LABEL_22; v6 = (unsigned int)(v13[0] - 127) < 0x21; if ( v13[0] < 0x20u ) v6 = v13[0] != 10; if ( v6 ) goto LABEL_22; if ( !ftxui::IsCombining((ftxui *)(unsigned int)v13[0]) ) break; if ( v12 == -1 ) { v12 = 0; v7 = *(int **)(a1 + 8); if ( v7 == *(int **)(a1 + 16) ) goto LABEL_21; *v7 = 0; LABEL_20: **(_QWORD **)&v13[1] = v7 + 1; } LABEL_22: if ( v3 >= a2[1] ) return a1; } IsFullWidth = ftxui::IsFullWidth((ftxui *)v5); v9 = ++v12; if ( IsFullWidth ) { v10 = *(int **)(a1 + 8); if ( v10 == *(int **)(a1 + 16) ) { std::vector<int>::_M_realloc_insert<int const&>(a1, (long long)v10, &v12); } else { *v10 = v9; **(_QWORD **)&v13[1] = v10 + 1; } v7 = *(int **)(a1 + 8); if ( v7 == *(int **)(a1 + 16) ) { LABEL_21: std::vector<int>::_M_realloc_insert<int const&>(a1, (long long)v7, &v12); goto LABEL_22; } *v7 = v12; } else { v7 = *(int **)(a1 + 8); if ( v7 == *(int **)(a1 + 16) ) goto LABEL_21; *v7 = v9; } goto LABEL_20; } return a1; }
CellToGlyphIndex: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x18 MOV R14,RSI MOV RBX,RDI MOV dword ptr [RSP],0xffffffff XORPS XMM0,XMM0 MOVUPS xmmword ptr [RDI],XMM0 MOV qword ptr [RDI + 0x10],0x0 MOV RSI,qword ptr [RSI + 0x8] LAB_0013bad1: CALL 0x0013c0ee MOV qword ptr [RSP + 0x10],0x0 CMP qword ptr [R14 + 0x8],0x0 JZ 0x0013bbff LEA RAX,[RBX + 0x8] MOV qword ptr [RSP + 0x8],RAX XOR EBP,EBP LEA R15,[RSP + 0x10] LEA R12,[RSP + 0x4] LAB_0013baff: MOV dword ptr [RSP + 0x4],0x0 MOV RDI,R14 MOV RSI,RBP MOV RDX,R15 MOV RCX,R12 CALL 0x0013b334 MOV RBP,qword ptr [RSP + 0x10] TEST AL,AL JZ 0x0013bbf5 MOV R13D,dword ptr [RSP + 0x4] TEST R13D,R13D JZ 0x0013bbf5 XOR EAX,EAX CMP R13D,0xa SETNZ AL LEA ECX,[R13 + -0x7f] XOR EDX,EDX CMP ECX,0x21 SETC DL CMP R13D,0x20 CMOVC EDX,EAX TEST DL,DL JNZ 0x0013bbf5 MOV EDI,R13D CALL 0x0013b450 TEST AL,AL JZ 0x0013bb86 CMP dword ptr [RSP],-0x1 JNZ 0x0013bbf5 MOV dword ptr [RSP],0x0 MOV RSI,qword ptr [RBX + 0x8] CMP RSI,qword ptr [RBX + 0x10] JZ 0x0013bbea MOV dword ptr [RSI],0x0 JMP 0x0013bbdc LAB_0013bb86: MOV EDI,R13D CALL 0x0013b4b2 MOV ECX,dword ptr [RSP] INC ECX MOV dword ptr [RSP],ECX TEST AL,AL JZ 0x0013bbb4 MOV RSI,qword ptr [RBX + 0x8] CMP RSI,qword ptr [RBX + 0x10] JZ 0x0013bbc2 MOV dword ptr [RSI],ECX ADD RSI,0x4 MOV RAX,qword ptr [RSP + 0x8] MOV qword ptr [RAX],RSI JMP 0x0013bbcd LAB_0013bbb4: MOV RSI,qword ptr [RBX + 0x8] CMP RSI,qword ptr [RBX + 0x10] JZ 0x0013bbea MOV dword ptr [RSI],ECX JMP 0x0013bbdc LAB_0013bbc2: MOV RDI,RBX MOV RDX,RSP CALL 0x0011fd90 LAB_0013bbcd: MOV RSI,qword ptr [RBX + 0x8] CMP RSI,qword ptr [RBX + 0x10] JZ 0x0013bbea MOV EAX,dword ptr [RSP] MOV dword ptr [RSI],EAX LAB_0013bbdc: ADD RSI,0x4 MOV RAX,qword ptr [RSP + 0x8] MOV qword ptr [RAX],RSI JMP 0x0013bbf5 LAB_0013bbea: MOV RDI,RBX MOV RDX,RSP CALL 0x0011fd90 LAB_0013bbf5: CMP RBP,qword ptr [R14 + 0x8] JC 0x0013baff LAB_0013bbff: MOV RAX,RBX ADD RSP,0x18 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* ftxui::CellToGlyphIndex(std::__cxx11::string const&) */ ftxui * __thiscall ftxui::CellToGlyphIndex(ftxui *this,string *param_1) { bool bVar1; uint uVar2; char cVar3; ulong uVar4; int *piVar5; int local_48; uint local_44; ftxui *local_40; ulong local_38; local_48 = -1; *(int8 *)this = 0; *(int8 *)(this + 8) = 0; *(int8 *)(this + 0x10) = 0; /* try { // try from 0013bad1 to 0013bad5 has its CatchHandler @ 0013bc11 */ std::vector<int,std::allocator<int>>::reserve ((vector<int,std::allocator<int>> *)this,*(ulong *)(param_1 + 8)); local_38 = 0; if (*(long *)(param_1 + 8) != 0) { local_40 = this + 8; uVar4 = 0; do { local_44 = 0; cVar3 = EatCodePoint(param_1,uVar4,&local_38,&local_44); uVar4 = local_38; uVar2 = local_44; if ((cVar3 != '\0') && (local_44 != 0)) { bVar1 = local_44 - 0x7f < 0x21; if (local_44 < 0x20) { bVar1 = local_44 != 10; } if (!bVar1) { cVar3 = IsCombining(local_44); if (cVar3 == '\0') { cVar3 = IsFullWidth(uVar2); local_48 = local_48 + 1; if (cVar3 == '\0') { piVar5 = *(int **)(this + 8); if (piVar5 == *(int **)(this + 0x10)) goto LAB_0013bbea; *piVar5 = local_48; } else { piVar5 = *(int **)(this + 8); if (piVar5 == *(int **)(this + 0x10)) { /* try { // try from 0013bbc2 to 0013bbf4 has its CatchHandler @ 0013bc13 */ std::vector<int,std::allocator<int>>::_M_realloc_insert<int_const&> ((vector<int,std::allocator<int>> *)this,piVar5,&local_48); } else { *piVar5 = local_48; *(int **)local_40 = piVar5 + 1; } piVar5 = *(int **)(this + 8); if (piVar5 == *(int **)(this + 0x10)) { LAB_0013bbea: std::vector<int,std::allocator<int>>::_M_realloc_insert<int_const&> ((vector<int,std::allocator<int>> *)this,piVar5,&local_48); goto LAB_0013bbf5; } *piVar5 = local_48; } LAB_0013bbdc: *(int **)local_40 = piVar5 + 1; } else if (local_48 == -1) { local_48 = 0; piVar5 = *(int **)(this + 8); if (piVar5 == *(int **)(this + 0x10)) goto LAB_0013bbea; *piVar5 = 0; goto LAB_0013bbdc; } } } LAB_0013bbf5: } while (uVar4 < *(ulong *)(param_1 + 8)); } return this; }
2,908
mi_cmp_dynamic_record
eloqsql/storage/myisam/mi_dynrec.c
int _mi_cmp_dynamic_record(register MI_INFO *info, register const uchar *record) { uint flag,reclength,b_type; my_off_t filepos; uchar *buffer; MI_BLOCK_INFO block_info; DBUG_ENTER("_mi_cmp_dynamic_record"); if (info->opt_flag & WRITE_CACHE_USED) { info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK); if (flush_io_cache(&info->rec_cache)) DBUG_RETURN(-1); } info->rec_cache.seek_not_done=1; /* If nobody have touched the database we don't have to test rec */ buffer=info->rec_buff; if ((info->opt_flag & READ_CHECK_USED)) { /* If check isn't disabled */ if (info->s->base.blobs) { if (!(buffer=(uchar*) my_alloca(info->s->base.pack_reclength+ _mi_calc_total_blob_length(info,record)))) DBUG_RETURN(-1); } reclength=_mi_rec_pack(info,buffer,record); record= buffer; filepos=info->lastpos; flag=block_info.second_read=0; block_info.next_filepos=filepos; while (reclength > 0) { if ((b_type=_mi_get_block_info(&block_info,info->dfile, block_info.next_filepos)) & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | BLOCK_FATAL_ERROR)) { if (b_type & (BLOCK_SYNC_ERROR | BLOCK_DELETED)) my_errno=HA_ERR_RECORD_CHANGED; goto err; } if (flag == 0) /* First block */ { flag=1; if (reclength != block_info.rec_len) { my_errno=HA_ERR_RECORD_CHANGED; goto err; } } else if (reclength < block_info.data_len) { my_errno=HA_ERR_WRONG_IN_RECORD; goto err; } reclength-=block_info.data_len; if (_mi_cmp_buffer(info->dfile,record,block_info.filepos, block_info.data_len)) { my_errno=HA_ERR_RECORD_CHANGED; goto err; } flag=1; record+=block_info.data_len; } } my_errno=0; err: if (buffer != info->rec_buff) my_afree((uchar*) buffer); DBUG_RETURN(my_errno); }
O3
c
mi_cmp_dynamic_record: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x20e8, %rsp # imm = 0x20E8 movq %rsi, %r14 movq %rdi, %r12 movq %fs:0x28, %rax movq %rax, -0x30(%rbp) movl 0x1c8(%rdi), %eax testb $0x10, %al je 0x7c5fc andb $-0xa, 0x1d1(%r12) leaq 0x220(%r12), %rdi movl $0x1, %esi callq 0x98245 movl %eax, %ecx movl $0xffffffff, %eax # imm = 0xFFFFFFFF testl %ecx, %ecx jne 0x7c97a movl 0x1c8(%r12), %eax movl $0x1, 0x300(%r12) movq 0x120(%r12), %rbx xorl %r15d, %r15d testb $0x4, %al je 0x7c959 movq (%r12), %rax cmpl $0x0, 0x188(%rax) je 0x7c655 movq 0x148(%rax), %rbx movq %r12, %rdi movq %r14, %rsi callq 0x7aaf8 addq %rax, %rbx xorl %edi, %edi movq %rbx, %rsi xorl %edx, %edx callq 0xa2a95 movq %rax, %rbx testq %rax, %rax je 0x7c99b movq %r12, %rdi movq %rbx, %rsi movq %r14, %rdx callq 0x7a1be movl %eax, %r14d movq 0x170(%r12), %rax movl $0x0, -0x2038(%rbp) movq %rax, -0x2048(%rbp) testl %r14d, %r14d je 0x7c959 movb $0x1, %r15b leaq -0x2088(%rbp), %rdi movq %rbx, %r13 movq %r12, -0x2098(%rbp) movq %rbx, -0x2090(%rbp) movl 0x1c0(%r12), %esi movq -0x2048(%rbp), %rdx callq 0x7b4df cmpl $0x4, %eax jae 0x7c9a2 movl %r14d, %eax testb $0x1, %r15b je 0x7c6df cmpq %rax, -0x2070(%rbp) jne 0x7c9b6 movq -0x2068(%rbp), %rdx jmp 0x7c6ef movq -0x2068(%rbp), %rdx cmpq %rax, %rdx ja 0x7c9ae movl %r14d, -0x209c(%rbp) movl 0x1c0(%r12), %ebx movq -0x2050(%rbp), %r14 cmpl $0x2001, %edx # imm = 0x2001 movq %r13, -0x20b8(%rbp) movq %rdx, -0x20b0(%rbp) jb 0x7c837 movl %r14d, %ecx andl $0xfff, %ecx # imm = 0xFFF movl $0x2000, %eax # imm = 0x2000 subl %ecx, %eax movq %r13, %r15 movl %edx, %r13d movq %r15, -0x20c0(%rbp) movl %eax, %r12d leaq 0x30c91a(%rip), %rax # 0x389060 movq (%rax), %rax leaq -0x2108(%rbp), %rdi movl %ebx, %esi movl $0x6, %edx callq *0x158(%rax) testq %rax, %rax jne 0x7c7c6 movl $0x4, %r8d movl %ebx, %edi leaq -0x2030(%rbp), %rsi movq %r12, %rdx movq %r14, %rcx callq 0xa32d8 movq %rax, %r15 testq %r15, %r15 movq -0x20c0(%rbp), %r15 jne 0x7c945 movq %r15, %rdi leaq -0x2030(%rbp), %rsi movq %r12, %rdx callq 0x29520 testl %eax, %eax jne 0x7c945 addq %r12, %r14 addq %r12, %r15 subl %r12d, %r13d movl $0x2000, %eax # imm = 0x2000 cmpl $0x2000, %r13d # imm = 0x2000 ja 0x7c735 jmp 0x7c83d movq %rax, %rcx leaq 0x30c890(%rip), %rax # 0x389060 movq (%rax), %rax movq %rcx, -0x20a8(%rbp) movq %rcx, %rdi movq %r12, %rsi leaq 0x615d7(%rip), %rdx # 0xdddbe movl $0x67e, %ecx # imm = 0x67E callq *0x210(%rax) movl $0x4, %r8d movl %ebx, %edi leaq -0x2030(%rbp), %rsi movq %r12, %rdx movq %r14, %rcx callq 0xa32d8 movq %rax, %r15 testq %rax, %rax movl $0x0, %esi cmoveq %r12, %rsi leaq 0x30c83e(%rip), %rax # 0x389060 movq (%rax), %rax movq -0x20a8(%rbp), %rdi callq *0x218(%rax) jmp 0x7c77f movq %r13, %r15 movl %edx, %r13d movl %r13d, %r13d leaq 0x30c819(%rip), %rax # 0x389060 movq (%rax), %rax leaq -0x2108(%rbp), %rdi movl %ebx, %esi movl $0x6, %edx callq *0x158(%rax) testq %rax, %rax jne 0x7c8df movl $0x4, %r8d movl %ebx, %edi leaq -0x2030(%rbp), %rsi movq %r13, %rdx movq %r14, %rcx callq 0xa32d8 movq %rax, %rbx testq %rbx, %rbx jne 0x7c945 movq %r15, %rdi leaq -0x2030(%rbp), %rsi movq %r13, %rdx callq 0x29520 testl %eax, %eax jne 0x7c945 movq -0x20b8(%rbp), %r13 addq -0x2068(%rbp), %r13 xorl %r15d, %r15d movl -0x209c(%rbp), %r14d subl -0x20b0(%rbp), %r14d movq -0x2098(%rbp), %r12 movq -0x2090(%rbp), %rbx leaq -0x2088(%rbp), %rdi jne 0x7c6a3 jmp 0x7c959 movq %rax, %r12 leaq 0x30c777(%rip), %rax # 0x389060 movq (%rax), %rax movq %r12, %rdi movq %r13, %rsi leaq 0x614c5(%rip), %rdx # 0xdddbe movl $0x686, %ecx # imm = 0x686 callq *0x210(%rax) movl $0x4, %r8d movl %ebx, %edi leaq -0x2030(%rbp), %rsi movq %r13, %rdx movq %r14, %rcx callq 0xa32d8 movq %rax, %rbx testq %rax, %rax movl $0x0, %esi cmoveq %r13, %rsi leaq 0x30c72c(%rip), %rax # 0x389060 movq (%rax), %rax movq %r12, %rdi callq *0x218(%rax) jmp 0x7c880 movl $0x7b, %r15d movq -0x2098(%rbp), %r12 movq -0x2090(%rbp), %rbx callq 0xa48d6 movl %r15d, (%rax) cmpq 0x120(%r12), %rbx je 0x7c973 movq %rbx, %rdi callq 0xa2cc2 callq 0xa48d6 movl (%rax), %eax movq %fs:0x28, %rcx cmpq -0x30(%rbp), %rcx jne 0x7c9be addq $0x20e8, %rsp # imm = 0x20E8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0xffffffff, %eax # imm = 0xFFFFFFFF jmp 0x7c97a movl $0x7b, %r15d testb $0x14, %al jne 0x7c959 jmp 0x7c961 movl $0x7f, %r15d jmp 0x7c959 movl $0x7b, %r15d jmp 0x7c959 callq 0x29240
_mi_cmp_dynamic_record: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 20E8h mov r14, rsi mov r12, rdi mov rax, fs:28h mov [rbp+var_30], rax mov eax, [rdi+1C8h] test al, 10h jz short loc_7C5FC and byte ptr [r12+1D1h], 0F6h lea rdi, [r12+220h] mov esi, 1 call my_b_flush_io_cache mov ecx, eax mov eax, 0FFFFFFFFh test ecx, ecx jnz loc_7C97A mov eax, [r12+1C8h] loc_7C5FC: mov dword ptr [r12+300h], 1 mov rbx, [r12+120h] xor r15d, r15d test al, 4 jz loc_7C959 mov rax, [r12] cmp dword ptr [rax+188h], 0 jz short loc_7C655 mov rbx, [rax+148h] mov rdi, r12 mov rsi, r14 call _mi_calc_total_blob_length add rbx, rax xor edi, edi mov rsi, rbx xor edx, edx call my_malloc mov rbx, rax test rax, rax jz loc_7C99B loc_7C655: mov rdi, r12 mov rsi, rbx mov rdx, r14 call _mi_rec_pack mov r14d, eax mov rax, [r12+170h] mov [rbp+var_2038], 0 mov [rbp+var_2048], rax test r14d, r14d jz loc_7C959 mov r15b, 1 lea rdi, [rbp+var_2088] mov r13, rbx mov [rbp+var_2098], r12 mov [rbp+var_2090], rbx loc_7C6A3: mov esi, [r12+1C0h] mov rdx, [rbp+var_2048] call _mi_get_block_info cmp eax, 4 jnb loc_7C9A2 mov eax, r14d test r15b, 1 jz short loc_7C6DF cmp [rbp+var_2070], rax jnz loc_7C9B6 mov rdx, [rbp+var_2068] jmp short loc_7C6EF loc_7C6DF: mov rdx, [rbp+var_2068] cmp rdx, rax ja loc_7C9AE loc_7C6EF: mov [rbp+var_209C], r14d mov ebx, [r12+1C0h] mov r14, [rbp+var_2050] cmp edx, 2001h mov [rbp+var_20B8], r13 mov [rbp+var_20B0], rdx jb loc_7C837 mov ecx, r14d and ecx, 0FFFh mov eax, 2000h sub eax, ecx mov r15, r13 mov r13d, edx loc_7C735: mov [rbp+var_20C0], r15 mov r12d, eax lea rax, PSI_server mov rax, [rax] lea rdi, [rbp+var_2108] mov esi, ebx mov edx, 6 call qword ptr [rax+158h] test rax, rax jnz short loc_7C7C6 mov r8d, 4 mov edi, ebx lea rsi, [rbp+var_2030] mov rdx, r12 mov rcx, r14 call my_pread mov r15, rax loc_7C77F: test r15, r15 mov r15, [rbp+var_20C0] jnz loc_7C945 mov rdi, r15 lea rsi, [rbp+var_2030] mov rdx, r12 call _bcmp test eax, eax jnz loc_7C945 add r14, r12 add r15, r12 sub r13d, r12d mov eax, 2000h cmp r13d, 2000h ja loc_7C735 jmp short loc_7C83D loc_7C7C6: mov rcx, rax lea rax, PSI_server mov rax, [rax] mov [rbp+var_20A8], rcx mov rdi, rcx mov rsi, r12 lea rdx, aWorkspaceLlm4b_13; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 67Eh call qword ptr [rax+210h] mov r8d, 4 mov edi, ebx lea rsi, [rbp+var_2030] mov rdx, r12 mov rcx, r14 call my_pread mov r15, rax test rax, rax mov esi, 0 cmovz rsi, r12 lea rax, PSI_server mov rax, [rax] mov rdi, [rbp+var_20A8] call qword ptr [rax+218h] jmp loc_7C77F loc_7C837: mov r15, r13 mov r13d, edx loc_7C83D: mov r13d, r13d lea rax, PSI_server mov rax, [rax] lea rdi, [rbp+var_2108] mov esi, ebx mov edx, 6 call qword ptr [rax+158h] test rax, rax jnz short loc_7C8DF mov r8d, 4 mov edi, ebx lea rsi, [rbp+var_2030] mov rdx, r13 mov rcx, r14 call my_pread mov rbx, rax loc_7C880: test rbx, rbx jnz loc_7C945 mov rdi, r15 lea rsi, [rbp+var_2030] mov rdx, r13 call _bcmp test eax, eax jnz loc_7C945 mov r13, [rbp+var_20B8] add r13, [rbp+var_2068] xor r15d, r15d mov r14d, [rbp+var_209C] sub r14d, dword ptr [rbp+var_20B0] mov r12, [rbp+var_2098] mov rbx, [rbp+var_2090] lea rdi, [rbp+var_2088] jnz loc_7C6A3 jmp short loc_7C959 loc_7C8DF: mov r12, rax lea rax, PSI_server mov rax, [rax] mov rdi, r12 mov rsi, r13 lea rdx, aWorkspaceLlm4b_13; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 686h call qword ptr [rax+210h] mov r8d, 4 mov edi, ebx lea rsi, [rbp+var_2030] mov rdx, r13 mov rcx, r14 call my_pread mov rbx, rax test rax, rax mov esi, 0 cmovz rsi, r13 lea rax, PSI_server mov rax, [rax] mov rdi, r12 call qword ptr [rax+218h] jmp loc_7C880 loc_7C945: mov r15d, 7Bh ; '{' mov r12, [rbp+var_2098] mov rbx, [rbp+var_2090] loc_7C959: call _my_thread_var mov [rax], r15d loc_7C961: cmp rbx, [r12+120h] jz short loc_7C973 mov rdi, rbx call my_free loc_7C973: call _my_thread_var mov eax, [rax] loc_7C97A: mov rcx, fs:28h cmp rcx, [rbp+var_30] jnz short loc_7C9BE add rsp, 20E8h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_7C99B: mov eax, 0FFFFFFFFh jmp short loc_7C97A loc_7C9A2: mov r15d, 7Bh ; '{' test al, 14h jnz short loc_7C959 jmp short loc_7C961 loc_7C9AE: mov r15d, 7Fh jmp short loc_7C959 loc_7C9B6: mov r15d, 7Bh ; '{' jmp short loc_7C959 loc_7C9BE: call ___stack_chk_fail
long long mi_cmp_dynamic_record(unsigned long long a1, char *a2) { long long v2; // r12 int v3; // eax int v4; // ecx long long result; // rax _BYTE *v6; // rbx int v7; // r15d long long v8; // rbx long long v9; // rax unsigned int v10; // r14d long long v11; // rax _BYTE *v12; // r13 unsigned int block_info; // eax unsigned long long v14; // rdx unsigned int v15; // ebx long long v16; // r14 unsigned int v17; // eax _BYTE *v18; // r15 unsigned int v19; // r13d long long v20; // r12 long long v21; // rax long long v22; // r15 bool v23; // zf _BYTE *v24; // r15 long long v25; // rsi long long v26; // rax long long v27; // rbx _BYTE *v28; // r12 long long v29; // rsi _BYTE v30[72]; // [rsp+8h] [rbp-2108h] BYREF _BYTE *v31; // [rsp+50h] [rbp-20C0h] _BYTE *v32; // [rsp+58h] [rbp-20B8h] unsigned long long v33; // [rsp+60h] [rbp-20B0h] _BYTE *v34; // [rsp+68h] [rbp-20A8h] unsigned int v35; // [rsp+74h] [rbp-209Ch] long long v36; // [rsp+78h] [rbp-2098h] _BYTE *v37; // [rsp+80h] [rbp-2090h] _BYTE v38[24]; // [rsp+88h] [rbp-2088h] BYREF long long v39; // [rsp+A0h] [rbp-2070h] unsigned long long v40; // [rsp+A8h] [rbp-2068h] long long v41; // [rsp+C0h] [rbp-2050h] long long v42; // [rsp+C8h] [rbp-2048h] int v43; // [rsp+D8h] [rbp-2038h] _BYTE v44[8192]; // [rsp+E0h] [rbp-2030h] BYREF unsigned long long v45; // [rsp+20E0h] [rbp-30h] v2 = a1; v45 = __readfsqword(0x28u); v3 = *(_DWORD *)(a1 + 456); if ( (v3 & 0x10) != 0 ) { *(_BYTE *)(a1 + 465) &= 0xF6u; a1 += 544LL; v4 = my_b_flush_io_cache(a1, 1LL); result = 0xFFFFFFFFLL; if ( v4 ) return result; v3 = *(_DWORD *)(v2 + 456); } *(_DWORD *)(v2 + 768) = 1; v6 = *(_BYTE **)(v2 + 288); v7 = 0; if ( (v3 & 4) == 0 ) goto LABEL_36; if ( *(_DWORD *)(*(_QWORD *)v2 + 392LL) ) { v8 = *(_QWORD *)(*(_QWORD *)v2 + 328LL); v9 = mi_calc_total_blob_length((_QWORD *)v2, (long long)a2); v6 = (_BYTE *)my_malloc(0LL, v9 + v8, 0LL); if ( !v6 ) return 0xFFFFFFFFLL; } a1 = v2; v10 = mi_rec_pack(v2, v6, a2); v11 = *(_QWORD *)(v2 + 368); v43 = 0; v42 = v11; if ( v10 ) { LOBYTE(v7) = 1; a1 = (unsigned long long)v38; v12 = v6; v36 = v2; v37 = v6; while ( 1 ) { block_info = mi_get_block_info((long long)v38, *(unsigned int *)(v2 + 448), v42); if ( block_info >= 4 ) break; if ( (v7 & 1) != 0 ) { if ( v39 != v10 ) { v7 = 123; goto LABEL_36; } v14 = v40; } else { v14 = v40; if ( v40 > v10 ) { v7 = 127; goto LABEL_36; } } v35 = v10; v15 = *(_DWORD *)(v2 + 448); v16 = v41; v32 = v12; v33 = v14; if ( (unsigned int)v14 >= 0x2001 ) { v17 = 0x2000 - (v41 & 0xFFF); v18 = v12; v19 = v14; while ( 1 ) { v31 = v18; v20 = v17; v21 = ((long long ( *)(_BYTE *, _QWORD, long long))PSI_server[43])(v30, v15, 6LL); if ( v21 ) { v34 = (_BYTE *)v21; ((void ( *)(long long, long long, const char *, long long))PSI_server[66])( v21, v20, "/workspace/llm4binary/github2025/eloqsql/storage/myisam/mi_dynrec.c", 1662LL); v22 = my_pread(v15, v44, v20, v16, 4LL); v25 = 0LL; if ( !v22 ) v25 = v20; a1 = (unsigned long long)v34; ((void ( *)(_BYTE *, long long))PSI_server[67])(v34, v25); } else { a1 = v15; v22 = my_pread(v15, v44, v20, v16, 4LL); } v23 = v22 == 0; v24 = v31; if ( !v23 ) break; a1 = (unsigned long long)v31; if ( (unsigned int)bcmp(v31, v44, v20) ) break; v16 += v20; v18 = &v24[v20]; v19 -= v20; v17 = 0x2000; if ( v19 <= 0x2000 ) goto LABEL_26; } LABEL_35: v7 = 123; v2 = v36; v6 = v37; goto LABEL_36; } v18 = v12; v19 = v14; LABEL_26: v26 = ((long long ( *)(_BYTE *, _QWORD, long long))PSI_server[43])(v30, v15, 6LL); if ( v26 ) { v28 = (_BYTE *)v26; ((void ( *)(long long, _QWORD, const char *, long long))PSI_server[66])( v26, v19, "/workspace/llm4binary/github2025/eloqsql/storage/myisam/mi_dynrec.c", 1670LL); v27 = my_pread(v15, v44, v19, v16, 4LL); v29 = 0LL; if ( !v27 ) v29 = v19; a1 = (unsigned long long)v28; ((void ( *)(_BYTE *, long long))PSI_server[67])(v28, v29); } else { a1 = v15; v27 = my_pread(v15, v44, v19, v16, 4LL); } if ( v27 ) goto LABEL_35; a1 = (unsigned long long)v18; if ( (unsigned int)bcmp(v18, v44, v19) ) goto LABEL_35; v12 = &v32[v40]; v7 = 0; v10 = v35 - v33; v2 = v36; v6 = v37; a1 = (unsigned long long)v38; if ( v35 == (_DWORD)v33 ) goto LABEL_36; } v7 = 123; if ( (block_info & 0x14) != 0 ) goto LABEL_36; } else { LABEL_36: *(_DWORD *)my_thread_var(a1) = v7; } if ( v6 != *(_BYTE **)(v2 + 288) ) { a1 = (unsigned long long)v6; my_free(v6); } return *(unsigned int *)my_thread_var(a1); }
_mi_cmp_dynamic_record: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x20e8 MOV R14,RSI MOV R12,RDI MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RBP + -0x30],RAX MOV EAX,dword ptr [RDI + 0x1c8] TEST AL,0x10 JZ 0x0017c5fc AND byte ptr [R12 + 0x1d1],0xf6 LEA RDI,[R12 + 0x220] MOV ESI,0x1 CALL 0x00198245 MOV ECX,EAX MOV EAX,0xffffffff TEST ECX,ECX JNZ 0x0017c97a MOV EAX,dword ptr [R12 + 0x1c8] LAB_0017c5fc: MOV dword ptr [R12 + 0x300],0x1 MOV RBX,qword ptr [R12 + 0x120] XOR R15D,R15D TEST AL,0x4 JZ 0x0017c959 MOV RAX,qword ptr [R12] CMP dword ptr [RAX + 0x188],0x0 JZ 0x0017c655 MOV RBX,qword ptr [RAX + 0x148] MOV RDI,R12 MOV RSI,R14 CALL 0x0017aaf8 ADD RBX,RAX XOR EDI,EDI MOV RSI,RBX XOR EDX,EDX CALL 0x001a2a95 MOV RBX,RAX TEST RAX,RAX JZ 0x0017c99b LAB_0017c655: MOV RDI,R12 MOV RSI,RBX MOV RDX,R14 CALL 0x0017a1be MOV R14D,EAX MOV RAX,qword ptr [R12 + 0x170] MOV dword ptr [RBP + -0x2038],0x0 MOV qword ptr [RBP + -0x2048],RAX TEST R14D,R14D JZ 0x0017c959 MOV R15B,0x1 LEA RDI,[RBP + -0x2088] MOV R13,RBX MOV qword ptr [RBP + -0x2098],R12 MOV qword ptr [RBP + -0x2090],RBX LAB_0017c6a3: MOV ESI,dword ptr [R12 + 0x1c0] MOV RDX,qword ptr [RBP + -0x2048] CALL 0x0017b4df CMP EAX,0x4 JNC 0x0017c9a2 MOV EAX,R14D TEST R15B,0x1 JZ 0x0017c6df CMP qword ptr [RBP + -0x2070],RAX JNZ 0x0017c9b6 MOV RDX,qword ptr [RBP + -0x2068] JMP 0x0017c6ef LAB_0017c6df: MOV RDX,qword ptr [RBP + -0x2068] CMP RDX,RAX JA 0x0017c9ae LAB_0017c6ef: MOV dword ptr [RBP + -0x209c],R14D MOV EBX,dword ptr [R12 + 0x1c0] MOV R14,qword ptr [RBP + -0x2050] CMP EDX,0x2001 MOV qword ptr [RBP + -0x20b8],R13 MOV qword ptr [RBP + -0x20b0],RDX JC 0x0017c837 MOV ECX,R14D AND ECX,0xfff MOV EAX,0x2000 SUB EAX,ECX MOV R15,R13 MOV R13D,EDX LAB_0017c735: MOV qword ptr [RBP + -0x20c0],R15 MOV R12D,EAX LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] LEA RDI,[RBP + -0x2108] MOV ESI,EBX MOV EDX,0x6 CALL qword ptr [RAX + 0x158] TEST RAX,RAX JNZ 0x0017c7c6 MOV R8D,0x4 MOV EDI,EBX LEA RSI,[RBP + -0x2030] MOV RDX,R12 MOV RCX,R14 CALL 0x001a32d8 MOV R15,RAX LAB_0017c77f: TEST R15,R15 MOV R15,qword ptr [RBP + -0x20c0] JNZ 0x0017c945 MOV RDI,R15 LEA RSI,[RBP + -0x2030] MOV RDX,R12 CALL 0x00129520 TEST EAX,EAX JNZ 0x0017c945 ADD R14,R12 ADD R15,R12 SUB R13D,R12D MOV EAX,0x2000 CMP R13D,0x2000 JA 0x0017c735 JMP 0x0017c83d LAB_0017c7c6: MOV RCX,RAX LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] MOV qword ptr [RBP + -0x20a8],RCX MOV RDI,RCX MOV RSI,R12 LEA RDX,[0x1dddbe] MOV ECX,0x67e CALL qword ptr [RAX + 0x210] MOV R8D,0x4 MOV EDI,EBX LEA RSI,[RBP + -0x2030] MOV RDX,R12 MOV RCX,R14 CALL 0x001a32d8 MOV R15,RAX TEST RAX,RAX MOV ESI,0x0 CMOVZ RSI,R12 LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] MOV RDI,qword ptr [RBP + -0x20a8] CALL qword ptr [RAX + 0x218] JMP 0x0017c77f LAB_0017c837: MOV R15,R13 MOV R13D,EDX LAB_0017c83d: MOV R13D,R13D LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] LEA RDI,[RBP + -0x2108] MOV ESI,EBX MOV EDX,0x6 CALL qword ptr [RAX + 0x158] TEST RAX,RAX JNZ 0x0017c8df MOV R8D,0x4 MOV EDI,EBX LEA RSI,[RBP + -0x2030] MOV RDX,R13 MOV RCX,R14 CALL 0x001a32d8 MOV RBX,RAX LAB_0017c880: TEST RBX,RBX JNZ 0x0017c945 MOV RDI,R15 LEA RSI,[RBP + -0x2030] MOV RDX,R13 CALL 0x00129520 TEST EAX,EAX JNZ 0x0017c945 MOV R13,qword ptr [RBP + -0x20b8] ADD R13,qword ptr [RBP + -0x2068] XOR R15D,R15D MOV R14D,dword ptr [RBP + -0x209c] SUB R14D,dword ptr [RBP + -0x20b0] MOV R12,qword ptr [RBP + -0x2098] MOV RBX,qword ptr [RBP + -0x2090] LEA RDI,[RBP + -0x2088] JNZ 0x0017c6a3 JMP 0x0017c959 LAB_0017c8df: MOV R12,RAX LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] MOV RDI,R12 MOV RSI,R13 LEA RDX,[0x1dddbe] MOV ECX,0x686 CALL qword ptr [RAX + 0x210] MOV R8D,0x4 MOV EDI,EBX LEA RSI,[RBP + -0x2030] MOV RDX,R13 MOV RCX,R14 CALL 0x001a32d8 MOV RBX,RAX TEST RAX,RAX MOV ESI,0x0 CMOVZ RSI,R13 LEA RAX,[0x489060] MOV RAX,qword ptr [RAX] MOV RDI,R12 CALL qword ptr [RAX + 0x218] JMP 0x0017c880 LAB_0017c945: MOV R15D,0x7b MOV R12,qword ptr [RBP + -0x2098] MOV RBX,qword ptr [RBP + -0x2090] LAB_0017c959: CALL 0x001a48d6 MOV dword ptr [RAX],R15D LAB_0017c961: CMP RBX,qword ptr [R12 + 0x120] JZ 0x0017c973 MOV RDI,RBX CALL 0x001a2cc2 LAB_0017c973: CALL 0x001a48d6 MOV EAX,dword ptr [RAX] LAB_0017c97a: MOV RCX,qword ptr FS:[0x28] CMP RCX,qword ptr [RBP + -0x30] JNZ 0x0017c9be ADD RSP,0x20e8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_0017c99b: MOV EAX,0xffffffff JMP 0x0017c97a LAB_0017c9a2: MOV R15D,0x7b TEST AL,0x14 JNZ 0x0017c959 JMP 0x0017c961 LAB_0017c9ae: MOV R15D,0x7f JMP 0x0017c959 LAB_0017c9b6: MOV R15D,0x7b JMP 0x0017c959 LAB_0017c9be: CALL 0x00129240
int4 _mi_cmp_dynamic_record(long *param_1,int8 param_2) { int iVar1; uint uVar2; uint uVar3; long lVar4; void *pvVar5; int4 *puVar6; void *pvVar7; ulong uVar8; ulong uVar9; ulong uVar10; long lVar11; bool bVar12; int4 uVar13; long in_FS_OFFSET; int1 local_2110 [72]; void *local_20c8; void *local_20c0; ulong local_20b8; long local_20b0; uint local_20a4; long *local_20a0; void *local_2098; int1 local_2090 [24]; ulong local_2078; ulong local_2070; long local_2058; long local_2050; int4 local_2040; int1 local_2038 [8192]; long local_38; local_38 = *(long *)(in_FS_OFFSET + 0x28); uVar2 = *(uint *)(param_1 + 0x39); if ((uVar2 & 0x10) != 0) { *(byte *)((long)param_1 + 0x1d1) = *(byte *)((long)param_1 + 0x1d1) & 0xf6; iVar1 = my_b_flush_io_cache(param_1 + 0x44,1); uVar13 = 0xffffffff; if (iVar1 != 0) goto LAB_0017c97a; uVar2 = *(uint *)(param_1 + 0x39); } *(int4 *)(param_1 + 0x60) = 1; pvVar5 = (void *)param_1[0x24]; uVar13 = 0; pvVar7 = pvVar5; if ((uVar2 & 4) != 0) { if (*(int *)(*param_1 + 0x188) != 0) { lVar11 = *(long *)(*param_1 + 0x148); lVar4 = _mi_calc_total_blob_length(param_1,param_2); pvVar5 = (void *)my_malloc(0,lVar11 + lVar4,0); if (pvVar5 == (void *)0x0) { uVar13 = 0xffffffff; goto LAB_0017c97a; } } uVar2 = _mi_rec_pack(param_1,pvVar5,param_2); local_2050 = param_1[0x2e]; local_2040 = 0; pvVar7 = pvVar5; if (uVar2 != 0) { bVar12 = true; local_20a0 = param_1; local_2098 = pvVar5; do { pvVar7 = local_2098; param_1 = local_20a0; uVar3 = _mi_get_block_info(local_2090,(int)local_20a0[0x38],local_2050); if (3 < uVar3) { uVar13 = 0x7b; if ((uVar3 & 0x14) == 0) goto LAB_0017c961; break; } if (bVar12) { if (local_2078 != uVar2) { uVar13 = 0x7b; break; } } else if (uVar2 < local_2070) { uVar13 = 0x7f; break; } uVar13 = (int4)param_1[0x38]; uVar3 = (uint)local_2070; local_20b8 = local_2070; lVar11 = local_2058; local_20c0 = pvVar5; local_20a4 = uVar2; if (0x2000 < uVar3) { uVar2 = 0x2000 - ((uint)local_2058 & 0xfff); uVar10 = local_2070 & 0xffffffff; do { uVar9 = (ulong)uVar2; local_20c8 = pvVar5; lVar4 = (**(code **)(PSI_server + 0x158))(local_2110,uVar13,6); if (lVar4 == 0) { lVar4 = my_pread(uVar13,local_2038,uVar9,lVar11,4); } else { local_20b0 = lVar4; (**(code **)(PSI_server + 0x210)) (lVar4,uVar9, "/workspace/llm4binary/github2025/eloqsql/storage/myisam/mi_dynrec.c",0x67e ); lVar4 = my_pread(uVar13,local_2038,uVar9,lVar11,4); uVar8 = 0; if (lVar4 == 0) { uVar8 = uVar9; } (**(code **)(PSI_server + 0x218))(local_20b0,uVar8); } pvVar5 = local_20c8; if ((lVar4 != 0) || (iVar1 = bcmp(local_20c8,local_2038,uVar9), iVar1 != 0)) goto LAB_0017c945; lVar11 = lVar11 + uVar9; pvVar5 = (void *)((long)pvVar5 + uVar9); uVar3 = (int)uVar10 - uVar2; uVar10 = (ulong)uVar3; uVar2 = 0x2000; } while (0x2000 < uVar3); } uVar10 = (ulong)uVar3; lVar4 = (**(code **)(PSI_server + 0x158))(local_2110,uVar13,6); if (lVar4 == 0) { lVar11 = my_pread(uVar13,local_2038,uVar10,lVar11,4); } else { (**(code **)(PSI_server + 0x210)) (lVar4,uVar10, "/workspace/llm4binary/github2025/eloqsql/storage/myisam/mi_dynrec.c",0x686); lVar11 = my_pread(uVar13,local_2038,uVar10,lVar11,4); uVar9 = 0; if (lVar11 == 0) { uVar9 = uVar10; } (**(code **)(PSI_server + 0x218))(lVar4,uVar9); } if ((lVar11 != 0) || (iVar1 = bcmp(pvVar5,local_2038,uVar10), iVar1 != 0)) { LAB_0017c945: uVar13 = 0x7b; pvVar7 = local_2098; param_1 = local_20a0; break; } pvVar5 = (void *)((long)local_20c0 + local_2070); bVar12 = false; uVar13 = 0; uVar2 = local_20a4 - (int)local_20b8; pvVar7 = local_2098; param_1 = local_20a0; } while (uVar2 != 0); } } puVar6 = (int4 *)_my_thread_var(); *puVar6 = uVar13; LAB_0017c961: if (pvVar7 != (void *)param_1[0x24]) { my_free(pvVar7); } puVar6 = (int4 *)_my_thread_var(); uVar13 = *puVar6; LAB_0017c97a: if (*(long *)(in_FS_OFFSET + 0x28) != local_38) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return uVar13; }
2,909
js_os_rename
bluesky950520[P]quickjs/quickjs-libc.c
static JSValue js_os_rename(JSContext *ctx, JSValue this_val, int argc, JSValue *argv) { const char *oldpath, *newpath; int ret; oldpath = JS_ToCString(ctx, argv[0]); if (!oldpath) return JS_EXCEPTION; newpath = JS_ToCString(ctx, argv[1]); if (!newpath) { JS_FreeCString(ctx, oldpath); return JS_EXCEPTION; } ret = js_get_errno(rename(oldpath, newpath)); JS_FreeCString(ctx, oldpath); JS_FreeCString(ctx, newpath); return JS_NewInt32(ctx, ret); }
O0
c
js_os_rename: subq $0x78, %rsp movq %rsi, 0x38(%rsp) movq %rdx, 0x40(%rsp) movq %rdi, 0x30(%rsp) movl %ecx, 0x2c(%rsp) movq %r8, 0x20(%rsp) movq 0x30(%rsp), %rdi movq 0x20(%rsp), %rax movq (%rax), %rsi movq 0x8(%rax), %rdx callq 0x147e0 movq %rax, 0x18(%rsp) cmpq $0x0, 0x18(%rsp) jne 0x18775 movl $0x0, 0x48(%rsp) movq $0x6, 0x50(%rsp) jmp 0x1882b movq 0x30(%rsp), %rdi movq 0x20(%rsp), %rax movq 0x10(%rax), %rsi movq 0x18(%rax), %rdx callq 0x147e0 movq %rax, 0x10(%rsp) cmpq $0x0, 0x10(%rsp) jne 0x187bb movq 0x30(%rsp), %rdi movq 0x18(%rsp), %rsi callq 0x29e50 movl $0x0, 0x48(%rsp) movq $0x6, 0x50(%rsp) jmp 0x1882b movq 0x18(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0xe800 movslq %eax, %rdi callq 0x13a50 movl %eax, 0xc(%rsp) movq 0x30(%rsp), %rdi movq 0x18(%rsp), %rsi callq 0x29e50 movq 0x30(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0x29e50 movq 0x30(%rsp), %rcx movl 0xc(%rsp), %eax movq %rcx, 0x60(%rsp) movl %eax, 0x5c(%rsp) movl 0x5c(%rsp), %eax movl %eax, 0x68(%rsp) movq $0x0, 0x70(%rsp) movq 0x68(%rsp), %rcx movq 0x70(%rsp), %rax movq %rcx, 0x48(%rsp) movq %rax, 0x50(%rsp) movq 0x48(%rsp), %rax movq 0x50(%rsp), %rdx addq $0x78, %rsp retq nopw (%rax,%rax)
js_os_rename: sub rsp, 78h mov [rsp+78h+var_40], rsi mov [rsp+78h+var_38], rdx mov [rsp+78h+var_48], rdi mov [rsp+78h+var_4C], ecx mov [rsp+78h+var_58], r8 mov rdi, [rsp+78h+var_48] mov rax, [rsp+78h+var_58] mov rsi, [rax] mov rdx, [rax+8] call JS_ToCString mov [rsp+78h+var_60], rax cmp [rsp+78h+var_60], 0 jnz short loc_18775 mov dword ptr [rsp+78h+var_30], 0 mov [rsp+78h+var_28], 6 jmp loc_1882B loc_18775: mov rdi, [rsp+78h+var_48] mov rax, [rsp+78h+var_58] mov rsi, [rax+10h] mov rdx, [rax+18h] call JS_ToCString mov [rsp+78h+var_68], rax cmp [rsp+78h+var_68], 0 jnz short loc_187BB mov rdi, [rsp+78h+var_48] mov rsi, [rsp+78h+var_60] call JS_FreeCString mov dword ptr [rsp+78h+var_30], 0 mov [rsp+78h+var_28], 6 jmp short loc_1882B loc_187BB: mov rdi, [rsp+78h+var_60] mov rsi, [rsp+78h+var_68] call _rename movsxd rdi, eax call js_get_errno mov [rsp+78h+var_6C], eax mov rdi, [rsp+78h+var_48] mov rsi, [rsp+78h+var_60] call JS_FreeCString mov rdi, [rsp+78h+var_48] mov rsi, [rsp+78h+var_68] call JS_FreeCString mov rcx, [rsp+78h+var_48] mov eax, [rsp+78h+var_6C] mov [rsp+78h+var_18], rcx mov [rsp+78h+var_1C], eax mov eax, [rsp+78h+var_1C] mov dword ptr [rsp+78h+var_10], eax mov [rsp+78h+var_8], 0 mov rcx, [rsp+78h+var_10] mov rax, [rsp+78h+var_8] mov [rsp+78h+var_30], rcx mov [rsp+78h+var_28], rax loc_1882B: mov rax, [rsp+78h+var_30] mov rdx, [rsp+78h+var_28] add rsp, 78h retn
long long js_os_rename(long long a1, long long a2, long long a3, long long a4, long long *a5) { int v5; // eax int errno; // [rsp+Ch] [rbp-6Ch] long long v8; // [rsp+10h] [rbp-68h] long long v9; // [rsp+18h] [rbp-60h] long long v11; // [rsp+48h] [rbp-30h] long long v12; // [rsp+68h] [rbp-10h] v9 = JS_ToCString(a1, *a5, a5[1]); if ( v9 ) { v8 = JS_ToCString(a1, a5[2], a5[3]); if ( v8 ) { v5 = rename(v9, v8); errno = js_get_errno(v5); JS_FreeCString(a1, v9); JS_FreeCString(a1, v8); LODWORD(v12) = errno; return v12; } else { JS_FreeCString(a1, v9); LODWORD(v11) = 0; } } else { LODWORD(v11) = 0; } return v11; }
js_os_rename: SUB RSP,0x78 MOV qword ptr [RSP + 0x38],RSI MOV qword ptr [RSP + 0x40],RDX MOV qword ptr [RSP + 0x30],RDI MOV dword ptr [RSP + 0x2c],ECX MOV qword ptr [RSP + 0x20],R8 MOV RDI,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RSP + 0x20] MOV RSI,qword ptr [RAX] MOV RDX,qword ptr [RAX + 0x8] CALL 0x001147e0 MOV qword ptr [RSP + 0x18],RAX CMP qword ptr [RSP + 0x18],0x0 JNZ 0x00118775 MOV dword ptr [RSP + 0x48],0x0 MOV qword ptr [RSP + 0x50],0x6 JMP 0x0011882b LAB_00118775: MOV RDI,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RSP + 0x20] MOV RSI,qword ptr [RAX + 0x10] MOV RDX,qword ptr [RAX + 0x18] CALL 0x001147e0 MOV qword ptr [RSP + 0x10],RAX CMP qword ptr [RSP + 0x10],0x0 JNZ 0x001187bb MOV RDI,qword ptr [RSP + 0x30] MOV RSI,qword ptr [RSP + 0x18] CALL 0x00129e50 MOV dword ptr [RSP + 0x48],0x0 MOV qword ptr [RSP + 0x50],0x6 JMP 0x0011882b LAB_001187bb: MOV RDI,qword ptr [RSP + 0x18] MOV RSI,qword ptr [RSP + 0x10] CALL 0x0010e800 MOVSXD RDI,EAX CALL 0x00113a50 MOV dword ptr [RSP + 0xc],EAX MOV RDI,qword ptr [RSP + 0x30] MOV RSI,qword ptr [RSP + 0x18] CALL 0x00129e50 MOV RDI,qword ptr [RSP + 0x30] MOV RSI,qword ptr [RSP + 0x10] CALL 0x00129e50 MOV RCX,qword ptr [RSP + 0x30] MOV EAX,dword ptr [RSP + 0xc] MOV qword ptr [RSP + 0x60],RCX MOV dword ptr [RSP + 0x5c],EAX MOV EAX,dword ptr [RSP + 0x5c] MOV dword ptr [RSP + 0x68],EAX MOV qword ptr [RSP + 0x70],0x0 MOV RCX,qword ptr [RSP + 0x68] MOV RAX,qword ptr [RSP + 0x70] MOV qword ptr [RSP + 0x48],RCX MOV qword ptr [RSP + 0x50],RAX LAB_0011882b: MOV RAX,qword ptr [RSP + 0x48] MOV RDX,qword ptr [RSP + 0x50] ADD RSP,0x78 RET
int1 [16] js_os_rename(int8 param_1) { int1 auVar1 [16]; int iVar2; char *__old; char *__new; int8 *in_R8; int4 local_30; int4 uStack_2c; int8 local_28; int4 uStack_c; __old = (char *)JS_ToCString(param_1,*in_R8,in_R8[1]); if (__old == (char *)0x0) { local_30 = 0; local_28 = 6; } else { __new = (char *)JS_ToCString(param_1,in_R8[2],in_R8[3]); if (__new == (char *)0x0) { JS_FreeCString(param_1,__old); local_30 = 0; local_28 = 6; } else { iVar2 = rename(__old,__new); local_30 = js_get_errno((long)iVar2); JS_FreeCString(param_1,__old); JS_FreeCString(param_1,__new); uStack_2c = uStack_c; local_28 = 0; } } auVar1._4_4_ = uStack_2c; auVar1._0_4_ = local_30; auVar1._8_8_ = local_28; return auVar1; }
2,910
js_os_rename
bluesky950520[P]quickjs/quickjs-libc.c
static JSValue js_os_rename(JSContext *ctx, JSValue this_val, int argc, JSValue *argv) { const char *oldpath, *newpath; int ret; oldpath = JS_ToCString(ctx, argv[0]); if (!oldpath) return JS_EXCEPTION; newpath = JS_ToCString(ctx, argv[1]); if (!newpath) { JS_FreeCString(ctx, oldpath); return JS_EXCEPTION; } ret = js_get_errno(rename(oldpath, newpath)); JS_FreeCString(ctx, oldpath); JS_FreeCString(ctx, newpath); return JS_NewInt32(ctx, ret); }
O1
c
js_os_rename: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %r8, %r13 movq %rdi, %rbx movq (%r8), %rdx movq 0x8(%r8), %rcx xorl %r12d, %r12d xorl %esi, %esi xorl %r8d, %r8d callq 0x20bf7 movl $0x6, %r15d testq %rax, %rax je 0x18d9e movq %rax, %r14 movq 0x10(%r13), %rdx movq 0x18(%r13), %rcx movq %rbx, %rdi xorl %esi, %esi xorl %r8d, %r8d callq 0x20bf7 testq %rax, %rax je 0x18d90 movq %rax, %r12 movq %r14, %rdi movq %rax, %rsi callq 0xe810 movl %eax, %ebp cmpl $-0x1, %eax jne 0x18d72 callq 0xe0b0 xorl %ebp, %ebp subl (%rax), %ebp movq %rbx, %rdi movq %r14, %rsi callq 0x20edd movq %rbx, %rdi movq %r12, %rsi callq 0x20edd movl %ebp, %r12d xorl %r15d, %r15d jmp 0x18d9e movq %rbx, %rdi movq %r14, %rsi callq 0x20edd xorl %r12d, %r12d movq %r12, %rax movq %r15, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
js_os_rename: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov r13, r8 mov rbx, rdi mov rdx, [r8] mov rcx, [r8+8] xor r12d, r12d xor esi, esi xor r8d, r8d call JS_ToCStringLen2 mov r15d, 6 test rax, rax jz short loc_18D9E mov r14, rax mov rdx, [r13+10h] mov rcx, [r13+18h] mov rdi, rbx xor esi, esi xor r8d, r8d call JS_ToCStringLen2 test rax, rax jz short loc_18D90 mov r12, rax mov rdi, r14 mov rsi, rax call _rename mov ebp, eax cmp eax, 0FFFFFFFFh jnz short loc_18D72 call ___errno_location xor ebp, ebp sub ebp, [rax] loc_18D72: mov rdi, rbx mov rsi, r14 call JS_FreeCString mov rdi, rbx mov rsi, r12 call JS_FreeCString mov r12d, ebp xor r15d, r15d jmp short loc_18D9E loc_18D90: mov rdi, rbx mov rsi, r14 call JS_FreeCString xor r12d, r12d loc_18D9E: mov rax, r12 mov rdx, r15 add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long js_os_rename(long long a1, long long a2, long long a3, long long a4, _QWORD *a5) { long long v6; // r12 long long v7; // rax long long v8; // r14 long long v9; // rax long long v10; // r12 unsigned int v11; // ebp v6 = 0LL; v7 = JS_ToCStringLen2(a1, 0LL, *a5, a5[1], 0LL); if ( v7 ) { v8 = v7; v9 = JS_ToCStringLen2(a1, 0LL, a5[2], a5[3], 0LL); if ( v9 ) { v10 = v9; v11 = rename(v8, v9); if ( v11 == -1 ) v11 = -*(_DWORD *)__errno_location(v8); JS_FreeCString(a1, v8); JS_FreeCString(a1, v10); return v11; } else { JS_FreeCString(a1, v8); return 0LL; } } return v6; }
2,911
translog_purge_at_flush
eloqsql/storage/maria/ma_loghandler.c
my_bool translog_purge_at_flush() { uint32 i, min_file; int rc= 0; DBUG_ENTER("translog_purge_at_flush"); DBUG_ASSERT(translog_status == TRANSLOG_OK || translog_status == TRANSLOG_READONLY); if (unlikely(translog_status == TRANSLOG_READONLY)) { DBUG_PRINT("info", ("The log is read only => exit")); DBUG_RETURN(0); } if (log_purge_type != TRANSLOG_PURGE_ONDEMAND) { DBUG_PRINT("info", ("It is not \"at_flush\" => exit")); DBUG_RETURN(0); } mysql_mutex_lock(&log_descriptor.purger_lock); if (unlikely(log_descriptor.min_need_file == 0 || log_purge_disabled)) { DBUG_PRINT("info", ("No info about min need file => exit")); mysql_mutex_unlock(&log_descriptor.purger_lock); DBUG_RETURN(0); } min_file= translog_first_file(translog_get_horizon(), 1); DBUG_ASSERT(min_file != 0); /* log is already started */ for(i= min_file; i < log_descriptor.min_need_file && rc == 0; i++) { char path[FN_REFLEN], *file_name; DBUG_PRINT("info", ("purge file %lu\n", (ulong) i)); file_name= translog_filename_by_fileno(i, path); rc= MY_TEST(mysql_file_delete(key_file_translog, file_name, MYF(MY_WME))); } mysql_mutex_unlock(&log_descriptor.purger_lock); DBUG_RETURN(rc); }
O3
c
translog_purge_at_flush: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x268, %rsp # imm = 0x268 movq %fs:0x28, %rax movq %rax, -0x30(%rbp) xorl %ebx, %ebx cmpl $0x2, 0x3b2e88(%rip) # 0x3fbf50 je 0x491de cmpq $0x2, 0x3b2e62(%rip) # 0x3fbf38 jne 0x491de cmpq $0x0, 0xbb4f3c(%rip) # 0xbfe020 jne 0x49201 leaq 0xbb4eef(%rip), %rdi # 0xbfdfe0 callq 0x29210 cmpl $0x0, 0xbb4edb(%rip) # 0xbfdfd8 je 0x4920b cmpl $0x0, 0x3b2e26(%rip) # 0x3fbf30 jne 0x4920b callq 0x4720c movq %rax, %rdi movl $0x1, %esi callq 0x45694 cmpl 0xbb4eb0(%rip), %eax # 0xbfdfd8 jae 0x491bd movl %eax, %ebx leaq -0x230(%rbp), %r14 leaq 0x33bed2(%rip), %r13 # 0x385010 leaq -0x288(%rbp), %r15 leaq -0x240(%rbp), %r12 movl %ebx, %edi movq %r14, %rsi callq 0x43d75 leaq 0x3b2d47(%rip), %rax # 0x3fbea4 movl (%rax), %esi movq (%r13), %rax movq %r15, %rdi movl $0xe, %edx movq %r14, %rcx movq %r12, %r8 callq *0x148(%rax) movq %rax, -0x240(%rbp) testq %rax, %rax jne 0x491a0 movl $0x10, %esi movq %r14, %rdi callq 0x9d890 incl %ebx cmpl 0xbb4e40(%rip), %ebx # 0xbfdfd8 jae 0x491c1 testl %eax, %eax je 0x4914c jmp 0x491c1 movq %rax, %rdi movq %r14, %rsi movq %r12, %rdx leaq -0x234(%rbp), %rcx callq 0x2cc56 movl -0x234(%rbp), %eax jmp 0x49190 xorl %ebx, %ebx jmp 0x491c6 testl %eax, %eax setne %bl movq 0xbb4e53(%rip), %rdi # 0xbfe020 testq %rdi, %rdi jne 0x49214 leaq 0xbb4e07(%rip), %rdi # 0xbfdfe0 callq 0x291e0 movq %fs:0x28, %rax cmpq -0x30(%rbp), %rax jne 0x49226 movl %ebx, %eax addq $0x268, %rsp # imm = 0x268 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq callq 0x2cc39 jmp 0x490f6 callq 0x2ccad xorl %ebx, %ebx jmp 0x491de leaq 0x33bdf5(%rip), %rax # 0x385010 movq (%rax), %rax callq *0x160(%rax) jmp 0x491d2 callq 0x29260
translog_purge_at_flush: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 268h mov rax, fs:28h mov [rbp+var_30], rax xor ebx, ebx cmp cs:translog_status, 2 jz loc_491DE cmp cs:log_purge_type, 2 jnz loc_491DE cmp cs:qword_BFE020, 0 jnz loc_49201 lea rdi, unk_BFDFE0 call _pthread_mutex_lock loc_490F6: cmp dword ptr cs:qword_BFDFD8, 0 jz loc_4920B cmp cs:log_purge_disabled, 0 jnz loc_4920B call translog_get_horizon mov rdi, rax mov esi, 1 call translog_first_file cmp eax, dword ptr cs:qword_BFDFD8 jnb loc_491BD mov ebx, eax lea r14, [rbp+var_230] lea r13, PSI_server lea r15, [rbp+var_288] lea r12, [rbp+var_240] loc_4914C: mov edi, ebx mov rsi, r14 call translog_filename_by_fileno lea rax, key_file_translog mov esi, [rax] mov rax, [r13+0] mov rdi, r15 mov edx, 0Eh mov rcx, r14 mov r8, r12 call qword ptr [rax+148h] mov [rbp+var_240], rax test rax, rax jnz short loc_491A0 mov esi, 10h mov rdi, r14 call my_delete loc_49190: inc ebx cmp ebx, dword ptr cs:qword_BFDFD8 jnb short loc_491C1 test eax, eax jz short loc_4914C jmp short loc_491C1 loc_491A0: mov rdi, rax mov rsi, r14 mov rdx, r12 lea rcx, [rbp+var_234] call translog_purge_at_flush_cold_2 mov eax, [rbp+var_234] jmp short loc_49190 loc_491BD: xor ebx, ebx jmp short loc_491C6 loc_491C1: test eax, eax setnz bl loc_491C6: mov rdi, cs:qword_BFE020 test rdi, rdi jnz short loc_49214 loc_491D2: lea rdi, unk_BFDFE0 call _pthread_mutex_unlock loc_491DE: mov rax, fs:28h cmp rax, [rbp+var_30] jnz short loc_49226 mov eax, ebx add rsp, 268h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_49201: call translog_purge_at_flush_cold_1 jmp loc_490F6 loc_4920B: call translog_purge_at_flush_cold_3 xor ebx, ebx jmp short loc_491DE loc_49214: lea rax, PSI_server mov rax, [rax] call qword ptr [rax+160h] jmp short loc_491D2 loc_49226: call ___stack_chk_fail
long long translog_purge_at_flush() { unsigned int v0; // ebx unsigned long long horizon; // rax unsigned int file; // eax long long v3; // rdx long long v4; // rcx int v5; // r8d int v6; // r9d long long v7; // rax unsigned int v8; // eax _BYTE v10[72]; // [rsp+8h] [rbp-288h] BYREF long long v11; // [rsp+50h] [rbp-240h] BYREF unsigned int v12; // [rsp+5Ch] [rbp-234h] BYREF _BYTE v13[512]; // [rsp+60h] [rbp-230h] BYREF unsigned long long v14; // [rsp+260h] [rbp-30h] v14 = __readfsqword(0x28u); v0 = 0; if ( translog_status != 2 && log_purge_type == 2 ) { if ( qword_BFE020 ) translog_purge_at_flush_cold_1(); else pthread_mutex_lock(&unk_BFDFE0); if ( !(_DWORD)qword_BFDFD8 || log_purge_disabled ) { translog_purge_at_flush_cold_3(); return 0; } else { horizon = translog_get_horizon(); file = translog_first_file(horizon, 1); if ( file >= (unsigned int)qword_BFDFD8 ) { v0 = 0; } else { v0 = file; do { translog_filename_by_fileno(v0, (long long)v13, v3, v4, v5, v6); v7 = ((long long ( *)(_BYTE *, _QWORD, long long, _BYTE *, long long *))PSI_server[41])( v10, key_file_translog, 14LL, v13, &v11); v11 = v7; if ( v7 ) { translog_purge_at_flush_cold_2(v7, (long long)v13, &v11, &v12); v8 = v12; } else { v8 = my_delete(v13, 16LL); } ++v0; } while ( v0 < (unsigned int)qword_BFDFD8 && !v8 ); LOBYTE(v0) = v8 != 0; } if ( qword_BFE020 ) PSI_server[44](); pthread_mutex_unlock(&unk_BFDFE0); } } return v0; }
translog_purge_at_flush: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x268 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RBP + -0x30],RAX XOR EBX,EBX CMP dword ptr [0x004fbf50],0x2 JZ 0x001491de CMP qword ptr [0x004fbf38],0x2 JNZ 0x001491de CMP qword ptr [0x00cfe020],0x0 JNZ 0x00149201 LEA RDI,[0xcfdfe0] CALL 0x00129210 LAB_001490f6: CMP dword ptr [0x00cfdfd8],0x0 JZ 0x0014920b CMP dword ptr [0x004fbf30],0x0 JNZ 0x0014920b CALL 0x0014720c MOV RDI,RAX MOV ESI,0x1 CALL 0x00145694 CMP EAX,dword ptr [0x00cfdfd8] JNC 0x001491bd MOV EBX,EAX LEA R14,[RBP + -0x230] LEA R13,[0x485010] LEA R15,[RBP + -0x288] LEA R12,[RBP + -0x240] LAB_0014914c: MOV EDI,EBX MOV RSI,R14 CALL 0x00143d75 LEA RAX,[0x4fbea4] MOV ESI,dword ptr [RAX] MOV RAX,qword ptr [R13] MOV RDI,R15 MOV EDX,0xe MOV RCX,R14 MOV R8,R12 CALL qword ptr [RAX + 0x148] MOV qword ptr [RBP + -0x240],RAX TEST RAX,RAX JNZ 0x001491a0 MOV ESI,0x10 MOV RDI,R14 CALL 0x0019d890 LAB_00149190: INC EBX CMP EBX,dword ptr [0x00cfdfd8] JNC 0x001491c1 TEST EAX,EAX JZ 0x0014914c JMP 0x001491c1 LAB_001491a0: MOV RDI,RAX MOV RSI,R14 MOV RDX,R12 LEA RCX,[RBP + -0x234] CALL 0x0012cc56 MOV EAX,dword ptr [RBP + -0x234] JMP 0x00149190 LAB_001491bd: XOR EBX,EBX JMP 0x001491c6 LAB_001491c1: TEST EAX,EAX SETNZ BL LAB_001491c6: MOV RDI,qword ptr [0x00cfe020] TEST RDI,RDI JNZ 0x00149214 LAB_001491d2: LEA RDI,[0xcfdfe0] CALL 0x001291e0 LAB_001491de: MOV RAX,qword ptr FS:[0x28] CMP RAX,qword ptr [RBP + -0x30] JNZ 0x00149226 MOV EAX,EBX ADD RSP,0x268 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_00149201: CALL 0x0012cc39 JMP 0x001490f6 LAB_0014920b: CALL 0x0012ccad XOR EBX,EBX JMP 0x001491de LAB_00149214: LEA RAX,[0x485010] MOV RAX,qword ptr [RAX] CALL qword ptr [RAX + 0x160] JMP 0x001491d2 LAB_00149226: CALL 0x00129260
int4 translog_purge_at_flush(void) { uint uVar1; int iVar2; int8 uVar3; int4 uVar4; long in_FS_OFFSET; int1 local_290 [72]; long local_248; int local_23c; int1 local_238 [512]; long local_38; local_38 = *(long *)(in_FS_OFFSET + 0x28); uVar4 = 0; if ((translog_status != 2) && (log_purge_type == 2)) { if (DAT_00cfe020 == 0) { pthread_mutex_lock((pthread_mutex_t *)&DAT_00cfdfe0); } else { translog_purge_at_flush_cold_1(); } if ((DAT_00cfdfd8 == 0) || (log_purge_disabled != 0)) { translog_purge_at_flush_cold_3(); uVar4 = 0; } else { uVar3 = translog_get_horizon(); uVar1 = translog_first_file(uVar3,1); if (uVar1 < DAT_00cfdfd8) { do { translog_filename_by_fileno(uVar1,local_238); local_248 = (**(code **)(PSI_server + 0x148)) (local_290,key_file_translog,0xe,local_238,&local_248); if (local_248 == 0) { iVar2 = my_delete(local_238,0x10); } else { translog_purge_at_flush_cold_2(local_248,local_238,&local_248,&local_23c); iVar2 = local_23c; } uVar1 = uVar1 + 1; } while ((uVar1 < DAT_00cfdfd8) && (iVar2 == 0)); uVar4 = CONCAT31((int3)(uVar1 >> 8),iVar2 != 0); } else { uVar4 = 0; } if (DAT_00cfe020 != 0) { (**(code **)(PSI_server + 0x160))(); } pthread_mutex_unlock((pthread_mutex_t *)&DAT_00cfdfe0); } } if (*(long *)(in_FS_OFFSET + 0x28) != local_38) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return uVar4; }
2,912
skip_trailing_space
eloqsql/strings/strings_def.h
static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) { const uchar *end= ptr + len; if (len > 20) { const uchar *end_words= (const uchar *)(intptr) (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT); const uchar *start_words= (const uchar *)(intptr) ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT); DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT); if (end_words > ptr) { while (end > end_words && end[-1] == 0x20) end--; if (end[-1] == 0x20 && start_words < end_words) while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT) end -= SIZEOF_INT; } } while (end > ptr && end[-1] == 0x20) end--; return (end); }
O0
c
skip_trailing_space: pushq %rbp movq %rsp, %rbp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rax addq -0x10(%rbp), %rax movq %rax, -0x18(%rbp) cmpq $0x14, -0x10(%rbp) jbe 0x4341a movq -0x18(%rbp), %rax shrq $0x2, %rax shlq $0x2, %rax movq %rax, -0x20(%rbp) movq -0x8(%rbp), %rax addq $0x4, %rax subq $0x1, %rax shrq $0x2, %rax shlq $0x2, %rax movq %rax, -0x28(%rbp) jmp 0x4337d movq -0x20(%rbp), %rax cmpq -0x8(%rbp), %rax jbe 0x43418 jmp 0x4338d movq -0x18(%rbp), %rcx xorl %eax, %eax cmpq -0x20(%rbp), %rcx movb %al, -0x29(%rbp) jbe 0x433ad movq -0x18(%rbp), %rax movzbl -0x1(%rax), %eax cmpl $0x20, %eax sete %al movb %al, -0x29(%rbp) movb -0x29(%rbp), %al testb $0x1, %al jne 0x433b6 jmp 0x433c4 movq -0x18(%rbp), %rax addq $-0x1, %rax movq %rax, -0x18(%rbp) jmp 0x4338d movq -0x18(%rbp), %rax movzbl -0x1(%rax), %eax cmpl $0x20, %eax jne 0x43416 movq -0x28(%rbp), %rax cmpq -0x20(%rbp), %rax jae 0x43416 jmp 0x433dd movq -0x18(%rbp), %rcx xorl %eax, %eax cmpq -0x28(%rbp), %rcx movb %al, -0x2a(%rbp) jbe 0x433fd movq -0x18(%rbp), %rax cmpl $0x20202020, -0x4(%rax) # imm = 0x20202020 sete %al movb %al, -0x2a(%rbp) movb -0x2a(%rbp), %al testb $0x1, %al jne 0x43406 jmp 0x43414 movq -0x18(%rbp), %rax addq $-0x4, %rax movq %rax, -0x18(%rbp) jmp 0x433dd jmp 0x43416 jmp 0x43418 jmp 0x4341a jmp 0x4341c movq -0x18(%rbp), %rcx xorl %eax, %eax cmpq -0x8(%rbp), %rcx movb %al, -0x2b(%rbp) jbe 0x4343c movq -0x18(%rbp), %rax movzbl -0x1(%rax), %eax cmpl $0x20, %eax sete %al movb %al, -0x2b(%rbp) movb -0x2b(%rbp), %al testb $0x1, %al jne 0x43445 jmp 0x43453 movq -0x18(%rbp), %rax addq $-0x1, %rax movq %rax, -0x18(%rbp) jmp 0x4341c movq -0x18(%rbp), %rax popq %rbp retq nopl (%rax)
skip_trailing_space_1: push rbp mov rbp, rsp mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov rax, [rbp+var_8] add rax, [rbp+var_10] mov [rbp+var_18], rax cmp [rbp+var_10], 14h jbe loc_4341A mov rax, [rbp+var_18] shr rax, 2 shl rax, 2 mov [rbp+var_20], rax mov rax, [rbp+var_8] add rax, 4 sub rax, 1 shr rax, 2 shl rax, 2 mov [rbp+var_28], rax jmp short $+2 loc_4337D: mov rax, [rbp+var_20] cmp rax, [rbp+var_8] jbe loc_43418 jmp short $+2 loc_4338D: mov rcx, [rbp+var_18] xor eax, eax cmp rcx, [rbp+var_20] mov [rbp+var_29], al jbe short loc_433AD mov rax, [rbp+var_18] movzx eax, byte ptr [rax-1] cmp eax, 20h ; ' ' setz al mov [rbp+var_29], al loc_433AD: mov al, [rbp+var_29] test al, 1 jnz short loc_433B6 jmp short loc_433C4 loc_433B6: mov rax, [rbp+var_18] add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_18], rax jmp short loc_4338D loc_433C4: mov rax, [rbp+var_18] movzx eax, byte ptr [rax-1] cmp eax, 20h ; ' ' jnz short loc_43416 mov rax, [rbp+var_28] cmp rax, [rbp+var_20] jnb short loc_43416 jmp short $+2 loc_433DD: mov rcx, [rbp+var_18] xor eax, eax cmp rcx, [rbp+var_28] mov [rbp+var_2A], al jbe short loc_433FD mov rax, [rbp+var_18] cmp dword ptr [rax-4], 20202020h setz al mov [rbp+var_2A], al loc_433FD: mov al, [rbp+var_2A] test al, 1 jnz short loc_43406 jmp short loc_43414 loc_43406: mov rax, [rbp+var_18] add rax, 0FFFFFFFFFFFFFFFCh mov [rbp+var_18], rax jmp short loc_433DD loc_43414: jmp short $+2 loc_43416: jmp short $+2 loc_43418: jmp short $+2 loc_4341A: jmp short $+2 loc_4341C: mov rcx, [rbp+var_18] xor eax, eax cmp rcx, [rbp+var_8] mov [rbp+var_2B], al jbe short loc_4343C mov rax, [rbp+var_18] movzx eax, byte ptr [rax-1] cmp eax, 20h ; ' ' setz al mov [rbp+var_2B], al loc_4343C: mov al, [rbp+var_2B] test al, 1 jnz short loc_43445 jmp short loc_43453 loc_43445: mov rax, [rbp+var_18] add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_18], rax jmp short loc_4341C loc_43453: mov rax, [rbp+var_18] pop rbp retn
unsigned long long skip_trailing_space_1(unsigned long long a1, unsigned long long a2) { bool v3; // [rsp+1h] [rbp-2Bh] bool v4; // [rsp+2h] [rbp-2Ah] bool v5; // [rsp+3h] [rbp-29h] unsigned long long v6; // [rsp+4h] [rbp-28h] unsigned long long v7; // [rsp+Ch] [rbp-20h] unsigned long long v8; // [rsp+14h] [rbp-18h] v8 = a2 + a1; if ( a2 > 0x14 ) { v7 = 4 * (v8 >> 2); v6 = 4 * ((a1 + 3) >> 2); if ( v7 > a1 ) { while ( 1 ) { v5 = 0; if ( v8 > v7 ) v5 = *(_BYTE *)(v8 - 1) == 32; if ( !v5 ) break; --v8; } if ( *(_BYTE *)(v8 - 1) == 32 && v6 < v7 ) { while ( 1 ) { v4 = 0; if ( v8 > v6 ) v4 = *(_DWORD *)(v8 - 4) == 538976288; if ( !v4 ) break; v8 -= 4LL; } } } } while ( 1 ) { v3 = 0; if ( v8 > a1 ) v3 = *(_BYTE *)(v8 - 1) == 32; if ( !v3 ) break; --v8; } return v8; }
skip_trailing_space: PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV RAX,qword ptr [RBP + -0x8] ADD RAX,qword ptr [RBP + -0x10] MOV qword ptr [RBP + -0x18],RAX CMP qword ptr [RBP + -0x10],0x14 JBE 0x0014341a MOV RAX,qword ptr [RBP + -0x18] SHR RAX,0x2 SHL RAX,0x2 MOV qword ptr [RBP + -0x20],RAX MOV RAX,qword ptr [RBP + -0x8] ADD RAX,0x4 SUB RAX,0x1 SHR RAX,0x2 SHL RAX,0x2 MOV qword ptr [RBP + -0x28],RAX JMP 0x0014337d LAB_0014337d: MOV RAX,qword ptr [RBP + -0x20] CMP RAX,qword ptr [RBP + -0x8] JBE 0x00143418 JMP 0x0014338d LAB_0014338d: MOV RCX,qword ptr [RBP + -0x18] XOR EAX,EAX CMP RCX,qword ptr [RBP + -0x20] MOV byte ptr [RBP + -0x29],AL JBE 0x001433ad MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + -0x1] CMP EAX,0x20 SETZ AL MOV byte ptr [RBP + -0x29],AL LAB_001433ad: MOV AL,byte ptr [RBP + -0x29] TEST AL,0x1 JNZ 0x001433b6 JMP 0x001433c4 LAB_001433b6: MOV RAX,qword ptr [RBP + -0x18] ADD RAX,-0x1 MOV qword ptr [RBP + -0x18],RAX JMP 0x0014338d LAB_001433c4: MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + -0x1] CMP EAX,0x20 JNZ 0x00143416 MOV RAX,qword ptr [RBP + -0x28] CMP RAX,qword ptr [RBP + -0x20] JNC 0x00143416 JMP 0x001433dd LAB_001433dd: MOV RCX,qword ptr [RBP + -0x18] XOR EAX,EAX CMP RCX,qword ptr [RBP + -0x28] MOV byte ptr [RBP + -0x2a],AL JBE 0x001433fd MOV RAX,qword ptr [RBP + -0x18] CMP dword ptr [RAX + -0x4],0x20202020 SETZ AL MOV byte ptr [RBP + -0x2a],AL LAB_001433fd: MOV AL,byte ptr [RBP + -0x2a] TEST AL,0x1 JNZ 0x00143406 JMP 0x00143414 LAB_00143406: MOV RAX,qword ptr [RBP + -0x18] ADD RAX,-0x4 MOV qword ptr [RBP + -0x18],RAX JMP 0x001433dd LAB_00143414: JMP 0x00143416 LAB_00143416: JMP 0x00143418 LAB_00143418: JMP 0x0014341a LAB_0014341a: JMP 0x0014341c LAB_0014341c: MOV RCX,qword ptr [RBP + -0x18] XOR EAX,EAX CMP RCX,qword ptr [RBP + -0x8] MOV byte ptr [RBP + -0x2b],AL JBE 0x0014343c MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + -0x1] CMP EAX,0x20 SETZ AL MOV byte ptr [RBP + -0x2b],AL LAB_0014343c: MOV AL,byte ptr [RBP + -0x2b] TEST AL,0x1 JNZ 0x00143445 JMP 0x00143453 LAB_00143445: MOV RAX,qword ptr [RBP + -0x18] ADD RAX,-0x1 MOV qword ptr [RBP + -0x18],RAX JMP 0x0014341c LAB_00143453: MOV RAX,qword ptr [RBP + -0x18] POP RBP RET
ulong skip_trailing_space(ulong param_1,ulong param_2) { ulong uVar1; ulong uVar2; bool bVar3; ulong local_20; local_20 = param_1 + param_2; if (0x14 < param_2) { uVar1 = local_20 & 0xfffffffffffffffc; uVar2 = param_1 + 3 & 0xfffffffffffffffc; if (param_1 < uVar1) { while( true ) { bVar3 = false; if (uVar1 < local_20) { bVar3 = *(char *)(local_20 - 1) == ' '; } if (!bVar3) break; local_20 = local_20 - 1; } if ((*(char *)(local_20 - 1) == ' ') && (uVar2 < uVar1)) { while( true ) { bVar3 = false; if (uVar2 < local_20) { bVar3 = *(int *)(local_20 - 4) == 0x20202020; } if (!bVar3) break; local_20 = local_20 - 4; } } } } while( true ) { bVar3 = false; if (param_1 < local_20) { bVar3 = *(char *)(local_20 - 1) == ' '; } if (!bVar3) break; local_20 = local_20 - 1; } return local_20; }
2,913
common_log_entry::print(_IO_FILE*) const
monkey531[P]llama/common/log.cpp
void print(FILE * file = nullptr) const { FILE * fcur = file; if (!fcur) { // stderr displays DBG messages only when their verbosity level is not higher than the threshold // these messages will still be logged to a file if (level == GGML_LOG_LEVEL_DEBUG && common_log_verbosity_thold < LOG_DEFAULT_DEBUG) { return; } fcur = stdout; if (level != GGML_LOG_LEVEL_NONE) { fcur = stderr; } } if (level != GGML_LOG_LEVEL_NONE && level != GGML_LOG_LEVEL_CONT && prefix) { if (timestamp) { // [M.s.ms.us] fprintf(fcur, "%s%d.%02d.%03d.%03d%s ", g_col[COMMON_LOG_COL_BLUE], (int) (timestamp / 1000000 / 60), (int) (timestamp / 1000000 % 60), (int) (timestamp / 1000 % 1000), (int) (timestamp % 1000), g_col[COMMON_LOG_COL_DEFAULT]); } switch (level) { case GGML_LOG_LEVEL_INFO: fprintf(fcur, "%sI %s", g_col[COMMON_LOG_COL_GREEN], g_col[COMMON_LOG_COL_DEFAULT]); break; case GGML_LOG_LEVEL_WARN: fprintf(fcur, "%sW %s", g_col[COMMON_LOG_COL_MAGENTA], "" ); break; case GGML_LOG_LEVEL_ERROR: fprintf(fcur, "%sE %s", g_col[COMMON_LOG_COL_RED], "" ); break; case GGML_LOG_LEVEL_DEBUG: fprintf(fcur, "%sD %s", g_col[COMMON_LOG_COL_YELLOW], "" ); break; default: break; } } fprintf(fcur, "%s", msg.data()); if (level == GGML_LOG_LEVEL_WARN || level == GGML_LOG_LEVEL_ERROR || level == GGML_LOG_LEVEL_DEBUG) { fprintf(fcur, "%s", g_col[COMMON_LOG_COL_DEFAULT]); } fflush(fcur); }
O3
cpp
common_log_entry::print(_IO_FILE*) const: pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %rbx movl (%rdi), %eax testq %rsi, %rsi jne 0x8624c cmpl $0x1, %eax jne 0x86235 leaq 0x6add6(%rip), %rcx # 0xf1000 cmpl $0x0, (%rcx) jg 0x86235 popq %rbx popq %r14 popq %r15 retq testl %eax, %eax jne 0x86242 movq 0x69cf8(%rip), %rcx # 0xeff38 jmp 0x86249 movq 0x69d5f(%rip), %rcx # 0xeffa8 movq (%rcx), %r14 testl %eax, %eax je 0x863c9 cmpl $0x5, %eax je 0x863c9 cmpb $0x1, 0x4(%rbx) jne 0x863c9 movq 0x8(%rbx), %r10 testq %r10, %r10 je 0x86350 movq 0x6ad8d(%rip), %r15 # 0xf1008 movq 0x28(%r15), %r9 movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB movq %r10, %rax imulq %rcx movq %rdx, %rcx movq %rdx, %r8 shrq $0x3f, %r8 sarq $0x12, %rcx movabsq $-0x70d59cc6bc5928d7, %rdx # imm = 0x8F2A633943A6D729 movq %r10, %rax imulq %rdx addq %rcx, %r8 leaq (%rdx,%r10), %rcx movq %rcx, %rax shrq $0x3f, %rax shrq $0x19, %rcx addl %eax, %ecx movabsq $-0x7777777777777777, %rdx # imm = 0x8888888888888889 movq %r8, %rax imulq %rdx addq %r8, %rdx movq %rdx, %rax shrq $0x3f, %rax shrq $0x5, %rdx addl %eax, %edx imull $0x3c, %edx, %eax subl %eax, %r8d movabsq $0x20c49ba5e353f7cf, %rsi # imm = 0x20C49BA5E353F7CF movq %r10, %rax imulq %rsi movq %rdx, %r11 movq %rdx, %rax shrq $0x3f, %rax sarq $0x7, %r11 addq %rax, %r11 movq %r11, %rax imulq %rsi movq %rdx, %rax shrq $0x3f, %rax shrq $0x7, %rdx addl %eax, %edx imull $0x3e8, %edx, %eax # imm = 0x3E8 imull $0x3e8, %r11d, %edx # imm = 0x3E8 subl %eax, %r11d subl %edx, %r10d leaq 0x3b26f(%rip), %rsi # 0xc15a4 movq %r14, %rdi movq %r9, %rdx movl %r11d, %r9d xorl %eax, %eax pushq (%r15) pushq %r10 callq 0x18980 addq $0x10, %rsp movl (%rbx), %eax decl %eax cmpl $0x3, %eax ja 0x863c9 leaq 0x3b236(%rip), %rcx # 0xc1594 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movq 0x6ac9a(%rip), %rax # 0xf1008 movq 0x20(%rax), %rdx leaq 0x3b257(%rip), %rsi # 0xc15d0 jmp 0x863a1 movq 0x6ac86(%rip), %rax # 0xf1008 movq 0x30(%rax), %rdx leaq 0x3b235(%rip), %rsi # 0xc15c2 jmp 0x863a1 movq 0x6ac72(%rip), %rax # 0xf1008 movq 0x10(%rax), %rdx leaq 0x3b228(%rip), %rsi # 0xc15c9 leaq 0x2f093(%rip), %rcx # 0xb543b jmp 0x863bf movq 0x6ac57(%rip), %rax # 0xf1008 movq (%rax), %rcx movq 0x18(%rax), %rdx leaq 0x3b1fc(%rip), %rsi # 0xc15bb movq %r14, %rdi xorl %eax, %eax callq 0x18980 movq 0x10(%rbx), %rdi movq %r14, %rsi callq 0x18740 movl (%rbx), %eax cmpl $0x4, %eax ja 0x863f8 movl $0x1a, %ecx btl %eax, %ecx jae 0x863f8 movq 0x6ac1b(%rip), %rax # 0xf1008 movq (%rax), %rdi movq %r14, %rsi callq 0x18740 movq %r14, %rdi popq %rbx popq %r14 popq %r15 jmp 0x187b0 nop
_ZNK16common_log_entry5printEP8_IO_FILE: push r15 push r14 push rbx mov r14, rsi mov rbx, rdi mov eax, [rdi] test rsi, rsi jnz short loc_8624C cmp eax, 1 jnz short loc_86235 lea rcx, common_log_verbosity_thold cmp dword ptr [rcx], 0 jg short loc_86235 pop rbx pop r14 pop r15 retn loc_86235: test eax, eax jnz short loc_86242 mov rcx, cs:stdout_ptr jmp short loc_86249 loc_86242: mov rcx, cs:stderr_ptr loc_86249: mov r14, [rcx] loc_8624C: test eax, eax jz def_86365; jumptable 0000000000086365 default case cmp eax, 5 jz def_86365; jumptable 0000000000086365 default case cmp byte ptr [rbx+4], 1 jnz def_86365; jumptable 0000000000086365 default case mov r10, [rbx+8] test r10, r10 jz loc_86350 mov r15, cs:_ZL5g_col; g_col mov r9, [r15+28h] mov rcx, 431BDE82D7B634DBh mov rax, r10 imul rcx mov rcx, rdx mov r8, rdx shr r8, 3Fh sar rcx, 12h mov rdx, 8F2A633943A6D729h mov rax, r10 imul rdx add r8, rcx lea rcx, [rdx+r10] mov rax, rcx shr rax, 3Fh shr rcx, 19h add ecx, eax mov rdx, 8888888888888889h mov rax, r8 imul rdx add rdx, r8 mov rax, rdx shr rax, 3Fh shr rdx, 5 add edx, eax imul eax, edx, 3Ch ; '<' sub r8d, eax mov rsi, 20C49BA5E353F7CFh mov rax, r10 imul rsi mov r11, rdx mov rax, rdx shr rax, 3Fh sar r11, 7 add r11, rax mov rax, r11 imul rsi mov rax, rdx shr rax, 3Fh shr rdx, 7 add edx, eax imul eax, edx, 3E8h imul edx, r11d, 3E8h sub r11d, eax sub r10d, edx lea rsi, aSD02d03d03dS; "%s%d.%02d.%03d.%03d%s " mov rdi, r14 mov rdx, r9 mov r9d, r11d xor eax, eax push qword ptr [r15] push r10 call _fprintf add rsp, 10h mov eax, [rbx] loc_86350: dec eax; switch 4 cases cmp eax, 3 ja short def_86365; jumptable 0000000000086365 default case lea rcx, jpt_86365 movsxd rax, ds:(jpt_86365 - 0C1594h)[rcx+rax*4] add rax, rcx jmp rax; switch jump loc_86367: mov rax, cs:_ZL5g_col; jumptable 0000000000086365 case 1 mov rdx, [rax+20h] lea rsi, aSdS; "%sD %s" jmp short loc_863A1 loc_8637B: mov rax, cs:_ZL5g_col; jumptable 0000000000086365 case 3 mov rdx, [rax+30h] lea rsi, aSwS; "%sW %s" jmp short loc_863A1 loc_8638F: mov rax, cs:_ZL5g_col; jumptable 0000000000086365 case 4 mov rdx, [rax+10h] lea rsi, aSeS; "%sE %s" loc_863A1: lea rcx, aSJinja+16h; "" jmp short loc_863BF loc_863AA: mov rax, cs:_ZL5g_col; jumptable 0000000000086365 case 2 mov rcx, [rax] mov rdx, [rax+18h] lea rsi, aSiS; "%sI %s" loc_863BF: mov rdi, r14 xor eax, eax call _fprintf def_86365: mov rdi, [rbx+10h]; jumptable 0000000000086365 default case mov rsi, r14 call _fputs mov eax, [rbx] cmp eax, 4 ja short loc_863F8 mov ecx, 1Ah bt ecx, eax jnb short loc_863F8 mov rax, cs:_ZL5g_col; g_col mov rdi, [rax] mov rsi, r14 call _fputs loc_863F8: mov rdi, r14 pop rbx pop r14 pop r15 jmp _fflush
long long common_log_entry::print(unsigned int *a1, long long a2) { long long v2; // r14 long long result; // rax long long *v4; // rcx long long v5; // r10 long long v6; // rdx const char *v7; // rsi char *v8; // rcx int v9; // ecx v2 = a2; result = *a1; if ( !a2 ) { if ( (_DWORD)result == 1 && common_log_verbosity_thold[0] <= 0 ) return result; if ( (_DWORD)result ) v4 = (long long *)&stderr; else v4 = (long long *)&stdout; v2 = *v4; } if ( (_DWORD)result && (_DWORD)result != 5 && *((_BYTE *)a1 + 4) == 1 ) { v5 = *((_QWORD *)a1 + 1); if ( v5 ) { fprintf( v2, "%s%d.%02d.%03d.%03d%s ", *(const char **)(g_col + 40), (int)v5 / 60000000, (int)(v5 / 1000000) % 60, (int)(v5 / 1000) % 1000, v5 % 1000, *(const char **)g_col); LODWORD(result) = *a1; } switch ( (int)result ) { case 1: v6 = *(_QWORD *)(g_col + 32); v7 = "%sD %s"; goto LABEL_17; case 2: v8 = *(char **)g_col; v6 = *(_QWORD *)(g_col + 24); v7 = "%sI %s"; goto LABEL_19; case 3: v6 = *(_QWORD *)(g_col + 48); v7 = "%sW %s"; goto LABEL_17; case 4: v6 = *(_QWORD *)(g_col + 16); v7 = "%sE %s"; LABEL_17: v8 = ""; LABEL_19: fprintf(v2, v7, v6, v8); break; default: break; } } fputs(*((_QWORD *)a1 + 2), v2); if ( *a1 <= 4 ) { v9 = 26; if ( _bittest(&v9, *a1) ) fputs(*(_QWORD *)g_col, v2); } return fflush(v2); }
print: PUSH R15 PUSH R14 PUSH RBX MOV R14,RSI MOV RBX,RDI MOV EAX,dword ptr [RDI] TEST RSI,RSI JNZ 0x0018624c CMP EAX,0x1 JNZ 0x00186235 LEA RCX,[0x1f1000] CMP dword ptr [RCX],0x0 JG 0x00186235 POP RBX POP R14 POP R15 RET LAB_00186235: TEST EAX,EAX JNZ 0x00186242 MOV RCX,qword ptr [0x001eff38] JMP 0x00186249 LAB_00186242: MOV RCX,qword ptr [0x001effa8] LAB_00186249: MOV R14,qword ptr [RCX] LAB_0018624c: TEST EAX,EAX JZ 0x001863c9 CMP EAX,0x5 JZ 0x001863c9 CMP byte ptr [RBX + 0x4],0x1 JNZ 0x001863c9 MOV R10,qword ptr [RBX + 0x8] TEST R10,R10 JZ 0x00186350 MOV R15,qword ptr [0x001f1008] MOV R9,qword ptr [R15 + 0x28] MOV RCX,0x431bde82d7b634db MOV RAX,R10 IMUL RCX MOV RCX,RDX MOV R8,RDX SHR R8,0x3f SAR RCX,0x12 MOV RDX,-0x70d59cc6bc5928d7 MOV RAX,R10 IMUL RDX ADD R8,RCX LEA RCX,[RDX + R10*0x1] MOV RAX,RCX SHR RAX,0x3f SHR RCX,0x19 ADD ECX,EAX MOV RDX,-0x7777777777777777 MOV RAX,R8 IMUL RDX ADD RDX,R8 MOV RAX,RDX SHR RAX,0x3f SHR RDX,0x5 ADD EDX,EAX IMUL EAX,EDX,0x3c SUB R8D,EAX MOV RSI,0x20c49ba5e353f7cf MOV RAX,R10 IMUL RSI MOV R11,RDX MOV RAX,RDX SHR RAX,0x3f SAR R11,0x7 ADD R11,RAX MOV RAX,R11 IMUL RSI MOV RAX,RDX SHR RAX,0x3f SHR RDX,0x7 ADD EDX,EAX IMUL EAX,EDX,0x3e8 IMUL EDX,R11D,0x3e8 SUB R11D,EAX SUB R10D,EDX LEA RSI,[0x1c15a4] MOV RDI,R14 MOV RDX,R9 MOV R9D,R11D XOR EAX,EAX PUSH qword ptr [R15] PUSH R10 CALL 0x00118980 ADD RSP,0x10 MOV EAX,dword ptr [RBX] LAB_00186350: DEC EAX CMP EAX,0x3 JA 0x001863c9 LEA RCX,[0x1c1594] MOVSXD RAX,dword ptr [RCX + RAX*0x4] ADD RAX,RCX switchD: JMP RAX caseD_1: MOV RAX,qword ptr [0x001f1008] MOV RDX,qword ptr [RAX + 0x20] LEA RSI,[0x1c15d0] JMP 0x001863a1 caseD_3: MOV RAX,qword ptr [0x001f1008] MOV RDX,qword ptr [RAX + 0x30] LEA RSI,[0x1c15c2] JMP 0x001863a1 caseD_4: MOV RAX,qword ptr [0x001f1008] MOV RDX,qword ptr [RAX + 0x10] LEA RSI,[0x1c15c9] LAB_001863a1: LEA RCX,[0x1b543b] JMP 0x001863bf caseD_2: MOV RAX,qword ptr [0x001f1008] MOV RCX,qword ptr [RAX] MOV RDX,qword ptr [RAX + 0x18] LEA RSI,[0x1c15bb] LAB_001863bf: MOV RDI,R14 XOR EAX,EAX CALL 0x00118980 default: MOV RDI,qword ptr [RBX + 0x10] MOV RSI,R14 CALL 0x00118740 MOV EAX,dword ptr [RBX] CMP EAX,0x4 JA 0x001863f8 MOV ECX,0x1a BT ECX,EAX JNC 0x001863f8 MOV RAX,qword ptr [0x001f1008] MOV RDI,qword ptr [RAX] MOV RSI,R14 CALL 0x00118740 LAB_001863f8: MOV RDI,R14 POP RBX POP R14 POP R15 JMP 0x001187b0
/* common_log_entry::print(_IO_FILE*) const */ void __thiscall common_log_entry::print(common_log_entry *this,_IO_FILE *param_1) { long lVar1; int1 auVar2 [16]; int1 auVar3 [16]; int8 *puVar4; char *pcVar5; int8 uVar6; char *__format; int iVar7; iVar7 = *(int *)this; if (param_1 == (_IO_FILE *)0x0) { if ((iVar7 == 1) && (common_log_verbosity_thold < 1)) { return; } puVar4 = (int8 *)PTR_stderr_001effa8; if (iVar7 == 0) { puVar4 = (int8 *)PTR_stdout_001eff38; } param_1 = (_IO_FILE *)*puVar4; } if (((iVar7 == 0) || (iVar7 == 5)) || (this[4] != (common_log_entry)0x1)) goto switchD_00186365_default; lVar1 = *(long *)(this + 8); if (lVar1 != 0) { auVar3 = SEXT816(lVar1 / 1000000) * ZEXT816(0x8888888888888889); auVar2 = SEXT816(lVar1 / 1000) * SEXT816(0x20c49ba5e353f7cf); iVar7 = (int)(lVar1 / 1000); fprintf(param_1,"%s%d.%02d.%03d.%03d%s ",g_col[5], (ulong)(uint)((int)(SUB168(SEXT816(lVar1) * ZEXT816(0x8f2a633943a6d729),8) >> 0x19) - (SUB164(SEXT816(lVar1) * ZEXT816(0x8f2a633943a6d729),0xc) >> 0x1f)), (ulong)(uint)((int)(lVar1 / 1000000) + ((int)(auVar3._8_8_ >> 5) - (auVar3._12_4_ >> 0x1f)) * -0x3c), (ulong)(uint)(iVar7 + ((int)(auVar2._8_8_ >> 7) - (auVar2._12_4_ >> 0x1f)) * -1000), (ulong)(uint)((int)lVar1 + iVar7 * -1000),*g_col); iVar7 = *(int *)this; } switch(iVar7) { case 1: uVar6 = g_col[4]; __format = "%sD %s"; break; case 2: pcVar5 = (char *)*g_col; uVar6 = g_col[3]; __format = "%sI %s"; goto LAB_001863bf; case 3: uVar6 = g_col[6]; __format = "%sW %s"; break; case 4: uVar6 = g_col[2]; __format = "%sE %s"; break; default: goto switchD_00186365_default; } pcVar5 = ""; LAB_001863bf: fprintf(param_1,__format,uVar6,pcVar5); switchD_00186365_default: fputs(*(char **)(this + 0x10),param_1); if ((*(uint *)this < 5) && ((0x1aU >> (*(uint *)this & 0x1f) & 1) != 0)) { fputs((char *)*g_col,param_1); } fflush(param_1); return; }
2,914
is_sub_path(char const*, unsigned long, char const*)
eloqsql/client/mysqltest.cc
bool is_sub_path(const char *path, size_t plen, const char *sandbox) { size_t len= strlen(sandbox); if (!sandbox || !len || plen <= len || memcmp(path, sandbox, len - 1) || path[len] != '/') return false; return true; }
O0
cpp
is_sub_path(char const*, unsigned long, char const*): pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq -0x20(%rbp), %rdi callq 0x60460 movq %rax, -0x28(%rbp) cmpq $0x0, -0x20(%rbp) je 0x673d4 cmpq $0x0, -0x28(%rbp) je 0x673d4 movq -0x18(%rbp), %rax cmpq -0x28(%rbp), %rax jbe 0x673d4 movq -0x10(%rbp), %rdi movq -0x20(%rbp), %rsi movq -0x28(%rbp), %rdx subq $0x1, %rdx callq 0x60cf0 cmpl $0x0, %eax jne 0x673d4 movq -0x10(%rbp), %rax movq -0x28(%rbp), %rcx movsbl (%rax,%rcx), %eax cmpl $0x2f, %eax je 0x673da movb $0x0, -0x1(%rbp) jmp 0x673de movb $0x1, -0x1(%rbp) movb -0x1(%rbp), %al andb $0x1, %al addq $0x30, %rsp popq %rbp retq nopl (%rax)
_Z11is_sub_pathPKcmS0_: push rbp mov rbp, rsp sub rsp, 30h mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov [rbp+var_20], rdx mov rdi, [rbp+var_20] call _strlen mov [rbp+var_28], rax cmp [rbp+var_20], 0 jz short loc_673D4 cmp [rbp+var_28], 0 jz short loc_673D4 mov rax, [rbp+var_18] cmp rax, [rbp+var_28] jbe short loc_673D4 mov rdi, [rbp+var_10] mov rsi, [rbp+var_20] mov rdx, [rbp+var_28] sub rdx, 1 call _memcmp cmp eax, 0 jnz short loc_673D4 mov rax, [rbp+var_10] mov rcx, [rbp+var_28] movsx eax, byte ptr [rax+rcx] cmp eax, 2Fh ; '/' jz short loc_673DA loc_673D4: mov [rbp+var_1], 0 jmp short loc_673DE loc_673DA: mov [rbp+var_1], 1 loc_673DE: mov al, [rbp+var_1] and al, 1 add rsp, 30h pop rbp retn
bool is_sub_path(const char *a1, unsigned long long a2, const char *a3) { unsigned long long v4; // [rsp+8h] [rbp-28h] v4 = strlen(a3); return a3 && v4 && a2 > v4 && !(unsigned int)memcmp(a1, a3, v4 - 1) && a1[v4] == 47; }
is_sub_path: PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV qword ptr [RBP + -0x20],RDX MOV RDI,qword ptr [RBP + -0x20] CALL 0x00160460 MOV qword ptr [RBP + -0x28],RAX CMP qword ptr [RBP + -0x20],0x0 JZ 0x001673d4 CMP qword ptr [RBP + -0x28],0x0 JZ 0x001673d4 MOV RAX,qword ptr [RBP + -0x18] CMP RAX,qword ptr [RBP + -0x28] JBE 0x001673d4 MOV RDI,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RBP + -0x20] MOV RDX,qword ptr [RBP + -0x28] SUB RDX,0x1 CALL 0x00160cf0 CMP EAX,0x0 JNZ 0x001673d4 MOV RAX,qword ptr [RBP + -0x10] MOV RCX,qword ptr [RBP + -0x28] MOVSX EAX,byte ptr [RAX + RCX*0x1] CMP EAX,0x2f JZ 0x001673da LAB_001673d4: MOV byte ptr [RBP + -0x1],0x0 JMP 0x001673de LAB_001673da: MOV byte ptr [RBP + -0x1],0x1 LAB_001673de: MOV AL,byte ptr [RBP + -0x1] AND AL,0x1 ADD RSP,0x30 POP RBP RET
/* is_sub_path(char const*, unsigned long, char const*) */ int1 is_sub_path(char *param_1,ulong param_2,char *param_3) { int iVar1; size_t sVar2; sVar2 = strlen(param_3); if ((((param_3 != (char *)0x0) && (sVar2 != 0)) && (sVar2 < param_2)) && ((iVar1 = memcmp(param_1,param_3,sVar2 - 1), iVar1 == 0 && (param_1[sVar2] == '/')))) { return 1; } return 0; }
2,915
bf_atan2_internal
bluesky950520[P]quickjs/libbf.c
static int bf_atan2_internal(bf_t *r, const bf_t *y, limb_t prec, void *opaque) { bf_context_t *s = r->ctx; const bf_t *x = opaque; bf_t T_s, *T = &T_s; limb_t prec1; int ret; if (y->expn == BF_EXP_NAN || x->expn == BF_EXP_NAN) { bf_set_nan(r); return 0; } /* compute atan(y/x) assumming inf/inf = 1 and 0/0 = 0 */ bf_init(s, T); prec1 = prec + 32; if (y->expn == BF_EXP_INF && x->expn == BF_EXP_INF) { bf_set_ui(T, 1); T->sign = y->sign ^ x->sign; } else if (y->expn == BF_EXP_ZERO && x->expn == BF_EXP_ZERO) { bf_set_zero(T, y->sign ^ x->sign); } else { bf_div(T, y, x, prec1, BF_RNDF); } ret = bf_atan(r, T, prec1, BF_RNDF); if (x->sign) { /* if x < 0 (it includes -0), return sign(y)*pi + atan(y/x) */ bf_const_pi(T, prec1, BF_RNDF); T->sign = y->sign; bf_add(r, r, T, prec1, BF_RNDN); ret |= BF_ST_INEXACT; } bf_delete(T); return ret; }
O0
c
bf_atan2_internal: subq $0x78, %rsp movq %rdi, 0x68(%rsp) movq %rsi, 0x60(%rsp) movq %rdx, 0x58(%rsp) movq %rcx, 0x50(%rsp) movq 0x68(%rsp), %rax movq (%rax), %rax movq %rax, 0x48(%rsp) movq 0x50(%rsp), %rax movq %rax, 0x40(%rsp) leaq 0x18(%rsp), %rax movq %rax, 0x10(%rsp) movq 0x60(%rsp), %rax movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF cmpq %rcx, 0x10(%rax) je 0xf0da3 movq 0x40(%rsp), %rax movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF cmpq %rcx, 0x10(%rax) jne 0xf0dba movq 0x68(%rsp), %rdi callq 0xe61a0 movl $0x0, 0x74(%rsp) jmp 0xf0f16 movq 0x48(%rsp), %rdi movq 0x10(%rsp), %rsi callq 0xe5f70 movq 0x58(%rsp), %rax addq $0x20, %rax movq %rax, 0x8(%rsp) movq 0x60(%rsp), %rax movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE cmpq %rcx, 0x10(%rax) jne 0xf0e2a movq 0x40(%rsp), %rax movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE cmpq %rcx, 0x10(%rax) jne 0xf0e2a movq 0x10(%rsp), %rdi movl $0x1, %esi callq 0xe60a0 movq 0x60(%rsp), %rax movl 0x8(%rax), %ecx movq 0x40(%rsp), %rax xorl 0x8(%rax), %ecx movq 0x10(%rsp), %rax movl %ecx, 0x8(%rax) jmp 0xf0e91 movq 0x60(%rsp), %rax movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000 cmpq %rcx, 0x10(%rax) jne 0xf0e70 movq 0x40(%rsp), %rax movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000 cmpq %rcx, 0x10(%rax) jne 0xf0e70 movq 0x10(%rsp), %rdi movq 0x60(%rsp), %rax movl 0x8(%rax), %esi movq 0x40(%rsp), %rax xorl 0x8(%rax), %esi callq 0xe6240 jmp 0xf0e8f movq 0x10(%rsp), %rdi movq 0x60(%rsp), %rsi movq 0x40(%rsp), %rdx movq 0x8(%rsp), %rcx movl $0x6, %r8d callq 0xea3d0 jmp 0xf0e91 movq 0x68(%rsp), %rdi movq 0x10(%rsp), %rsi movq 0x8(%rsp), %rdx movl $0x6, %ecx callq 0xf05a0 movl %eax, 0x4(%rsp) movq 0x40(%rsp), %rax cmpl $0x0, 0x8(%rax) je 0xf0f04 movq 0x10(%rsp), %rdi movq 0x8(%rsp), %rsi movl $0x6, %edx callq 0xede50 movq 0x60(%rsp), %rax movl 0x8(%rax), %ecx movq 0x10(%rsp), %rax movl %ecx, 0x8(%rax) movq 0x68(%rsp), %rdi movq 0x68(%rsp), %rsi movq 0x10(%rsp), %rdx movq 0x8(%rsp), %rcx xorl %r8d, %r8d callq 0xea170 movl 0x4(%rsp), %eax orl $0x10, %eax movl %eax, 0x4(%rsp) movq 0x10(%rsp), %rdi callq 0xe93d0 movl 0x4(%rsp), %eax movl %eax, 0x74(%rsp) movl 0x74(%rsp), %eax addq $0x78, %rsp retq nop
bf_atan2_internal: sub rsp, 78h mov [rsp+78h+var_10], rdi mov [rsp+78h+var_18], rsi mov [rsp+78h+var_20], rdx mov [rsp+78h+var_28], rcx mov rax, [rsp+78h+var_10] mov rax, [rax] mov [rsp+78h+var_30], rax mov rax, [rsp+78h+var_28] mov [rsp+78h+var_38], rax lea rax, [rsp+78h+var_60] mov [rsp+78h+var_68], rax mov rax, [rsp+78h+var_18] mov rcx, 7FFFFFFFFFFFFFFFh cmp [rax+10h], rcx jz short loc_F0DA3 mov rax, [rsp+78h+var_38] mov rcx, 7FFFFFFFFFFFFFFFh cmp [rax+10h], rcx jnz short loc_F0DBA loc_F0DA3: mov rdi, [rsp+78h+var_10] call bf_set_nan mov [rsp+78h+var_4], 0 jmp loc_F0F16 loc_F0DBA: mov rdi, [rsp+78h+var_30] mov rsi, [rsp+78h+var_68] call bf_init mov rax, [rsp+78h+var_20] add rax, 20h ; ' ' mov [rsp+78h+var_70], rax mov rax, [rsp+78h+var_18] mov rcx, 7FFFFFFFFFFFFFFEh cmp [rax+10h], rcx jnz short loc_F0E2A mov rax, [rsp+78h+var_38] mov rcx, 7FFFFFFFFFFFFFFEh cmp [rax+10h], rcx jnz short loc_F0E2A mov rdi, [rsp+78h+var_68] mov esi, 1 call bf_set_ui mov rax, [rsp+78h+var_18] mov ecx, [rax+8] mov rax, [rsp+78h+var_38] xor ecx, [rax+8] mov rax, [rsp+78h+var_68] mov [rax+8], ecx jmp short loc_F0E91 loc_F0E2A: mov rax, [rsp+78h+var_18] mov rcx, 8000000000000000h cmp [rax+10h], rcx jnz short loc_F0E70 mov rax, [rsp+78h+var_38] mov rcx, 8000000000000000h cmp [rax+10h], rcx jnz short loc_F0E70 mov rdi, [rsp+78h+var_68] mov rax, [rsp+78h+var_18] mov esi, [rax+8] mov rax, [rsp+78h+var_38] xor esi, [rax+8] call bf_set_zero jmp short loc_F0E8F loc_F0E70: mov rdi, [rsp+78h+var_68] mov rsi, [rsp+78h+var_18] mov rdx, [rsp+78h+var_38] mov rcx, [rsp+78h+var_70] mov r8d, 6 call bf_div loc_F0E8F: jmp short $+2 loc_F0E91: mov rdi, [rsp+78h+var_10] mov rsi, [rsp+78h+var_68] mov rdx, [rsp+78h+var_70] mov ecx, 6 call bf_atan mov [rsp+78h+var_74], eax mov rax, [rsp+78h+var_38] cmp dword ptr [rax+8], 0 jz short loc_F0F04 mov rdi, [rsp+78h+var_68] mov rsi, [rsp+78h+var_70] mov edx, 6 call bf_const_pi mov rax, [rsp+78h+var_18] mov ecx, [rax+8] mov rax, [rsp+78h+var_68] mov [rax+8], ecx mov rdi, [rsp+78h+var_10] mov rsi, [rsp+78h+var_10] mov rdx, [rsp+78h+var_68] mov rcx, [rsp+78h+var_70] xor r8d, r8d call bf_add mov eax, [rsp+78h+var_74] or eax, 10h mov [rsp+78h+var_74], eax loc_F0F04: mov rdi, [rsp+78h+var_68] call bf_delete_0 mov eax, [rsp+78h+var_74] mov [rsp+78h+var_4], eax loc_F0F16: mov eax, [rsp+78h+var_4] add rsp, 78h retn
long long bf_atan2_internal(long long *a1, long long *a2, long long a3, long long *a4) { long long *v4; // rsi long long v5; // rdx long long v6; // rcx long long v7; // r8 long long v8; // r9 unsigned int v10; // [rsp+4h] [rbp-74h] long long v11; // [rsp+8h] [rbp-70h] long long v12; // [rsp+18h] [rbp-60h] BYREF int v13; // [rsp+20h] [rbp-58h] long long *v14; // [rsp+40h] [rbp-38h] long long v15; // [rsp+48h] [rbp-30h] long long *v16; // [rsp+50h] [rbp-28h] long long v17; // [rsp+58h] [rbp-20h] long long *v18; // [rsp+60h] [rbp-18h] long long *v19; // [rsp+68h] [rbp-10h] v19 = a1; v18 = a2; v17 = a3; v16 = a4; v15 = *a1; v14 = a4; if ( a2[2] == 0x7FFFFFFFFFFFFFFFLL || v14[2] == 0x7FFFFFFFFFFFFFFFLL ) { bf_set_nan((long long)v19); return 0; } else { bf_init(v15, (long long)&v12); v11 = v17 + 32; if ( v18[2] == 0x7FFFFFFFFFFFFFFELL && v14[2] == 0x7FFFFFFFFFFFFFFELL ) { bf_set_ui((long long)&v12, 1LL); v13 = *((_DWORD *)v14 + 2) ^ *((_DWORD *)v18 + 2); } else if ( v18[2] == 0x8000000000000000LL && v14[2] == 0x8000000000000000LL ) { bf_set_zero((long long)&v12, *((_DWORD *)v14 + 2) ^ *((_DWORD *)v18 + 2)); } else { bf_div(&v12, v18, v14, v11, 6u); } v4 = &v12; v10 = bf_atan(v19, (long long)&v12, v11, 6u); if ( *((_DWORD *)v14 + 2) ) { bf_const_pi((long long)&v12, v11, 6u); v13 = *((_DWORD *)v18 + 2); v4 = v19; bf_add((long long)v19, (long long)v19, (long long)&v12, v11, 0); v10 |= 0x10u; } bf_delete_0(&v12, (long long)v4, v5, v6, v7, v8); return v10; } }
bf_atan2_internal: SUB RSP,0x78 MOV qword ptr [RSP + 0x68],RDI MOV qword ptr [RSP + 0x60],RSI MOV qword ptr [RSP + 0x58],RDX MOV qword ptr [RSP + 0x50],RCX MOV RAX,qword ptr [RSP + 0x68] MOV RAX,qword ptr [RAX] MOV qword ptr [RSP + 0x48],RAX MOV RAX,qword ptr [RSP + 0x50] MOV qword ptr [RSP + 0x40],RAX LEA RAX,[RSP + 0x18] MOV qword ptr [RSP + 0x10],RAX MOV RAX,qword ptr [RSP + 0x60] MOV RCX,0x7fffffffffffffff CMP qword ptr [RAX + 0x10],RCX JZ 0x001f0da3 MOV RAX,qword ptr [RSP + 0x40] MOV RCX,0x7fffffffffffffff CMP qword ptr [RAX + 0x10],RCX JNZ 0x001f0dba LAB_001f0da3: MOV RDI,qword ptr [RSP + 0x68] CALL 0x001e61a0 MOV dword ptr [RSP + 0x74],0x0 JMP 0x001f0f16 LAB_001f0dba: MOV RDI,qword ptr [RSP + 0x48] MOV RSI,qword ptr [RSP + 0x10] CALL 0x001e5f70 MOV RAX,qword ptr [RSP + 0x58] ADD RAX,0x20 MOV qword ptr [RSP + 0x8],RAX MOV RAX,qword ptr [RSP + 0x60] MOV RCX,0x7ffffffffffffffe CMP qword ptr [RAX + 0x10],RCX JNZ 0x001f0e2a MOV RAX,qword ptr [RSP + 0x40] MOV RCX,0x7ffffffffffffffe CMP qword ptr [RAX + 0x10],RCX JNZ 0x001f0e2a MOV RDI,qword ptr [RSP + 0x10] MOV ESI,0x1 CALL 0x001e60a0 MOV RAX,qword ptr [RSP + 0x60] MOV ECX,dword ptr [RAX + 0x8] MOV RAX,qword ptr [RSP + 0x40] XOR ECX,dword ptr [RAX + 0x8] MOV RAX,qword ptr [RSP + 0x10] MOV dword ptr [RAX + 0x8],ECX JMP 0x001f0e91 LAB_001f0e2a: MOV RAX,qword ptr [RSP + 0x60] MOV RCX,-0x8000000000000000 CMP qword ptr [RAX + 0x10],RCX JNZ 0x001f0e70 MOV RAX,qword ptr [RSP + 0x40] MOV RCX,-0x8000000000000000 CMP qword ptr [RAX + 0x10],RCX JNZ 0x001f0e70 MOV RDI,qword ptr [RSP + 0x10] MOV RAX,qword ptr [RSP + 0x60] MOV ESI,dword ptr [RAX + 0x8] MOV RAX,qword ptr [RSP + 0x40] XOR ESI,dword ptr [RAX + 0x8] CALL 0x001e6240 JMP 0x001f0e8f LAB_001f0e70: MOV RDI,qword ptr [RSP + 0x10] MOV RSI,qword ptr [RSP + 0x60] MOV RDX,qword ptr [RSP + 0x40] MOV RCX,qword ptr [RSP + 0x8] MOV R8D,0x6 CALL 0x001ea3d0 LAB_001f0e8f: JMP 0x001f0e91 LAB_001f0e91: MOV RDI,qword ptr [RSP + 0x68] MOV RSI,qword ptr [RSP + 0x10] MOV RDX,qword ptr [RSP + 0x8] MOV ECX,0x6 CALL 0x001f05a0 MOV dword ptr [RSP + 0x4],EAX MOV RAX,qword ptr [RSP + 0x40] CMP dword ptr [RAX + 0x8],0x0 JZ 0x001f0f04 MOV RDI,qword ptr [RSP + 0x10] MOV RSI,qword ptr [RSP + 0x8] MOV EDX,0x6 CALL 0x001ede50 MOV RAX,qword ptr [RSP + 0x60] MOV ECX,dword ptr [RAX + 0x8] MOV RAX,qword ptr [RSP + 0x10] MOV dword ptr [RAX + 0x8],ECX MOV RDI,qword ptr [RSP + 0x68] MOV RSI,qword ptr [RSP + 0x68] MOV RDX,qword ptr [RSP + 0x10] MOV RCX,qword ptr [RSP + 0x8] XOR R8D,R8D CALL 0x001ea170 MOV EAX,dword ptr [RSP + 0x4] OR EAX,0x10 MOV dword ptr [RSP + 0x4],EAX LAB_001f0f04: MOV RDI,qword ptr [RSP + 0x10] CALL 0x001e93d0 MOV EAX,dword ptr [RSP + 0x4] MOV dword ptr [RSP + 0x74],EAX LAB_001f0f16: MOV EAX,dword ptr [RSP + 0x74] ADD RSP,0x78 RET
uint bf_atan2_internal(int8 *param_1,long param_2,long param_3,long param_4) { long lVar1; uint local_74; int1 local_60 [8]; uint local_58; long local_38; int8 local_30; long local_28; long local_20; long local_18; int8 *local_10; uint local_4; local_30 = *param_1; local_38 = param_4; local_28 = param_4; local_20 = param_3; local_18 = param_2; local_10 = param_1; if ((*(long *)(param_2 + 0x10) == 0x7fffffffffffffff) || (*(long *)(param_4 + 0x10) == 0x7fffffffffffffff)) { bf_set_nan(param_1); local_4 = 0; } else { bf_init(local_30,local_60); lVar1 = local_20 + 0x20; if ((*(long *)(local_18 + 0x10) == 0x7ffffffffffffffe) && (*(long *)(local_38 + 0x10) == 0x7ffffffffffffffe)) { bf_set_ui(local_60,1); local_58 = *(uint *)(local_18 + 8) ^ *(uint *)(local_38 + 8); } else if ((*(long *)(local_18 + 0x10) == -0x8000000000000000) && (*(long *)(local_38 + 0x10) == -0x8000000000000000)) { bf_set_zero(local_60,*(uint *)(local_18 + 8) ^ *(uint *)(local_38 + 8)); } else { bf_div(local_60,local_18,local_38,lVar1,6); } local_74 = bf_atan(local_10,local_60,lVar1,6); if (*(int *)(local_38 + 8) != 0) { bf_const_pi(local_60,lVar1,6); local_58 = *(uint *)(local_18 + 8); bf_add(local_10,local_10,local_60,lVar1,0); local_74 = local_74 | 0x10; } bf_delete(local_60); local_4 = local_74; } return local_4; }
2,916
bf_atan2_internal
bluesky950520[P]quickjs/libbf.c
static int bf_atan2_internal(bf_t *r, const bf_t *y, limb_t prec, void *opaque) { bf_context_t *s = r->ctx; const bf_t *x = opaque; bf_t T_s, *T = &T_s; limb_t prec1; int ret; if (y->expn == BF_EXP_NAN || x->expn == BF_EXP_NAN) { bf_set_nan(r); return 0; } /* compute atan(y/x) assumming inf/inf = 1 and 0/0 = 0 */ bf_init(s, T); prec1 = prec + 32; if (y->expn == BF_EXP_INF && x->expn == BF_EXP_INF) { bf_set_ui(T, 1); T->sign = y->sign ^ x->sign; } else if (y->expn == BF_EXP_ZERO && x->expn == BF_EXP_ZERO) { bf_set_zero(T, y->sign ^ x->sign); } else { bf_div(T, y, x, prec1, BF_RNDF); } ret = bf_atan(r, T, prec1, BF_RNDF); if (x->sign) { /* if x < 0 (it includes -0), return sign(y)*pi + atan(y/x) */ bf_const_pi(T, prec1, BF_RNDF); T->sign = y->sign; bf_add(r, r, T, prec1, BF_RNDN); ret |= BF_ST_INEXACT; } bf_delete(T); return ret; }
O1
c
bf_atan2_internal: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rcx, %r12 movq %rdi, %rbx movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000 movq (%rdi), %rax movq 0x10(%rsi), %rcx leaq -0x1(%r13), %rbp cmpq %rbp, %rcx je 0x8d21b movq %rdx, %r14 movq 0x10(%r12), %rdx cmpq %rbp, %rdx jne 0x8d258 cmpq $0x0, 0x18(%rbx) je 0x8d23a movq 0x20(%rbx), %rsi movq (%rax), %rdi xorl %edx, %edx callq *0x8(%rax) movq %rax, 0x20(%rbx) movq $0x0, 0x18(%rbx) movq %rbp, 0x10(%rbx) movl $0x0, 0x8(%rbx) xorl %ebp, %ebp movl %ebp, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rsi, %r15 movq %rax, (%rsp) movl $0x0, 0x8(%rsp) movq %r13, 0x10(%rsp) xorps %xmm0, %xmm0 movups %xmm0, 0x18(%rsp) addq $0x20, %r14 leaq -0x2(%r13), %rsi movq %rcx, %rdi xorq %rsi, %rdi xorq %rdx, %rsi orq %rdi, %rsi jne 0x8d2a9 movq %rsp, %r13 movl $0x1, %esi movq %r13, %rdi callq 0x84abb movl 0x8(%r12), %eax xorl 0x8(%r15), %eax movl %eax, 0x8(%r13) jmp 0x8d309 xorq %r13, %rcx xorq %r13, %rdx orq %rcx, %rdx jne 0x8d2eb movl 0x8(%r12), %ebp xorl 0x8(%r15), %ebp cmpq $0x0, 0x18(%rsp) je 0x8d2e0 movq 0x20(%rsp), %rsi movq (%rax), %rdi xorl %edx, %edx callq *0x8(%rax) movq %rax, 0x20(%rsp) movq $0x0, 0x18(%rsp) movq %r13, 0x10(%rsp) movl %ebp, 0x8(%rsp) jmp 0x8d309 leaq -0x56ff(%rip), %r9 # 0x87bf3 movq %rsp, %rdi movq %r15, %rsi movq %r12, %rdx movq %r14, %rcx movl $0x6, %r8d callq 0x87b3a movq %rsp, %rsi movq %rbx, %rdi movq %r14, %rdx movl $0x6, %ecx callq 0x8cb09 movl %eax, %ebp cmpl $0x0, 0x8(%r12) je 0x8d372 movq %rsp, %r12 movq (%r12), %rcx addq $0x40, %rcx leaq 0x4c31(%rip), %r8 # 0x91f69 movq %r12, %rdi movq %r14, %rsi movl $0x6, %edx xorl %r9d, %r9d callq 0x8a640 movl 0x8(%r15), %eax movl %eax, 0x8(%r12) leaq -0x5787(%rip), %r9 # 0x87bd4 movq %rbx, %rdi movq %rbx, %rsi movq %r12, %rdx movq %r14, %rcx xorl %r8d, %r8d callq 0x87b3a orl $0x10, %ebp movq (%rsp), %rax testq %rax, %rax je 0x8d247 movq 0x20(%rsp), %rsi testq %rsi, %rsi je 0x8d247 movq (%rax), %rdi xorl %edx, %edx callq *0x8(%rax) jmp 0x8d247
bf_atan2_internal: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 28h mov r12, rcx mov rbx, rdi mov r13, 8000000000000000h mov rax, [rdi] mov rcx, [rsi+10h] lea rbp, [r13-1] cmp rcx, rbp jz short loc_8D21B mov r14, rdx mov rdx, [r12+10h] cmp rdx, rbp jnz short loc_8D258 loc_8D21B: cmp qword ptr [rbx+18h], 0 jz short loc_8D23A mov rsi, [rbx+20h] mov rdi, [rax] xor edx, edx call qword ptr [rax+8] mov [rbx+20h], rax mov qword ptr [rbx+18h], 0 loc_8D23A: mov [rbx+10h], rbp mov dword ptr [rbx+8], 0 xor ebp, ebp loc_8D247: mov eax, ebp add rsp, 28h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_8D258: mov r15, rsi mov [rsp+58h+var_58], rax mov [rsp+58h+var_50], 0 mov [rsp+58h+var_48], r13 xorps xmm0, xmm0 movups [rsp+58h+var_40], xmm0 add r14, 20h ; ' ' lea rsi, [r13-2] mov rdi, rcx xor rdi, rsi xor rsi, rdx or rsi, rdi jnz short loc_8D2A9 mov r13, rsp mov esi, 1 mov rdi, r13 call bf_set_ui mov eax, [r12+8] xor eax, [r15+8] mov [r13+8], eax jmp short loc_8D309 loc_8D2A9: xor rcx, r13 xor rdx, r13 or rdx, rcx jnz short loc_8D2EB mov ebp, [r12+8] xor ebp, [r15+8] cmp qword ptr [rsp+58h+var_40], 0 jz short loc_8D2E0 mov rsi, qword ptr [rsp+58h+var_40+8] mov rdi, [rax] xor edx, edx call qword ptr [rax+8] mov qword ptr [rsp+58h+var_40+8], rax mov qword ptr [rsp+58h+var_40], 0 loc_8D2E0: mov [rsp+58h+var_48], r13 mov [rsp+58h+var_50], ebp jmp short loc_8D309 loc_8D2EB: lea r9, __bf_div mov rdi, rsp mov rsi, r15 mov rdx, r12 mov rcx, r14 mov r8d, 6 call bf_op2 loc_8D309: mov rsi, rsp mov rdi, rbx mov rdx, r14 mov ecx, 6 call bf_atan mov ebp, eax cmp dword ptr [r12+8], 0 jz short loc_8D372 mov r12, rsp mov rcx, [r12] add rcx, 40h ; '@' lea r8, bf_const_pi_internal mov rdi, r12 mov rsi, r14 mov edx, 6 xor r9d, r9d call bf_const_get mov eax, [r15+8] mov [r12+8], eax lea r9, __bf_add mov rdi, rbx mov rsi, rbx mov rdx, r12 mov rcx, r14 xor r8d, r8d call bf_op2 or ebp, 10h loc_8D372: mov rax, [rsp+58h+var_58] test rax, rax jz loc_8D247 mov rsi, qword ptr [rsp+58h+var_40+8] test rsi, rsi jz loc_8D247 mov rdi, [rax] xor edx, edx call qword ptr [rax+8] jmp loc_8D247
long long bf_atan2_internal(long long a1, long long a2, long long a3, long long a4) { _QWORD *v5; // rax long long v6; // rcx long long v8; // rdx unsigned int v9; // ebp long long v11; // r14 int v12; // ebp __int128 v13; // [rsp+0h] [rbp-58h] BYREF unsigned long long v14; // [rsp+10h] [rbp-48h] __int128 v15; // [rsp+18h] [rbp-40h] v5 = *(_QWORD **)a1; v6 = *(_QWORD *)(a2 + 16); if ( v6 == 0x7FFFFFFFFFFFFFFFLL || (v8 = *(_QWORD *)(a4 + 16), v8 == 0x7FFFFFFFFFFFFFFFLL) ) { if ( *(_QWORD *)(a1 + 24) ) { *(_QWORD *)(a1 + 32) = ((long long ( *)(_QWORD, _QWORD, _QWORD))v5[1])(*v5, *(_QWORD *)(a1 + 32), 0LL); *(_QWORD *)(a1 + 24) = 0LL; } *(_QWORD *)(a1 + 16) = 0x7FFFFFFFFFFFFFFFLL; *(_DWORD *)(a1 + 8) = 0; return 0; } else { *(_QWORD *)&v13 = *(_QWORD *)a1; DWORD2(v13) = 0; v14 = 0x8000000000000000LL; v15 = 0LL; v11 = a3 + 32; if ( v6 ^ 0x7FFFFFFFFFFFFFFELL | v8 ^ 0x7FFFFFFFFFFFFFFELL ) { if ( v6 ^ 0x8000000000000000LL | v8 ^ 0x8000000000000000LL ) { bf_op2(&v13, (__int128 *)a2, (__int128 *)a4, v11, 6LL, (long long ( *)(__int128 *))_bf_div); } else { v12 = *(_DWORD *)(a2 + 8) ^ *(_DWORD *)(a4 + 8); if ( (_QWORD)v15 ) { *((_QWORD *)&v15 + 1) = ((long long ( *)(_QWORD, _QWORD, _QWORD))v5[1])( *v5, *((_QWORD *)&v15 + 1), 0LL); *(_QWORD *)&v15 = 0LL; } v14 = 0x8000000000000000LL; DWORD2(v13) = v12; } } else { bf_set_ui((_QWORD **)&v13, 1uLL); DWORD2(v13) = *(_DWORD *)(a2 + 8) ^ *(_DWORD *)(a4 + 8); } v9 = bf_atan(a1, (long long)&v13, v11, 6u); if ( *(_DWORD *)(a4 + 8) ) { bf_const_get( (long long)&v13, v11, 6u, v13 + 64, (void ( *)(long long, unsigned long long))bf_const_pi_internal, 0); DWORD2(v13) = *(_DWORD *)(a2 + 8); bf_op2((__int128 *)a1, (__int128 *)a1, &v13, v11, 0LL, (long long ( *)(__int128 *))_bf_add); v9 |= 0x10u; } if ( (_QWORD)v13 && *((_QWORD *)&v15 + 1) ) (*(void ( **)(_QWORD, _QWORD, _QWORD))(v13 + 8))(*(_QWORD *)v13, *((_QWORD *)&v15 + 1), 0LL); } return v9; }
2,917
bf_atan2_internal
bluesky950520[P]quickjs/libbf.c
static int bf_atan2_internal(bf_t *r, const bf_t *y, limb_t prec, void *opaque) { bf_context_t *s = r->ctx; const bf_t *x = opaque; bf_t T_s, *T = &T_s; limb_t prec1; int ret; if (y->expn == BF_EXP_NAN || x->expn == BF_EXP_NAN) { bf_set_nan(r); return 0; } /* compute atan(y/x) assumming inf/inf = 1 and 0/0 = 0 */ bf_init(s, T); prec1 = prec + 32; if (y->expn == BF_EXP_INF && x->expn == BF_EXP_INF) { bf_set_ui(T, 1); T->sign = y->sign ^ x->sign; } else if (y->expn == BF_EXP_ZERO && x->expn == BF_EXP_ZERO) { bf_set_zero(T, y->sign ^ x->sign); } else { bf_div(T, y, x, prec1, BF_RNDF); } ret = bf_atan(r, T, prec1, BF_RNDF); if (x->sign) { /* if x < 0 (it includes -0), return sign(y)*pi + atan(y/x) */ bf_const_pi(T, prec1, BF_RNDF); T->sign = y->sign; bf_add(r, r, T, prec1, BF_RNDN); ret |= BF_ST_INEXACT; } bf_delete(T); return ret; }
O2
c
bf_atan2_internal: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdx, %rbx movq %rdi, %r14 movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF movq 0x10(%rsi), %rdx cmpq %rax, %rdx je 0x75e8f movq %rcx, %r12 movq 0x10(%rcx), %rcx cmpq %rax, %rcx jne 0x75e9e movq %r14, %rdi callq 0x6f5cd xorl %ebp, %ebp jmp 0x75f7f movq %rsi, %r15 movq (%r14), %rsi movq %rsi, (%rsp) andl $0x0, 0x8(%rsp) leaq 0x1(%rax), %rsi movq %rsi, 0x10(%rsp) xorps %xmm0, %xmm0 movups %xmm0, 0x18(%rsp) addq $0x20, %rbx movq %rdx, %rdi negq %rdi jo 0x75efe movabsq $0x7ffffffffffffffe, %rsi # imm = 0x7FFFFFFFFFFFFFFE cmpq %rsi, %rdx jne 0x75f16 decq %rax cmpq %rax, %rcx jne 0x75f16 movq %rsp, %r13 pushq $0x1 popq %rsi movq %r13, %rdi callq 0x6f556 movl 0x8(%r12), %eax xorl 0x8(%r15), %eax movl %eax, 0x8(%r13) jmp 0x75f2b cmpq %rsi, %rcx jne 0x75f16 movl 0x8(%r12), %esi xorl 0x8(%r15), %esi movq %rsp, %rdi callq 0x6f612 jmp 0x75f2b movq %rsp, %rdi pushq $0x6 popq %r8 movq %r15, %rsi movq %r12, %rdx movq %rbx, %rcx callq 0x71cf2 movq %rsp, %rsi pushq $0x6 popq %rcx movq %r14, %rdi movq %rbx, %rdx callq 0x7595d movl %eax, %ebp cmpl $0x0, 0x8(%r12) je 0x75f77 movq %rsp, %r12 pushq $0x6 popq %rdx movq %r12, %rdi movq %rbx, %rsi callq 0x740f8 movl 0x8(%r15), %eax movl %eax, 0x8(%r12) movq %r14, %rdi movq %r14, %rsi movq %r12, %rdx movq %rbx, %rcx xorl %r8d, %r8d callq 0x71c49 orl $0x10, %ebp movq %rsp, %rdi callq 0x7145e movl %ebp, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
bf_atan2_internal: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 28h mov rbx, rdx mov r14, rdi mov rax, 7FFFFFFFFFFFFFFFh mov rdx, [rsi+10h] cmp rdx, rax jz short loc_75E8F mov r12, rcx mov rcx, [rcx+10h] cmp rcx, rax jnz short loc_75E9E loc_75E8F: mov rdi, r14 call bf_set_nan xor ebp, ebp jmp loc_75F7F loc_75E9E: mov r15, rsi mov rsi, [r14] mov [rsp+58h+var_58], rsi and [rsp+58h+var_50], 0 lea rsi, [rax+1] mov [rsp+58h+var_48], rsi xorps xmm0, xmm0 movups [rsp+58h+var_40], xmm0 add rbx, 20h ; ' ' mov rdi, rdx neg rdi jo short loc_75EFE mov rsi, 7FFFFFFFFFFFFFFEh cmp rdx, rsi jnz short loc_75F16 dec rax cmp rcx, rax jnz short loc_75F16 mov r13, rsp push 1 pop rsi mov rdi, r13 call bf_set_ui mov eax, [r12+8] xor eax, [r15+8] mov [r13+8], eax jmp short loc_75F2B loc_75EFE: cmp rcx, rsi jnz short loc_75F16 mov esi, [r12+8] xor esi, [r15+8] mov rdi, rsp call bf_set_zero jmp short loc_75F2B loc_75F16: mov rdi, rsp push 6 pop r8 mov rsi, r15 mov rdx, r12 mov rcx, rbx call bf_div loc_75F2B: mov rsi, rsp push 6 pop rcx mov rdi, r14 mov rdx, rbx call bf_atan mov ebp, eax cmp dword ptr [r12+8], 0 jz short loc_75F77 mov r12, rsp push 6 pop rdx mov rdi, r12 mov rsi, rbx call bf_const_pi mov eax, [r15+8] mov [r12+8], eax mov rdi, r14 mov rsi, r14 mov rdx, r12 mov rcx, rbx xor r8d, r8d call bf_add or ebp, 10h loc_75F77: mov rdi, rsp call bf_delete_0 loc_75F7F: mov eax, ebp add rsp, 28h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long bf_atan2_internal(long long *a1, long long a2, long long a3, long long a4) { long long v5; // rdx long long v7; // rcx unsigned int v8; // ebp long long v9; // rbx __int128 v11; // [rsp+0h] [rbp-58h] BYREF unsigned long long v12; // [rsp+10h] [rbp-48h] __int128 v13; // [rsp+18h] [rbp-40h] v5 = *(_QWORD *)(a2 + 16); if ( v5 == 0x7FFFFFFFFFFFFFFFLL || (v7 = *(_QWORD *)(a4 + 16), v7 == 0x7FFFFFFFFFFFFFFFLL) ) { bf_set_nan((long long)a1); return 0; } *(_QWORD *)&v11 = *a1; DWORD2(v11) = 0; v12 = 0x8000000000000000LL; v13 = 0LL; v9 = a3 + 32; if ( __OFSUB__(-v5, 1LL) ) { if ( v7 == 0x8000000000000000LL ) { bf_set_zero((long long)&v11, *(_DWORD *)(a2 + 8) ^ *(_DWORD *)(a4 + 8)); goto LABEL_11; } LABEL_10: bf_div(&v11, (__int128 *)a2, (__int128 *)a4, v9, 6LL); goto LABEL_11; } if ( v5 != 0x7FFFFFFFFFFFFFFELL || v7 != 0x7FFFFFFFFFFFFFFELL ) goto LABEL_10; bf_set_ui((long long)&v11, 1uLL); DWORD2(v11) = *(_DWORD *)(a2 + 8) ^ *(_DWORD *)(a4 + 8); LABEL_11: v8 = bf_atan(a1, (long long)&v11, v9, 6u); if ( *(_DWORD *)(a4 + 8) ) { bf_const_pi((long long)&v11, v9, 6u); DWORD2(v11) = *(_DWORD *)(a2 + 8); bf_add((long long)a1, (long long)a1, (long long)&v11, v9, 0LL); v8 |= 0x10u; } bf_delete_0((long long *)&v11); return v8; }
bf_atan2_internal: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x28 MOV RBX,RDX MOV R14,RDI MOV RAX,0x7fffffffffffffff MOV RDX,qword ptr [RSI + 0x10] CMP RDX,RAX JZ 0x00175e8f MOV R12,RCX MOV RCX,qword ptr [RCX + 0x10] CMP RCX,RAX JNZ 0x00175e9e LAB_00175e8f: MOV RDI,R14 CALL 0x0016f5cd XOR EBP,EBP JMP 0x00175f7f LAB_00175e9e: MOV R15,RSI MOV RSI,qword ptr [R14] MOV qword ptr [RSP],RSI AND dword ptr [RSP + 0x8],0x0 LEA RSI,[RAX + 0x1] MOV qword ptr [RSP + 0x10],RSI XORPS XMM0,XMM0 MOVUPS xmmword ptr [RSP + 0x18],XMM0 ADD RBX,0x20 MOV RDI,RDX NEG RDI JO 0x00175efe MOV RSI,0x7ffffffffffffffe CMP RDX,RSI JNZ 0x00175f16 DEC RAX CMP RCX,RAX JNZ 0x00175f16 MOV R13,RSP PUSH 0x1 POP RSI MOV RDI,R13 CALL 0x0016f556 MOV EAX,dword ptr [R12 + 0x8] XOR EAX,dword ptr [R15 + 0x8] MOV dword ptr [R13 + 0x8],EAX JMP 0x00175f2b LAB_00175efe: CMP RCX,RSI JNZ 0x00175f16 MOV ESI,dword ptr [R12 + 0x8] XOR ESI,dword ptr [R15 + 0x8] MOV RDI,RSP CALL 0x0016f612 JMP 0x00175f2b LAB_00175f16: MOV RDI,RSP PUSH 0x6 POP R8 MOV RSI,R15 MOV RDX,R12 MOV RCX,RBX CALL 0x00171cf2 LAB_00175f2b: MOV RSI,RSP PUSH 0x6 POP RCX MOV RDI,R14 MOV RDX,RBX CALL 0x0017595d MOV EBP,EAX CMP dword ptr [R12 + 0x8],0x0 JZ 0x00175f77 MOV R12,RSP PUSH 0x6 POP RDX MOV RDI,R12 MOV RSI,RBX CALL 0x001740f8 MOV EAX,dword ptr [R15 + 0x8] MOV dword ptr [R12 + 0x8],EAX MOV RDI,R14 MOV RSI,R14 MOV RDX,R12 MOV RCX,RBX XOR R8D,R8D CALL 0x00171c49 OR EBP,0x10 LAB_00175f77: MOV RDI,RSP CALL 0x0017145e LAB_00175f7f: MOV EAX,EBP ADD RSP,0x28 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* WARNING: Removing unreachable block (ram,0x00175efe) */ /* WARNING: Removing unreachable block (ram,0x00175f03) */ uint bf_atan2_internal(int8 *param_1,long param_2,long param_3,long param_4) { uint uVar1; int8 local_58; uint local_50; int8 local_48; int8 local_40; int8 uStack_38; if ((*(long *)(param_2 + 0x10) == 0x7fffffffffffffff) || (*(long *)(param_4 + 0x10) == 0x7fffffffffffffff)) { bf_set_nan(param_1); uVar1 = 0; } else { local_58 = *param_1; local_50 = 0; local_48 = 0x8000000000000000; local_40 = 0; uStack_38 = 0; param_3 = param_3 + 0x20; if ((*(long *)(param_2 + 0x10) == 0x7ffffffffffffffe) && (*(long *)(param_4 + 0x10) == 0x7ffffffffffffffe)) { bf_set_ui(&local_58,1); local_50 = *(uint *)(param_4 + 8) ^ *(uint *)(param_2 + 8); } else { bf_div(&local_58,param_2,param_4,param_3,6); } uVar1 = bf_atan(param_1,&local_58,param_3,6); if (*(int *)(param_4 + 8) != 0) { bf_const_pi(&local_58,param_3,6); local_50 = *(uint *)(param_2 + 8); bf_add(param_1,param_1,&local_58,param_3,0); uVar1 = uVar1 | 0x10; } bf_delete(&local_58); } return uVar1; }
2,918
ma_uniquedef_write
eloqsql/storage/maria/ma_open.c
my_bool _ma_uniquedef_write(File file, MARIA_UNIQUEDEF *def) { uchar buff[MARIA_UNIQUEDEF_SIZE]; uchar *ptr=buff; mi_int2store(ptr,def->keysegs); ptr+=2; *ptr++= (uchar) def->key; *ptr++ = (uchar) def->null_are_equal; return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; }
O0
c
ma_uniquedef_write: pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %fs:0x28, %rax movq %rax, -0x8(%rbp) movl %edi, -0x10(%rbp) movq %rsi, -0x18(%rbp) leaq -0xc(%rbp), %rcx movq %rcx, -0x20(%rbp) movq -0x18(%rbp), %rax movzwl (%rax), %eax movl %eax, -0x24(%rbp) movb -0x24(%rbp), %dl movq -0x20(%rbp), %rax movb %dl, 0x1(%rax) movb -0x23(%rbp), %dl movq -0x20(%rbp), %rax movb %dl, (%rax) movq -0x20(%rbp), %rax addq $0x2, %rax movq %rax, -0x20(%rbp) movq -0x18(%rbp), %rax movb 0x2(%rax), %dl movq -0x20(%rbp), %rax movq %rax, %rsi incq %rsi movq %rsi, -0x20(%rbp) movb %dl, (%rax) movq -0x18(%rbp), %rax movb 0x3(%rax), %dl movq -0x20(%rbp), %rax movq %rax, %rsi incq %rsi movq %rsi, -0x20(%rbp) movb %dl, (%rax) movl -0x10(%rbp), %edx movq -0x20(%rbp), %r8 subq %rcx, %r8 leaq 0xe98c5(%rip), %rdi # 0x151791 movl $0x759, %esi # imm = 0x759 movl $0x4, %r9d callq 0x66a10 testq %rax, %rax setne %al movb %al, -0x25(%rbp) movq %fs:0x28, %rax movq -0x8(%rbp), %rcx cmpq %rcx, %rax jne 0x67f00 movb -0x25(%rbp), %al addq $0x30, %rsp popq %rbp retq callq 0x2a260 nopw %cs:(%rax,%rax)
_ma_uniquedef_write: push rbp mov rbp, rsp sub rsp, 30h mov rax, fs:28h mov [rbp+var_8], rax mov [rbp+var_10], edi mov [rbp+var_18], rsi lea rcx, [rbp+var_C] mov [rbp+var_20], rcx mov rax, [rbp+var_18] movzx eax, word ptr [rax] mov [rbp+var_24], eax mov dl, byte ptr [rbp+var_24] mov rax, [rbp+var_20] mov [rax+1], dl mov dl, byte ptr [rbp+var_24+1] mov rax, [rbp+var_20] mov [rax], dl mov rax, [rbp+var_20] add rax, 2 mov [rbp+var_20], rax mov rax, [rbp+var_18] mov dl, [rax+2] mov rax, [rbp+var_20] mov rsi, rax inc rsi mov [rbp+var_20], rsi mov [rax], dl mov rax, [rbp+var_18] mov dl, [rax+3] mov rax, [rbp+var_20] mov rsi, rax inc rsi mov [rbp+var_20], rsi mov [rax], dl mov edx, [rbp+var_10] mov r8, [rbp+var_20] sub r8, rcx lea rdi, aWorkspaceLlm4b_14; "/workspace/llm4binary/github2025/eloqsq"... mov esi, 759h mov r9d, 4 call inline_mysql_file_write_0 test rax, rax setnz al mov [rbp+var_25], al mov rax, fs:28h mov rcx, [rbp+var_8] cmp rax, rcx jnz short loc_67F00 mov al, [rbp+var_25] add rsp, 30h pop rbp retn loc_67F00: call ___stack_chk_fail
bool ma_uniquedef_write(unsigned int a1, unsigned __int16 *a2) { unsigned __int16 v2; // kr00_2 _BYTE v4[4]; // [rsp+24h] [rbp-Ch] BYREF unsigned long long v5; // [rsp+28h] [rbp-8h] BYREF v5 = __readfsqword(0x28u); v2 = *a2; v4[0] = HIBYTE(*a2); v4[1] = v2; v4[2] = *((_BYTE *)a2 + 2); v4[3] = *((_BYTE *)a2 + 3); return inline_mysql_file_write_0( (long long)"/workspace/llm4binary/github2025/eloqsql/storage/maria/ma_open.c", 0x759u, a1, (long long)v4, (char *)&v5 - v4, 4LL) != 0; }
_ma_uniquedef_write: PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RBP + -0x8],RAX MOV dword ptr [RBP + -0x10],EDI MOV qword ptr [RBP + -0x18],RSI LEA RCX,[RBP + -0xc] MOV qword ptr [RBP + -0x20],RCX MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,word ptr [RAX] MOV dword ptr [RBP + -0x24],EAX MOV DL,byte ptr [RBP + -0x24] MOV RAX,qword ptr [RBP + -0x20] MOV byte ptr [RAX + 0x1],DL MOV DL,byte ptr [RBP + -0x23] MOV RAX,qword ptr [RBP + -0x20] MOV byte ptr [RAX],DL MOV RAX,qword ptr [RBP + -0x20] ADD RAX,0x2 MOV qword ptr [RBP + -0x20],RAX MOV RAX,qword ptr [RBP + -0x18] MOV DL,byte ptr [RAX + 0x2] MOV RAX,qword ptr [RBP + -0x20] MOV RSI,RAX INC RSI MOV qword ptr [RBP + -0x20],RSI MOV byte ptr [RAX],DL MOV RAX,qword ptr [RBP + -0x18] MOV DL,byte ptr [RAX + 0x3] MOV RAX,qword ptr [RBP + -0x20] MOV RSI,RAX INC RSI MOV qword ptr [RBP + -0x20],RSI MOV byte ptr [RAX],DL MOV EDX,dword ptr [RBP + -0x10] MOV R8,qword ptr [RBP + -0x20] SUB R8,RCX LEA RDI,[0x251791] MOV ESI,0x759 MOV R9D,0x4 CALL 0x00166a10 TEST RAX,RAX SETNZ AL MOV byte ptr [RBP + -0x25],AL MOV RAX,qword ptr FS:[0x28] MOV RCX,qword ptr [RBP + -0x8] CMP RAX,RCX JNZ 0x00167f00 MOV AL,byte ptr [RBP + -0x25] ADD RSP,0x30 POP RBP RET LAB_00167f00: CALL 0x0012a260
int8 _ma_uniquedef_write(int4 param_1,int2 *param_2) { long lVar1; long in_FS_OFFSET; int1 local_2c; int1 uStack_2b; int1 local_14; int1 local_13; int1 local_12; int1 local_11; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); local_2c = (int1)*param_2; local_13 = local_2c; uStack_2b = (int1)((ushort)*param_2 >> 8); local_14 = uStack_2b; local_12 = *(int1 *)(param_2 + 1); local_11 = *(int1 *)((long)param_2 + 3); lVar1 = inline_mysql_file_write ("/workspace/llm4binary/github2025/eloqsql/storage/maria/ma_open.c",0x759, param_1,&local_14,(long)&local_10 - (long)&local_14,4); if (*(long *)(in_FS_OFFSET + 0x28) == local_10) { return CONCAT71((int7)((ulong)*(long *)(in_FS_OFFSET + 0x28) >> 8),lVar1 != 0); } /* WARNING: Subroutine does not return */ __stack_chk_fail(); }
2,919
ma_uniquedef_write
eloqsql/storage/maria/ma_open.c
my_bool _ma_uniquedef_write(File file, MARIA_UNIQUEDEF *def) { uchar buff[MARIA_UNIQUEDEF_SIZE]; uchar *ptr=buff; mi_int2store(ptr,def->keysegs); ptr+=2; *ptr++= (uchar) def->key; *ptr++ = (uchar) def->null_are_equal; return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; }
O3
c
ma_uniquedef_write: pushq %rbp movq %rsp, %rbp pushq %r14 pushq %rbx subq $0x60, %rsp movq %fs:0x28, %rax movq %rax, -0x18(%rbp) movzwl (%rsi), %eax rolw $0x8, %ax movl %edi, %ebx movw %ax, -0x1c(%rbp) movb 0x2(%rsi), %al movb %al, -0x1a(%rbp) movb 0x3(%rsi), %al movb %al, -0x19(%rbp) leaq 0x32fdd1(%rip), %rax # 0x385010 movq (%rax), %rax leaq -0x70(%rbp), %rdi movl %ebx, %esi movl $0x7, %edx callq *0x158(%rax) testq %rax, %rax jne 0x5528b leaq -0x1c(%rbp), %rsi movl $0x4, %edx movl $0x4, %ecx movl %ebx, %edi callq 0x2efe4 testq %rax, %rax setne %al movq %fs:0x28, %rcx cmpq -0x18(%rbp), %rcx jne 0x552a5 addq $0x60, %rsp popq %rbx popq %r14 popq %rbp retq leaq -0x1c(%rbp), %rdx leaq -0x28(%rbp), %r14 movq %rax, %rdi movl %ebx, %esi movq %r14, %rcx callq 0x2d2c2 movq (%r14), %rax jmp 0x5526d callq 0x29260
_ma_uniquedef_write: push rbp mov rbp, rsp push r14 push rbx sub rsp, 60h mov rax, fs:28h mov [rbp+var_18], rax movzx eax, word ptr [rsi] rol ax, 8 mov ebx, edi mov [rbp+var_1C], ax mov al, [rsi+2] mov [rbp+var_1A], al mov al, [rsi+3] mov [rbp+var_19], al lea rax, PSI_server mov rax, [rax] lea rdi, [rbp+var_70] mov esi, ebx mov edx, 7 call qword ptr [rax+158h] test rax, rax jnz short loc_5528B lea rsi, [rbp+var_1C] mov edx, 4 mov ecx, 4 mov edi, ebx call my_write loc_5526D: test rax, rax setnz al mov rcx, fs:28h cmp rcx, [rbp+var_18] jnz short loc_552A5 add rsp, 60h pop rbx pop r14 pop rbp retn loc_5528B: lea rdx, [rbp+var_1C] lea r14, [rbp+var_28] mov rdi, rax mov esi, ebx mov rcx, r14 call _ma_uniquedef_write_cold_1 mov rax, [r14] jmp short loc_5526D loc_552A5: call ___stack_chk_fail
bool ma_uniquedef_write(unsigned int a1, long long a2) { long long v2; // rax long long v3; // rax _BYTE v5[72]; // [rsp+0h] [rbp-70h] BYREF long long v6; // [rsp+48h] [rbp-28h] BYREF __int16 v7; // [rsp+54h] [rbp-1Ch] BYREF char v8; // [rsp+56h] [rbp-1Ah] char v9; // [rsp+57h] [rbp-19h] unsigned long long v10; // [rsp+58h] [rbp-18h] v10 = __readfsqword(0x28u); v7 = __ROL2__(*(_WORD *)a2, 8); v8 = *(_BYTE *)(a2 + 2); v9 = *(_BYTE *)(a2 + 3); v2 = ((long long ( *)(_BYTE *, _QWORD, long long))PSI_server[43])(v5, a1, 7LL); if ( v2 ) { ma_uniquedef_write_cold_1(v2, a1, (long long)&v7, &v6); v3 = v6; } else { v3 = my_write(a1, (long long)&v7, 4LL, 4LL); } return v3 != 0; }
_ma_uniquedef_write: PUSH RBP MOV RBP,RSP PUSH R14 PUSH RBX SUB RSP,0x60 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RBP + -0x18],RAX MOVZX EAX,word ptr [RSI] ROL AX,0x8 MOV EBX,EDI MOV word ptr [RBP + -0x1c],AX MOV AL,byte ptr [RSI + 0x2] MOV byte ptr [RBP + -0x1a],AL MOV AL,byte ptr [RSI + 0x3] MOV byte ptr [RBP + -0x19],AL LEA RAX,[0x485010] MOV RAX,qword ptr [RAX] LEA RDI,[RBP + -0x70] MOV ESI,EBX MOV EDX,0x7 CALL qword ptr [RAX + 0x158] TEST RAX,RAX JNZ 0x0015528b LEA RSI,[RBP + -0x1c] MOV EDX,0x4 MOV ECX,0x4 MOV EDI,EBX CALL 0x0012efe4 LAB_0015526d: TEST RAX,RAX SETNZ AL MOV RCX,qword ptr FS:[0x28] CMP RCX,qword ptr [RBP + -0x18] JNZ 0x001552a5 ADD RSP,0x60 POP RBX POP R14 POP RBP RET LAB_0015528b: LEA RDX,[RBP + -0x1c] LEA R14,[RBP + -0x28] MOV RDI,RAX MOV ESI,EBX MOV RCX,R14 CALL 0x0012d2c2 MOV RAX,qword ptr [R14] JMP 0x0015526d LAB_001552a5: CALL 0x00129260
bool _ma_uniquedef_write(int4 param_1,ushort *param_2) { long lVar1; long in_FS_OFFSET; int1 local_78 [72]; long local_30; ushort local_24; int1 local_22; int1 local_21; long local_20; local_20 = *(long *)(in_FS_OFFSET + 0x28); local_24 = *param_2 << 8 | *param_2 >> 8; local_22 = (int1)param_2[1]; local_21 = *(int1 *)((long)param_2 + 3); lVar1 = (**(code **)(PSI_server + 0x158))(local_78,param_1,7); if (lVar1 == 0) { local_30 = my_write(param_1,&local_24,4,4); } else { _ma_uniquedef_write_cold_1(lVar1,param_1,&local_24,&local_30); } if (*(long *)(in_FS_OFFSET + 0x28) == local_20) { return local_30 != 0; } /* WARNING: Subroutine does not return */ __stack_chk_fail(); }
2,920
handle_event_raw_mode(st_print_event_info*, unsigned long*, char const*, unsigned int)
eloqsql/client/mysqlbinlog.cc
static Exit_status handle_event_raw_mode(PRINT_EVENT_INFO *print_event_info, ulong *len, const char* logname, uint logname_len) { const char *error_msg; const uchar *read_pos= mysql->net.read_pos + 1; Log_event_type type; DBUG_ENTER("handle_event_raw_mode"); DBUG_ASSERT(opt_raw_mode && remote_opt); type= (Log_event_type) read_pos[EVENT_TYPE_OFFSET]; if (type == HEARTBEAT_LOG_EVENT) DBUG_RETURN(OK_CONTINUE); if (type == ROTATE_EVENT || type == FORMAT_DESCRIPTION_EVENT) { Log_event *ev; if (!(ev= Log_event::read_log_event(read_pos , *len - 1, &error_msg, glob_description_event, opt_verify_binlog_checksum))) { error("Could not construct %s event object: %s", type == ROTATE_EVENT ? "rotate" : "format description", error_msg); DBUG_RETURN(ERROR_STOP); } /* If reading from a remote host, ensure the temp_buf for the Log_event class is pointing to the incoming stream. */ ev->register_temp_buf(const_cast<uchar*>(read_pos), FALSE); if (type == ROTATE_EVENT) { Exit_status ret_val= OK_CONTINUE; Rotate_log_event *rev= (Rotate_log_event *)ev; char *pe= strmake(out_file_name, output_prefix, sizeof(out_file_name)-1); strmake(pe, rev->new_log_ident, sizeof(out_file_name) - (pe-out_file_name)); /* If this is a fake Rotate event, and not about our log, we can stop transfer. If this a real Rotate event (so it's not about our log, it's in our log describing the next log), we print it (because it's part of our log) and then we will stop when we receive the fake one soon. */ if (rev->when == 0) { if (!to_last_remote_log) { if ((rev->ident_len != logname_len) || memcmp(rev->new_log_ident, logname, logname_len)) { ret_val= OK_EOF; } /* Otherwise, this is a fake Rotate for our log, at the very beginning for sure. Skip it, because it was not in the original log. If we are running with to_last_remote_log, we print it, because it serves as a useful marker between binlogs then. */ } *len= 1; // fake Rotate, so don't increment old_off ev->temp_buf= 0; delete ev; DBUG_RETURN(ret_val); } ev->temp_buf= 0; delete ev; } else /* if (type == FORMAT_DESCRIPTION_EVENT) */ { DBUG_ASSERT(type == FORMAT_DESCRIPTION_EVENT); if (result_file) my_fclose(result_file, MYF(0)); if (!(result_file= my_fopen(out_file_name, O_WRONLY | O_BINARY, MYF(MY_WME)))) { error("Could not create output log file: %s", out_file_name); DBUG_RETURN(ERROR_STOP); } /* TODO - add write error simulation here */ if (my_fwrite(result_file, (const uchar *) BINLOG_MAGIC, BIN_LOG_HEADER_SIZE, MYF(MY_NABP))) { error("Could not write into log file '%s'", out_file_name); DBUG_RETURN(ERROR_STOP); } print_event_info->file= result_file; delete glob_description_event; glob_description_event= (Format_description_log_event*) ev; print_event_info->common_header_len= glob_description_event->common_header_len; ev->temp_buf= 0; /* We do not want to delete the event here. */ } } if (my_fwrite(result_file, read_pos, *len - 1, MYF(MY_NABP))) { error("Could not write into log file '%s'", out_file_name); DBUG_RETURN(ERROR_STOP); } fflush(result_file); DBUG_RETURN(OK_CONTINUE); }
O0
cpp
handle_event_raw_mode(st_print_event_info*, unsigned long*, char const*, unsigned int): pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movl %ecx, -0x24(%rbp) movq 0x3e2097(%rip), %rax # 0x4459f8 movq 0x20(%rax), %rax addq $0x1, %rax movq %rax, -0x38(%rbp) jmp 0x6396f movq -0x38(%rbp), %rax movzbl 0x4(%rax), %eax movl %eax, -0x3c(%rbp) cmpl $0x1b, -0x3c(%rbp) jne 0x6398e jmp 0x63982 movl $0x0, -0x4(%rbp) jmp 0x63c7c cmpl $0x4, -0x3c(%rbp) je 0x6399e cmpl $0xf, -0x3c(%rbp) jne 0x63c25 movq -0x38(%rbp), %rdi movq -0x18(%rbp), %rax movq (%rax), %rax subq $0x1, %rax movl %eax, %esi movq 0x3e1c3a(%rip), %rcx # 0x4455f0 leaq -0x30(%rbp), %rdx movsbl 0x2266b6(%rip), %r8d # 0x28a078 callq 0x3c3f0 movq %rax, -0x48(%rbp) cmpq $0x0, %rax jne 0x63a07 movl -0x3c(%rbp), %ecx leaq 0xb08e5(%rip), %rsi # 0x1142c0 leaq 0xb08d7(%rip), %rax # 0x1142b9 cmpl $0x4, %ecx cmoveq %rax, %rsi movq -0x30(%rbp), %rdx leaq 0xb089d(%rip), %rdi # 0x114291 movb $0x0, %al callq 0x3c350 movl $0x1, -0x4(%rbp) jmp 0x63c7c movq -0x48(%rbp), %rdi movq -0x38(%rbp), %rsi xorl %edx, %edx callq 0x65370 cmpl $0x4, -0x3c(%rbp) jne 0x63b24 movl $0x0, -0x4c(%rbp) movq -0x48(%rbp), %rax movq %rax, -0x58(%rbp) movq 0x22668a(%rip), %rsi # 0x28a0c0 leaq 0x3e1fc3(%rip), %rdi # 0x445a00 movl $0x200, %edx # imm = 0x200 callq 0x10cb40 movq %rax, -0x60(%rbp) movq -0x60(%rbp), %rdi movq -0x58(%rbp), %rax movq 0x90(%rax), %rsi movq -0x60(%rbp), %rax leaq 0x3e1f9b(%rip), %rcx # 0x445a00 subq %rcx, %rax movl $0x201, %edx # imm = 0x201 subq %rax, %rdx callq 0x10cb40 movq -0x58(%rbp), %rax cmpq $0x0, 0x20(%rax) jne 0x63afb testb $0x1, 0x3e1e6a(%rip) # 0x4458f1 jne 0x63abf movq -0x58(%rbp), %rax movl 0xa0(%rax), %eax cmpl -0x24(%rbp), %eax jne 0x63ab6 movq -0x58(%rbp), %rax movq 0x90(%rax), %rdi movq -0x20(%rbp), %rsi movl -0x24(%rbp), %eax movl %eax, %edx callq 0x3bc80 cmpl $0x0, %eax je 0x63abd movl $0x3, -0x4c(%rbp) jmp 0x63abf movq -0x18(%rbp), %rax movq $0x1, (%rax) movq -0x48(%rbp), %rax movq $0x0, 0x10(%rax) movq -0x48(%rbp), %rax movq %rax, -0x68(%rbp) cmpq $0x0, %rax je 0x63aee movq -0x68(%rbp), %rdi movq (%rdi), %rax callq *0x30(%rax) jmp 0x63af0 movl -0x4c(%rbp), %eax movl %eax, -0x4(%rbp) jmp 0x63c7c movq -0x48(%rbp), %rax movq $0x0, 0x10(%rax) movq -0x48(%rbp), %rax movq %rax, -0x70(%rbp) cmpq $0x0, %rax je 0x63b1f movq -0x70(%rbp), %rdi movq (%rdi), %rax callq *0x30(%rax) jmp 0x63c23 jmp 0x63b26 jmp 0x63b28 cmpq $0x0, 0x3e1ad0(%rip) # 0x445600 je 0x63b42 movq 0x3e1ac7(%rip), %rdi # 0x445600 xorl %eax, %eax movl %eax, %esi callq 0xb5980 leaq 0x3e1eb7(%rip), %rdi # 0x445a00 movl $0x1, %esi movl $0x10, %edx callq 0xb5680 movq %rax, 0x3e1aa1(%rip) # 0x445600 cmpq $0x0, %rax jne 0x63b86 leaq 0xb0767(%rip), %rdi # 0x1142d3 leaq 0x3e1e8d(%rip), %rsi # 0x445a00 movb $0x0, %al callq 0x3c350 movl $0x1, -0x4(%rbp) jmp 0x63c7c movq 0x3e1a73(%rip), %rdi # 0x445600 leaq 0xb0764(%rip), %rsi # 0x1142f8 movl $0x4, %ecx movq %rcx, %rdx callq 0xb5db0 cmpq $0x0, %rax je 0x63bc8 leaq 0xb074f(%rip), %rdi # 0x1142fd leaq 0x3e1e4b(%rip), %rsi # 0x445a00 movb $0x0, %al callq 0x3c350 movl $0x1, -0x4(%rbp) jmp 0x63c7c movq 0x3e1a31(%rip), %rcx # 0x445600 movq -0x10(%rbp), %rax movq %rcx, 0x800(%rax) movq 0x3e1a0f(%rip), %rax # 0x4455f0 movq %rax, -0x78(%rbp) cmpq $0x0, %rax je 0x63bf5 movq -0x78(%rbp), %rdi movq (%rdi), %rax callq *0x30(%rax) movq -0x48(%rbp), %rax movq %rax, 0x3e19f0(%rip) # 0x4455f0 movq 0x3e19e9(%rip), %rax # 0x4455f0 movb 0xcd(%rax), %cl movq -0x10(%rbp), %rax movb %cl, 0x358(%rax) movq -0x48(%rbp), %rax movq $0x0, 0x10(%rax) jmp 0x63c25 movq 0x3e19d4(%rip), %rdi # 0x445600 movq -0x38(%rbp), %rsi movq -0x18(%rbp), %rax movq (%rax), %rdx subq $0x1, %rdx movl $0x4, %ecx callq 0xb5db0 cmpq $0x0, %rax je 0x63c69 leaq 0xb06ab(%rip), %rdi # 0x1142fd leaq 0x3e1da7(%rip), %rsi # 0x445a00 movb $0x0, %al callq 0x3c350 movl $0x1, -0x4(%rbp) jmp 0x63c7c movq 0x3e1990(%rip), %rdi # 0x445600 callq 0x3b570 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x80, %rsp popq %rbp retq nopl (%rax,%rax)
_ZL21handle_event_raw_modeP19st_print_event_infoPmPKcj: push rbp mov rbp, rsp sub rsp, 80h mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov [rbp+var_20], rdx mov [rbp+var_24], ecx mov rax, cs:_ZL5mysql; mysql mov rax, [rax+20h] add rax, 1 mov [rbp+var_38], rax jmp short $+2 loc_6396F: mov rax, [rbp+var_38] movzx eax, byte ptr [rax+4] mov [rbp+var_3C], eax cmp [rbp+var_3C], 1Bh jnz short loc_6398E jmp short $+2 loc_63982: mov [rbp+var_4], 0 jmp loc_63C7C loc_6398E: cmp [rbp+var_3C], 4 jz short loc_6399E cmp [rbp+var_3C], 0Fh jnz loc_63C25 loc_6399E: mov rdi, [rbp+var_38]; this mov rax, [rbp+var_18] mov rax, [rax] sub rax, 1 mov esi, eax; unsigned __int8 * mov rcx, cs:_ZL22glob_description_event; char ** lea rdx, [rbp+var_30]; unsigned int movsx r8d, cs:_ZL26opt_verify_binlog_checksum; Format_description_log_event * call _ZN9Log_event14read_log_eventEPKhjPPKcPK28Format_description_log_eventc; Log_event::read_log_event(uchar const*,uint,char const**,Format_description_log_event const*,char) mov [rbp+var_48], rax cmp rax, 0 jnz short loc_63A07 mov ecx, [rbp+var_3C] lea rsi, aFormatDescript; "format description" lea rax, aRotate_0; "rotate" cmp ecx, 4 cmovz rsi, rax mov rdx, qword ptr [rbp+var_30] lea rdi, aCouldNotConstr_1; "Could not construct %s event object: %s" mov al, 0 call _ZL5errorPKcz; error(char const*,...) mov [rbp+var_4], 1 jmp loc_63C7C loc_63A07: mov rdi, [rbp+var_48]; this mov rsi, [rbp+var_38]; unsigned __int8 * xor edx, edx; bool call _ZN9Log_event17register_temp_bufEPhb; Log_event::register_temp_buf(uchar *,bool) cmp [rbp+var_3C], 4 jnz loc_63B24 mov [rbp+var_4C], 0 mov rax, [rbp+var_48] mov [rbp+var_58], rax mov rsi, cs:_ZL13output_prefix; output_prefix lea rdi, _ZL13out_file_name; out_file_name mov edx, 200h call strmake mov [rbp+var_60], rax mov rdi, [rbp+var_60] mov rax, [rbp+var_58] mov rsi, [rax+90h] mov rax, [rbp+var_60] lea rcx, _ZL13out_file_name; out_file_name sub rax, rcx mov edx, 201h sub rdx, rax call strmake mov rax, [rbp+var_58] cmp qword ptr [rax+20h], 0 jnz short loc_63AFB test cs:_ZL18to_last_remote_log, 1; to_last_remote_log jnz short loc_63ABF mov rax, [rbp+var_58] mov eax, [rax+0A0h] cmp eax, [rbp+var_24] jnz short loc_63AB6 mov rax, [rbp+var_58] mov rdi, [rax+90h] mov rsi, [rbp+var_20] mov eax, [rbp+var_24] mov edx, eax call _memcmp cmp eax, 0 jz short loc_63ABD loc_63AB6: mov [rbp+var_4C], 3 loc_63ABD: jmp short $+2 loc_63ABF: mov rax, [rbp+var_18] mov qword ptr [rax], 1 mov rax, [rbp+var_48] mov qword ptr [rax+10h], 0 mov rax, [rbp+var_48] mov [rbp+var_68], rax cmp rax, 0 jz short loc_63AEE mov rdi, [rbp+var_68] mov rax, [rdi] call qword ptr [rax+30h] loc_63AEE: jmp short $+2 loc_63AF0: mov eax, [rbp+var_4C] mov [rbp+var_4], eax jmp loc_63C7C loc_63AFB: mov rax, [rbp+var_48] mov qword ptr [rax+10h], 0 mov rax, [rbp+var_48] mov [rbp+var_70], rax cmp rax, 0 jz short loc_63B1F mov rdi, [rbp+var_70] mov rax, [rdi] call qword ptr [rax+30h] loc_63B1F: jmp loc_63C23 loc_63B24: jmp short $+2 loc_63B26: jmp short $+2 loc_63B28: cmp cs:_ZL11result_file, 0; result_file jz short loc_63B42 mov rdi, cs:_ZL11result_file; result_file xor eax, eax mov esi, eax call my_fclose loc_63B42: lea rdi, _ZL13out_file_name; out_file_name mov esi, 1 mov edx, 10h call my_fopen mov cs:_ZL11result_file, rax; result_file cmp rax, 0 jnz short loc_63B86 lea rdi, aCouldNotCreate_0; "Could not create output log file: %s" lea rsi, _ZL13out_file_name; out_file_name mov al, 0 call _ZL5errorPKcz; error(char const*,...) mov [rbp+var_4], 1 jmp loc_63C7C loc_63B86: mov rdi, cs:_ZL11result_file; result_file lea rsi, unk_1142F8 mov ecx, 4 mov rdx, rcx call my_fwrite cmp rax, 0 jz short loc_63BC8 lea rdi, aCouldNotWriteI; "Could not write into log file '%s'" lea rsi, _ZL13out_file_name; out_file_name mov al, 0 call _ZL5errorPKcz; error(char const*,...) mov [rbp+var_4], 1 jmp loc_63C7C loc_63BC8: mov rcx, cs:_ZL11result_file; result_file mov rax, [rbp+var_10] mov [rax+800h], rcx mov rax, cs:_ZL22glob_description_event; glob_description_event mov [rbp+var_78], rax cmp rax, 0 jz short loc_63BF5 mov rdi, [rbp+var_78] mov rax, [rdi] call qword ptr [rax+30h] loc_63BF5: mov rax, [rbp+var_48] mov cs:_ZL22glob_description_event, rax; glob_description_event mov rax, cs:_ZL22glob_description_event; glob_description_event mov cl, [rax+0CDh] mov rax, [rbp+var_10] mov [rax+358h], cl mov rax, [rbp+var_48] mov qword ptr [rax+10h], 0 loc_63C23: jmp short $+2 loc_63C25: mov rdi, cs:_ZL11result_file; result_file mov rsi, [rbp+var_38] mov rax, [rbp+var_18] mov rdx, [rax] sub rdx, 1 mov ecx, 4 call my_fwrite cmp rax, 0 jz short loc_63C69 lea rdi, aCouldNotWriteI; "Could not write into log file '%s'" lea rsi, _ZL13out_file_name; out_file_name mov al, 0 call _ZL5errorPKcz; error(char const*,...) mov [rbp+var_4], 1 jmp short loc_63C7C loc_63C69: mov rdi, cs:_ZL11result_file; result_file call _fflush mov [rbp+var_4], 0 loc_63C7C: mov eax, [rbp+var_4] add rsp, 80h pop rbp retn
long long handle_event_raw_mode( st_print_event_info *a1, unsigned long long *a2, const char *a3, unsigned int a4, __m128 a5, __m128 a6, __m128 a7, __m128 a8, double a9, double a10, __m128 a11, __m128 a12) { long long v12; // r8 long long v13; // r9 __m128 v14; // xmm4 __m128 v15; // xmm5 const char *v16; // rsi long long v17; // rdx long long v18; // rcx long long v19; // r8 long long v20; // r9 __m128 v21; // xmm4 __m128 v22; // xmm5 long long v23; // rdx long long v24; // rcx long long v25; // r8 long long v26; // r9 __m128 v27; // xmm4 __m128 v28; // xmm5 char v30; // [rsp+0h] [rbp-80h] long long v31; // [rsp+20h] [rbp-60h] unsigned int v32; // [rsp+34h] [rbp-4Ch] Log_event *log_event; // [rsp+38h] [rbp-48h] unsigned int v34; // [rsp+44h] [rbp-3Ch] Log_event *v35; // [rsp+48h] [rbp-38h] unsigned int v36[2]; // [rsp+50h] [rbp-30h] BYREF unsigned int v37; // [rsp+5Ch] [rbp-24h] const char *v38; // [rsp+60h] [rbp-20h] unsigned long long *v39; // [rsp+68h] [rbp-18h] st_print_event_info *v40; // [rsp+70h] [rbp-10h] v40 = a1; v39 = a2; v38 = a3; v37 = a4; v35 = (Log_event *)(*(_QWORD *)(mysql + 32) + 1LL); v34 = *(unsigned __int8 *)(*(_QWORD *)(mysql + 32) + 5LL); if ( v34 == 27 ) return 0; if ( v34 != 4 && v34 != 15 ) goto LABEL_30; log_event = Log_event::read_log_event( v35, (unsigned int)(*(_DWORD *)v39 - 1), v36, (const char **)glob_description_event, (const Format_description_log_event *)(unsigned int)opt_verify_binlog_checksum); if ( !log_event ) { v16 = "format description"; if ( v34 == 4 ) v16 = "rotate"; error( "Could not construct %s event object: %s", (long long)v16, *(long long *)v36, v34, v12, v13, a5, a6, a7, a8, v14, v15, a11, a12, v30); return 1; } Log_event::register_temp_buf(log_event, (unsigned __int8 *)v35, 0); if ( v34 != 4 ) { if ( result_file ) my_fclose(result_file, 0LL); result_file = my_fopen(&out_file_name, 1LL, 16LL); if ( !result_file ) { error( "Could not create output log file: %s", (long long)&out_file_name, v17, v18, v19, v20, a5, a6, a7, a8, v21, v22, a11, a12, v30); return 1; } if ( my_fwrite(result_file, &unk_1142F8, 4LL, 4LL) ) { LABEL_26: error( "Could not write into log file '%s'", (long long)&out_file_name, v23, v24, v25, v26, a5, a6, a7, a8, v27, v28, a11, a12, v30); return 1; } *((_QWORD *)v40 + 256) = result_file; if ( glob_description_event ) (*((void ( **)(char **))*glob_description_event + 6))(glob_description_event); glob_description_event = (char **)log_event; *((_BYTE *)v40 + 856) = *((_BYTE *)log_event + 205); *((_QWORD *)log_event + 2) = 0LL; LABEL_30: if ( !my_fwrite(result_file, v35, *v39 - 1, 4LL) ) { fflush(result_file); return 0; } goto LABEL_26; } v32 = 0; v31 = strmake(&out_file_name, output_prefix, 512LL); strmake(v31, *((_QWORD *)log_event + 18), 513 - (v31 - (_QWORD)&out_file_name)); if ( *((_QWORD *)log_event + 4) ) { *((_QWORD *)log_event + 2) = 0LL; (*(void ( **)(Log_event *))(*(_QWORD *)log_event + 48LL))(log_event); goto LABEL_30; } if ( (to_last_remote_log & 1) == 0 && (*((_DWORD *)log_event + 40) != v37 || (unsigned int)memcmp(*((_QWORD *)log_event + 18), v38, v37)) ) { v32 = 3; } *v39 = 1LL; *((_QWORD *)log_event + 2) = 0LL; (*(void ( **)(Log_event *))(*(_QWORD *)log_event + 48LL))(log_event); return v32; }
handle_event_raw_mode: PUSH RBP MOV RBP,RSP SUB RSP,0x80 MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV qword ptr [RBP + -0x20],RDX MOV dword ptr [RBP + -0x24],ECX MOV RAX,qword ptr [0x005459f8] MOV RAX,qword ptr [RAX + 0x20] ADD RAX,0x1 MOV qword ptr [RBP + -0x38],RAX JMP 0x0016396f LAB_0016396f: MOV RAX,qword ptr [RBP + -0x38] MOVZX EAX,byte ptr [RAX + 0x4] MOV dword ptr [RBP + -0x3c],EAX CMP dword ptr [RBP + -0x3c],0x1b JNZ 0x0016398e JMP 0x00163982 LAB_00163982: MOV dword ptr [RBP + -0x4],0x0 JMP 0x00163c7c LAB_0016398e: CMP dword ptr [RBP + -0x3c],0x4 JZ 0x0016399e CMP dword ptr [RBP + -0x3c],0xf JNZ 0x00163c25 LAB_0016399e: MOV RDI,qword ptr [RBP + -0x38] MOV RAX,qword ptr [RBP + -0x18] MOV RAX,qword ptr [RAX] SUB RAX,0x1 MOV ESI,EAX MOV RCX,qword ptr [0x005455f0] LEA RDX,[RBP + -0x30] MOVSX R8D,byte ptr [0x0038a078] CALL 0x0013c3f0 MOV qword ptr [RBP + -0x48],RAX CMP RAX,0x0 JNZ 0x00163a07 MOV ECX,dword ptr [RBP + -0x3c] LEA RSI,[0x2142c0] LEA RAX,[0x2142b9] CMP ECX,0x4 CMOVZ RSI,RAX MOV RDX,qword ptr [RBP + -0x30] LEA RDI,[0x214291] MOV AL,0x0 CALL 0x0013c350 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00163c7c LAB_00163a07: MOV RDI,qword ptr [RBP + -0x48] MOV RSI,qword ptr [RBP + -0x38] XOR EDX,EDX CALL 0x00165370 CMP dword ptr [RBP + -0x3c],0x4 JNZ 0x00163b24 MOV dword ptr [RBP + -0x4c],0x0 MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RBP + -0x58],RAX MOV RSI,qword ptr [0x0038a0c0] LEA RDI,[0x545a00] MOV EDX,0x200 CALL 0x0020cb40 MOV qword ptr [RBP + -0x60],RAX MOV RDI,qword ptr [RBP + -0x60] MOV RAX,qword ptr [RBP + -0x58] MOV RSI,qword ptr [RAX + 0x90] MOV RAX,qword ptr [RBP + -0x60] LEA RCX,[0x545a00] SUB RAX,RCX MOV EDX,0x201 SUB RDX,RAX CALL 0x0020cb40 MOV RAX,qword ptr [RBP + -0x58] CMP qword ptr [RAX + 0x20],0x0 JNZ 0x00163afb TEST byte ptr [0x005458f1],0x1 JNZ 0x00163abf MOV RAX,qword ptr [RBP + -0x58] MOV EAX,dword ptr [RAX + 0xa0] CMP EAX,dword ptr [RBP + -0x24] JNZ 0x00163ab6 MOV RAX,qword ptr [RBP + -0x58] MOV RDI,qword ptr [RAX + 0x90] MOV RSI,qword ptr [RBP + -0x20] MOV EAX,dword ptr [RBP + -0x24] MOV EDX,EAX CALL 0x0013bc80 CMP EAX,0x0 JZ 0x00163abd LAB_00163ab6: MOV dword ptr [RBP + -0x4c],0x3 LAB_00163abd: JMP 0x00163abf LAB_00163abf: MOV RAX,qword ptr [RBP + -0x18] MOV qword ptr [RAX],0x1 MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RAX + 0x10],0x0 MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RBP + -0x68],RAX CMP RAX,0x0 JZ 0x00163aee MOV RDI,qword ptr [RBP + -0x68] MOV RAX,qword ptr [RDI] CALL qword ptr [RAX + 0x30] LAB_00163aee: JMP 0x00163af0 LAB_00163af0: MOV EAX,dword ptr [RBP + -0x4c] MOV dword ptr [RBP + -0x4],EAX JMP 0x00163c7c LAB_00163afb: MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RAX + 0x10],0x0 MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RBP + -0x70],RAX CMP RAX,0x0 JZ 0x00163b1f MOV RDI,qword ptr [RBP + -0x70] MOV RAX,qword ptr [RDI] CALL qword ptr [RAX + 0x30] LAB_00163b1f: JMP 0x00163c23 LAB_00163b24: JMP 0x00163b26 LAB_00163b26: JMP 0x00163b28 LAB_00163b28: CMP qword ptr [0x00545600],0x0 JZ 0x00163b42 MOV RDI,qword ptr [0x00545600] XOR EAX,EAX MOV ESI,EAX CALL 0x001b5980 LAB_00163b42: LEA RDI,[0x545a00] MOV ESI,0x1 MOV EDX,0x10 CALL 0x001b5680 MOV qword ptr [0x00545600],RAX CMP RAX,0x0 JNZ 0x00163b86 LEA RDI,[0x2142d3] LEA RSI,[0x545a00] MOV AL,0x0 CALL 0x0013c350 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00163c7c LAB_00163b86: MOV RDI,qword ptr [0x00545600] LEA RSI,[0x2142f8] MOV ECX,0x4 MOV RDX,RCX CALL 0x001b5db0 CMP RAX,0x0 JZ 0x00163bc8 LEA RDI,[0x2142fd] LEA RSI,[0x545a00] MOV AL,0x0 CALL 0x0013c350 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00163c7c LAB_00163bc8: MOV RCX,qword ptr [0x00545600] MOV RAX,qword ptr [RBP + -0x10] MOV qword ptr [RAX + 0x800],RCX MOV RAX,qword ptr [0x005455f0] MOV qword ptr [RBP + -0x78],RAX CMP RAX,0x0 JZ 0x00163bf5 MOV RDI,qword ptr [RBP + -0x78] MOV RAX,qword ptr [RDI] CALL qword ptr [RAX + 0x30] LAB_00163bf5: MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [0x005455f0],RAX MOV RAX,qword ptr [0x005455f0] MOV CL,byte ptr [RAX + 0xcd] MOV RAX,qword ptr [RBP + -0x10] MOV byte ptr [RAX + 0x358],CL MOV RAX,qword ptr [RBP + -0x48] MOV qword ptr [RAX + 0x10],0x0 LAB_00163c23: JMP 0x00163c25 LAB_00163c25: MOV RDI,qword ptr [0x00545600] MOV RSI,qword ptr [RBP + -0x38] MOV RAX,qword ptr [RBP + -0x18] MOV RDX,qword ptr [RAX] SUB RDX,0x1 MOV ECX,0x4 CALL 0x001b5db0 CMP RAX,0x0 JZ 0x00163c69 LEA RDI,[0x2142fd] LEA RSI,[0x545a00] MOV AL,0x0 CALL 0x0013c350 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00163c7c LAB_00163c69: MOV RDI,qword ptr [0x00545600] CALL 0x0013b570 MOV dword ptr [RBP + -0x4],0x0 LAB_00163c7c: MOV EAX,dword ptr [RBP + -0x4] ADD RSP,0x80 POP RBP RET
/* handle_event_raw_mode(st_print_event_info*, unsigned long*, char const*, unsigned int) */ bool handle_event_raw_mode(st_print_event_info *param_1,ulong *param_2,char *param_3,uint param_4) { char cVar1; int1 uVar2; int iVar3; uchar *puVar4; Log_event *this; long lVar5; char *pcVar6; char *local_38; uint local_2c; char *local_28; ulong *local_20; st_print_event_info *local_18; puVar4 = (uchar *)(*(long *)(mysql + 0x20) + 1); cVar1 = *(char *)(*(long *)(mysql + 0x20) + 5); if (cVar1 == '\x1b') { return false; } local_2c = param_4; local_28 = param_3; local_20 = param_2; local_18 = param_1; if ((cVar1 == '\x04') || (cVar1 == '\x0f')) { this = (Log_event *) Log_event::read_log_event (puVar4,(int)*param_2 - 1,&local_38, (Format_description_log_event *)glob_description_event, opt_verify_binlog_checksum); if (this == (Log_event *)0x0) { pcVar6 = "format description"; if (cVar1 == '\x04') { pcVar6 = "rotate"; } error("Could not construct %s event object: %s",pcVar6,local_38); return true; } Log_event::register_temp_buf(this,puVar4,false); if (cVar1 == '\x04') { uVar2 = 0; lVar5 = strmake(out_file_name,output_prefix,0x200); strmake(lVar5,*(int8 *)(this + 0x90),0x201 - (lVar5 + -0x545a00)); if (*(long *)(this + 0x20) == 0) { if (((to_last_remote_log & 1) == 0) && ((*(uint *)(this + 0xa0) != local_2c || (iVar3 = memcmp(*(void **)(this + 0x90),local_28,(ulong)local_2c), iVar3 != 0)))) { uVar2 = 3; } *local_20 = 1; *(int8 *)(this + 0x10) = 0; if (this != (Log_event *)0x0) { (**(code **)(*(long *)this + 0x30))(); } return (bool)uVar2; } *(int8 *)(this + 0x10) = 0; if (this != (Log_event *)0x0) { (**(code **)(*(long *)this + 0x30))(); } } else { if (result_file != (FILE *)0x0) { my_fclose(result_file,0); } result_file = (FILE *)my_fopen(out_file_name,1,0x10); if (result_file == (FILE *)0x0) { error("Could not create output log file: %s",out_file_name); return true; } lVar5 = my_fwrite(result_file,&DAT_002142f8,4); if (lVar5 != 0) { error("Could not write into log file \'%s\'",out_file_name); return true; } *(FILE **)(local_18 + 0x800) = result_file; if (glob_description_event != (Log_event *)0x0) { (**(code **)(*(long *)glob_description_event + 0x30))(); } glob_description_event = this; *(Log_event *)(local_18 + 0x358) = this[0xcd]; *(int8 *)(this + 0x10) = 0; } } lVar5 = my_fwrite(result_file,puVar4,*local_20 - 1,4); if (lVar5 == 0) { fflush(result_file); } else { error("Could not write into log file \'%s\'",out_file_name); } return lVar5 != 0; }
2,921
google::protobuf::Reflection::SetAllocatedMessage(google::protobuf::Message*, google::protobuf::Message*, google::protobuf::FieldDescriptor const*) const
aimrt_mujoco_sim/_deps/protobuf-src/src/google/protobuf/generated_message_reflection.cc
void Reflection::SetAllocatedMessage(Message* message, Message* sub_message, const FieldDescriptor* field) const { GOOGLE_DCHECK(sub_message == nullptr || sub_message->GetOwningArena() == nullptr || sub_message->GetOwningArena() == message->GetArenaForAllocation()); CheckInvalidAccess(schema_, field); // If message and sub-message are in different memory ownership domains // (different arenas, or one is on heap and one is not), then we may need to // do a copy. if (sub_message != nullptr && sub_message->GetOwningArena() != message->GetArenaForAllocation()) { if (sub_message->GetOwningArena() == nullptr && message->GetArenaForAllocation() != nullptr) { // Case 1: parent is on an arena and child is heap-allocated. We can add // the child to the arena's Own() list to free on arena destruction, then // set our pointer. message->GetArenaForAllocation()->Own(sub_message); UnsafeArenaSetAllocatedMessage(message, sub_message, field); } else { // Case 2: all other cases. We need to make a copy. MutableMessage() will // either get the existing message object, or instantiate a new one as // appropriate w.r.t. our arena. Message* sub_message_copy = MutableMessage(message, field); sub_message_copy->CopyFrom(*sub_message); } } else { // Same memory ownership domains. UnsafeArenaSetAllocatedMessage(message, sub_message, field); } }
O3
cpp
google::protobuf::Reflection::SetAllocatedMessage(google::protobuf::Message*, google::protobuf::Message*, google::protobuf::FieldDescriptor const*) const: pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rcx, %rbx movq %rsi, %r15 movq %rdi, %r12 testq %rdx, %rdx je 0x6aa9c movq %rdx, %r14 movq 0x8(%rdx), %rax testb $0x2, %al jne 0x6aaa6 testb $0x1, %al jne 0x6ab2d movq %rax, %rdx jmp 0x6aaa8 movq %r12, %rdi movq %r15, %rsi xorl %edx, %edx jmp 0x6aaef xorl %edx, %edx movq 0x8(%r15), %rcx movq %rcx, %rdi andq $-0x4, %rdi movq %rdi, %rsi testb $0x1, %cl jne 0x6ab28 cmpq %rsi, %rdx je 0x6aae6 testb $0x2, %al jne 0x6aacd testb $0x1, %al jne 0x6ab41 testq %rax, %rax jne 0x6ab02 testb $0x1, %cl jne 0x6ab3c testq %rdi, %rdi je 0x6ab02 leaq 0x583f(%rip), %rdx # 0x7031d movq %r14, %rsi callq 0x92b90 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx movq %rbx, %rcx addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x6a84a movq %r12, %rdi movq %r15, %rsi movq %rbx, %rdx xorl %ecx, %ecx callq 0x6a5f2 movq %rax, %rdi movq %r14, %rsi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x777fa movq (%rdi), %rsi jmp 0x6aabb movq %rax, %rcx andq $-0x4, %rcx movq (%rcx), %rdx jmp 0x6aaa8 movq (%rdi), %rdi jmp 0x6aad2 andq $-0x4, %rax movq (%rax), %rax jmp 0x6aac8 nop
_ZNK6google8protobuf10Reflection19SetAllocatedMessageEPNS0_7MessageES3_PKNS0_15FieldDescriptorE: push r15 push r14 push r12 push rbx push rax mov rbx, rcx mov r15, rsi mov r12, rdi test rdx, rdx jz short loc_6AA9C mov r14, rdx mov rax, [rdx+8] test al, 2 jnz short loc_6AAA6 test al, 1 jnz loc_6AB2D mov rdx, rax jmp short loc_6AAA8 loc_6AA9C: mov rdi, r12 mov rsi, r15 xor edx, edx jmp short loc_6AAEF loc_6AAA6: xor edx, edx loc_6AAA8: mov rcx, [r15+8] mov rdi, rcx and rdi, 0FFFFFFFFFFFFFFFCh; this mov rsi, rdi test cl, 1 jnz short loc_6AB28 loc_6AABB: cmp rdx, rsi jz short loc_6AAE6 test al, 2 jnz short loc_6AACD test al, 1 jnz short loc_6AB41 loc_6AAC8: test rax, rax jnz short loc_6AB02 loc_6AACD: test cl, 1 jnz short loc_6AB3C loc_6AAD2: test rdi, rdi jz short loc_6AB02 lea rdx, _ZN6google8protobuf8internal19arena_delete_objectINS0_11MessageLiteEEEvPv; void (*)(void *) mov rsi, r14; void * call _ZN6google8protobuf8internal15ThreadSafeArena10AddCleanupEPvPFvS3_E; google::protobuf::internal::ThreadSafeArena::AddCleanup(void *,void (*)(void *)) loc_6AAE6: mov rdi, r12; this mov rsi, r15; google::protobuf::Message * mov rdx, r14; google::protobuf::Message * loc_6AAEF: mov rcx, rbx; google::protobuf::FieldDescriptor * add rsp, 8 pop rbx pop r12 pop r14 pop r15 jmp _ZNK6google8protobuf10Reflection30UnsafeArenaSetAllocatedMessageEPNS0_7MessageES3_PKNS0_15FieldDescriptorE; google::protobuf::Reflection::UnsafeArenaSetAllocatedMessage(google::protobuf::Message *,google::protobuf::Message *,google::protobuf::FieldDescriptor const*) loc_6AB02: mov rdi, r12; this mov rsi, r15; google::protobuf::Message * mov rdx, rbx; google::protobuf::FieldDescriptor * xor ecx, ecx; google::protobuf::MessageFactory * call _ZNK6google8protobuf10Reflection14MutableMessageEPNS0_7MessageEPKNS0_15FieldDescriptorEPNS0_14MessageFactoryE; google::protobuf::Reflection::MutableMessage(google::protobuf::Message *,google::protobuf::FieldDescriptor const*,google::protobuf::MessageFactory *) mov rdi, rax; this mov rsi, r14; google::protobuf::Message * add rsp, 8 pop rbx pop r12 pop r14 pop r15 jmp _ZN6google8protobuf7Message8CopyFromERKS1_; google::protobuf::Message::CopyFrom(google::protobuf::Message const&) loc_6AB28: mov rsi, [rdi] jmp short loc_6AABB loc_6AB2D: mov rcx, rax and rcx, 0FFFFFFFFFFFFFFFCh mov rdx, [rcx] jmp loc_6AAA8 loc_6AB3C: mov rdi, [rdi] jmp short loc_6AAD2 loc_6AB41: and rax, 0FFFFFFFFFFFFFFFCh mov rax, [rax] jmp loc_6AAC8
long long google::protobuf::Reflection::SetAllocatedMessage( google::protobuf::_anonymous_namespace_ **this, google::protobuf::Message *a2, google::protobuf::Message *a3, const google::protobuf::FieldDescriptor *a4, const char *a5, long long a6) { google::protobuf::Message *v7; // r15 google::protobuf::Reflection *v8; // r12 long long v10; // rax long long v11; // rdx google::protobuf::Message *v12; // rdx long long v13; // rcx google::protobuf::internal::ThreadSafeArena *v14; // rdi unsigned long long v15; // rsi google::protobuf::Message *v17; // rax v7 = a2; v8 = (google::protobuf::Reflection *)this; if ( !a3 ) { v12 = 0LL; return google::protobuf::Reflection::UnsafeArenaSetAllocatedMessage(this, a2, v12, a4, a5, a6); } v10 = *((_QWORD *)a3 + 1); if ( (v10 & 2) != 0 ) { v11 = 0LL; } else if ( (v10 & 1) != 0 ) { v11 = *(_QWORD *)(v10 & 0xFFFFFFFFFFFFFFFCLL); } else { v11 = *((_QWORD *)a3 + 1); } v13 = *((_QWORD *)a2 + 1); v14 = (google::protobuf::internal::ThreadSafeArena *)(v13 & 0xFFFFFFFFFFFFFFFCLL); v15 = v13 & 0xFFFFFFFFFFFFFFFCLL; if ( (v13 & 1) != 0 ) v15 = *(_QWORD *)v14; if ( v11 == v15 ) { LABEL_18: this = (google::protobuf::_anonymous_namespace_ **)v8; a2 = v7; v12 = a3; return google::protobuf::Reflection::UnsafeArenaSetAllocatedMessage(this, a2, v12, a4, a5, a6); } if ( (v10 & 2) != 0 ) goto LABEL_16; if ( (v10 & 1) != 0 ) v10 = *(_QWORD *)(v10 & 0xFFFFFFFFFFFFFFFCLL); if ( !v10 ) { LABEL_16: if ( (v13 & 1) != 0 ) v14 = *(google::protobuf::internal::ThreadSafeArena **)v14; if ( v14 ) { google::protobuf::internal::ThreadSafeArena::AddCleanup( v14, a3, google::protobuf::internal::arena_delete_object<google::protobuf::MessageLite>); goto LABEL_18; } } v17 = (google::protobuf::Message *)google::protobuf::Reflection::MutableMessage( (google::protobuf::_anonymous_namespace_ **)v8, v7, a4, 0LL, a5, a6); return google::protobuf::Message::CopyFrom(v17, a3); }
SetAllocatedMessage: PUSH R15 PUSH R14 PUSH R12 PUSH RBX PUSH RAX MOV RBX,RCX MOV R15,RSI MOV R12,RDI TEST RDX,RDX JZ 0x0016aa9c MOV R14,RDX MOV RAX,qword ptr [RDX + 0x8] TEST AL,0x2 JNZ 0x0016aaa6 TEST AL,0x1 JNZ 0x0016ab2d MOV RDX,RAX JMP 0x0016aaa8 LAB_0016aa9c: MOV RDI,R12 MOV RSI,R15 XOR EDX,EDX JMP 0x0016aaef LAB_0016aaa6: XOR EDX,EDX LAB_0016aaa8: MOV RCX,qword ptr [R15 + 0x8] MOV RDI,RCX AND RDI,-0x4 MOV RSI,RDI TEST CL,0x1 JNZ 0x0016ab28 LAB_0016aabb: CMP RDX,RSI JZ 0x0016aae6 TEST AL,0x2 JNZ 0x0016aacd TEST AL,0x1 JNZ 0x0016ab41 LAB_0016aac8: TEST RAX,RAX JNZ 0x0016ab02 LAB_0016aacd: TEST CL,0x1 JNZ 0x0016ab3c LAB_0016aad2: TEST RDI,RDI JZ 0x0016ab02 LEA RDX,[0x17031d] MOV RSI,R14 CALL 0x00192b90 LAB_0016aae6: MOV RDI,R12 MOV RSI,R15 MOV RDX,R14 LAB_0016aaef: MOV RCX,RBX ADD RSP,0x8 POP RBX POP R12 POP R14 POP R15 JMP 0x0016a84a LAB_0016ab02: MOV RDI,R12 MOV RSI,R15 MOV RDX,RBX XOR ECX,ECX CALL 0x0016a5f2 MOV RDI,RAX MOV RSI,R14 ADD RSP,0x8 POP RBX POP R12 POP R14 POP R15 JMP 0x001777fa LAB_0016ab28: MOV RSI,qword ptr [RDI] JMP 0x0016aabb LAB_0016ab2d: MOV RCX,RAX AND RCX,-0x4 MOV RDX,qword ptr [RCX] JMP 0x0016aaa8 LAB_0016ab3c: MOV RDI,qword ptr [RDI] JMP 0x0016aad2 LAB_0016ab41: AND RAX,-0x4 MOV RAX,qword ptr [RAX] JMP 0x0016aac8
/* google::protobuf::Reflection::SetAllocatedMessage(google::protobuf::Message*, google::protobuf::Message*, google::protobuf::FieldDescriptor const*) const */ void __thiscall google::protobuf::Reflection::SetAllocatedMessage (Reflection *this,Message *param_1,Message *param_2,FieldDescriptor *param_3) { ulong uVar1; ThreadSafeArena *pTVar2; Message *this_00; ThreadSafeArena *pTVar3; ThreadSafeArena *pTVar4; ThreadSafeArena *this_01; if (param_2 == (Message *)0x0) { param_2 = (Message *)0x0; } else { pTVar2 = *(ThreadSafeArena **)(param_2 + 8); if (((ulong)pTVar2 & 2) == 0) { pTVar3 = pTVar2; if (((ulong)pTVar2 & 1) != 0) { pTVar3 = *(ThreadSafeArena **)((ulong)pTVar2 & 0xfffffffffffffffc); } } else { pTVar3 = (ThreadSafeArena *)0x0; } uVar1 = *(ulong *)(param_1 + 8); this_01 = (ThreadSafeArena *)(uVar1 & 0xfffffffffffffffc); pTVar4 = this_01; if ((uVar1 & 1) != 0) { pTVar4 = *(ThreadSafeArena **)this_01; } if (pTVar3 == pTVar4) goto LAB_0016aaef; if (((ulong)pTVar2 & 2) == 0) { if (((ulong)pTVar2 & 1) != 0) { pTVar2 = *(ThreadSafeArena **)((ulong)pTVar2 & 0xfffffffffffffffc); } if (pTVar2 != (ThreadSafeArena *)0x0) goto LAB_0016ab02; } if ((uVar1 & 1) != 0) { this_01 = *(ThreadSafeArena **)this_01; } if (this_01 == (ThreadSafeArena *)0x0) { LAB_0016ab02: this_00 = (Message *)MutableMessage(this,param_1,param_3,(MessageFactory *)0x0); Message::CopyFrom(this_00,param_2); return; } internal::ThreadSafeArena::AddCleanup (this_01,param_2,internal::arena_delete_object<google::protobuf::MessageLite>); } LAB_0016aaef: UnsafeArenaSetAllocatedMessage(this,param_1,param_2,param_3); return; }
2,922
JS_DetachArrayBuffer
bluesky950520[P]quickjs/quickjs.c
void JS_DetachArrayBuffer(JSContext *ctx, JSValue obj) { JSArrayBuffer *abuf = JS_GetOpaque(obj, JS_CLASS_ARRAY_BUFFER); struct list_head *el; if (!abuf || abuf->detached) return; if (abuf->free_func) abuf->free_func(ctx->rt, abuf->opaque, abuf->data); abuf->data = NULL; abuf->byte_length = 0; abuf->detached = TRUE; list_for_each(el, &abuf->array_list) { JSTypedArray *ta; JSObject *p; ta = list_entry(el, JSTypedArray, link); p = ta->obj; /* Note: the typed array length and offset fields are not modified */ if (p->class_id != JS_CLASS_DATAVIEW) { p->u.array.count = 0; p->u.array.u.ptr = NULL; } } }
O1
c
JS_DetachArrayBuffer: pushq %rbx subq $0x10, %rsp movq %rsi, 0x8(%rsp) cmpl $-0x1, %edx jne 0x38f18 movq 0x8(%rsp), %rax cmpw $0x13, 0x6(%rax) jne 0x38f18 movq 0x30(%rax), %rbx jmp 0x38f1a xorl %ebx, %ebx testq %rbx, %rbx je 0x38f25 cmpb $0x0, 0x8(%rbx) je 0x38f2b addq $0x10, %rsp popq %rbx retq movq 0x30(%rbx), %rax testq %rax, %rax je 0x38f42 movq 0x18(%rdi), %rdi movq 0x10(%rbx), %rdx movq 0x28(%rbx), %rsi callq *%rax movq $0x0, 0x10(%rbx) movl $0x0, (%rbx) movb $0x1, 0x8(%rbx) movq 0x20(%rbx), %rax addq $0x18, %rbx cmpq %rbx, %rax je 0x38f25 movq 0x10(%rax), %rcx cmpw $0x21, 0x6(%rcx) je 0x38f7b movl $0x0, 0x40(%rcx) movq $0x0, 0x38(%rcx) movq 0x8(%rax), %rax jmp 0x38f5c
JS_DetachArrayBuffer: push rbx sub rsp, 10h mov [rsp+18h+var_10], rsi cmp edx, 0FFFFFFFFh jnz short loc_38F18 mov rax, [rsp+18h+var_10] cmp word ptr [rax+6], 13h jnz short loc_38F18 mov rbx, [rax+30h] jmp short loc_38F1A loc_38F18: xor ebx, ebx loc_38F1A: test rbx, rbx jz short loc_38F25 cmp byte ptr [rbx+8], 0 jz short loc_38F2B loc_38F25: add rsp, 10h pop rbx retn loc_38F2B: mov rax, [rbx+30h] test rax, rax jz short loc_38F42 mov rdi, [rdi+18h] mov rdx, [rbx+10h] mov rsi, [rbx+28h] call rax loc_38F42: mov qword ptr [rbx+10h], 0 mov dword ptr [rbx], 0 mov byte ptr [rbx+8], 1 mov rax, [rbx+20h] add rbx, 18h loc_38F5C: cmp rax, rbx jz short loc_38F25 mov rcx, [rax+10h] cmp word ptr [rcx+6], 21h ; '!' jz short loc_38F7B mov dword ptr [rcx+40h], 0 mov qword ptr [rcx+38h], 0 loc_38F7B: mov rax, [rax+8] jmp short loc_38F5C
void JS_DetachArrayBuffer(long long a1, long long a2, int a3) { long long v3; // rbx void ( *v4)(_QWORD, _QWORD, _QWORD); // rax long long v5; // rax long long v6; // rbx long long v7; // rcx if ( a3 == -1 && *(_WORD *)(a2 + 6) == 19 ) v3 = *(_QWORD *)(a2 + 48); else v3 = 0LL; if ( v3 && !*(_BYTE *)(v3 + 8) ) { v4 = *(void ( **)(_QWORD, _QWORD, _QWORD))(v3 + 48); if ( v4 ) v4(*(_QWORD *)(a1 + 24), *(_QWORD *)(v3 + 40), *(_QWORD *)(v3 + 16)); *(_QWORD *)(v3 + 16) = 0LL; *(_DWORD *)v3 = 0; *(_BYTE *)(v3 + 8) = 1; v5 = *(_QWORD *)(v3 + 32); v6 = v3 + 24; while ( v5 != v6 ) { v7 = *(_QWORD *)(v5 + 16); if ( *(_WORD *)(v7 + 6) != 33 ) { *(_DWORD *)(v7 + 64) = 0; *(_QWORD *)(v7 + 56) = 0LL; } v5 = *(_QWORD *)(v5 + 8); } } }
JS_DetachArrayBuffer: PUSH RBX SUB RSP,0x10 MOV qword ptr [RSP + 0x8],RSI CMP EDX,-0x1 JNZ 0x00138f18 MOV RAX,qword ptr [RSP + 0x8] CMP word ptr [RAX + 0x6],0x13 JNZ 0x00138f18 MOV RBX,qword ptr [RAX + 0x30] JMP 0x00138f1a LAB_00138f18: XOR EBX,EBX LAB_00138f1a: TEST RBX,RBX JZ 0x00138f25 CMP byte ptr [RBX + 0x8],0x0 JZ 0x00138f2b LAB_00138f25: ADD RSP,0x10 POP RBX RET LAB_00138f2b: MOV RAX,qword ptr [RBX + 0x30] TEST RAX,RAX JZ 0x00138f42 MOV RDI,qword ptr [RDI + 0x18] MOV RDX,qword ptr [RBX + 0x10] MOV RSI,qword ptr [RBX + 0x28] CALL RAX LAB_00138f42: MOV qword ptr [RBX + 0x10],0x0 MOV dword ptr [RBX],0x0 MOV byte ptr [RBX + 0x8],0x1 MOV RAX,qword ptr [RBX + 0x20] ADD RBX,0x18 LAB_00138f5c: CMP RAX,RBX JZ 0x00138f25 MOV RCX,qword ptr [RAX + 0x10] CMP word ptr [RCX + 0x6],0x21 JZ 0x00138f7b MOV dword ptr [RCX + 0x40],0x0 MOV qword ptr [RCX + 0x38],0x0 LAB_00138f7b: MOV RAX,qword ptr [RAX + 0x8] JMP 0x00138f5c
void JS_DetachArrayBuffer(long param_1,long param_2,int param_3) { long lVar1; int4 *puVar2; int4 *puVar3; if ((param_3 == -1) && (*(short *)(param_2 + 6) == 0x13)) { puVar3 = *(int4 **)(param_2 + 0x30); } else { puVar3 = (int4 *)0x0; } if ((puVar3 != (int4 *)0x0) && (*(char *)(puVar3 + 2) == '\0')) { if (*(code **)(puVar3 + 0xc) != (code *)0x0) { (**(code **)(puVar3 + 0xc)) (*(int8 *)(param_1 + 0x18),*(int8 *)(puVar3 + 10), *(int8 *)(puVar3 + 4)); } *(int8 *)(puVar3 + 4) = 0; *puVar3 = 0; *(int1 *)(puVar3 + 2) = 1; for (puVar2 = *(int4 **)(puVar3 + 8); puVar2 != puVar3 + 6; puVar2 = *(int4 **)(puVar2 + 2)) { lVar1 = *(long *)(puVar2 + 4); if (*(short *)(lVar1 + 6) != 0x21) { *(int4 *)(lVar1 + 0x40) = 0; *(int8 *)(lVar1 + 0x38) = 0; } } } return; }
2,923
JS_DetachArrayBuffer
bluesky950520[P]quickjs/quickjs.c
void JS_DetachArrayBuffer(JSContext *ctx, JSValue obj) { JSArrayBuffer *abuf = JS_GetOpaque(obj, JS_CLASS_ARRAY_BUFFER); struct list_head *el; if (!abuf || abuf->detached) return; if (abuf->free_func) abuf->free_func(ctx->rt, abuf->opaque, abuf->data); abuf->data = NULL; abuf->byte_length = 0; abuf->detached = TRUE; list_for_each(el, &abuf->array_list) { JSTypedArray *ta; JSObject *p; ta = list_entry(el, JSTypedArray, link); p = ta->obj; /* Note: the typed array length and offset fields are not modified */ if (p->class_id != JS_CLASS_DATAVIEW) { p->u.array.count = 0; p->u.array.u.ptr = NULL; } } }
O2
c
JS_DetachArrayBuffer: cmpl $-0x1, %edx jne 0x3206a pushq %rbx cmpw $0x13, 0x6(%rsi) jne 0x32069 movq 0x30(%rsi), %rbx testq %rbx, %rbx je 0x32069 cmpb $0x0, 0x8(%rbx) je 0x3206b popq %rbx retq movq 0x30(%rbx), %rax testq %rax, %rax je 0x32082 movq 0x18(%rdi), %rdi movq 0x10(%rbx), %rdx movq 0x28(%rbx), %rsi callq *%rax andq $0x0, 0x10(%rbx) andl $0x0, (%rbx) movb $0x1, 0x8(%rbx) leaq 0x18(%rbx), %rax addq $0x20, %rbx movq (%rbx), %rbx cmpq %rax, %rbx je 0x32069 movq 0x10(%rbx), %rcx cmpw $0x21, 0x6(%rcx) je 0x320b2 andl $0x0, 0x40(%rcx) andq $0x0, 0x38(%rcx) addq $0x8, %rbx jmp 0x32096
JS_DetachArrayBuffer: cmp edx, 0FFFFFFFFh jnz short locret_3206A push rbx cmp word ptr [rsi+6], 13h jnz short loc_32069 mov rbx, [rsi+30h] test rbx, rbx jz short loc_32069 cmp byte ptr [rbx+8], 0 jz short loc_3206B loc_32069: pop rbx locret_3206A: retn loc_3206B: mov rax, [rbx+30h] test rax, rax jz short loc_32082 mov rdi, [rdi+18h] mov rdx, [rbx+10h] mov rsi, [rbx+28h] call rax loc_32082: and qword ptr [rbx+10h], 0 and dword ptr [rbx], 0 mov byte ptr [rbx+8], 1 lea rax, [rbx+18h] add rbx, 20h ; ' ' loc_32096: mov rbx, [rbx] cmp rbx, rax jz short loc_32069 mov rcx, [rbx+10h] cmp word ptr [rcx+6], 21h ; '!' jz short loc_320B2 and dword ptr [rcx+40h], 0 and qword ptr [rcx+38h], 0 loc_320B2: add rbx, 8 jmp short loc_32096
void JS_DetachArrayBuffer(long long a1, long long a2, int a3) { long long v3; // rbx void ( *v4)(_QWORD, _QWORD, _QWORD); // rax long long v5; // rax long long *i; // rbx long long v7; // rbx long long v8; // rcx if ( a3 == -1 && *(_WORD *)(a2 + 6) == 19 ) { v3 = *(_QWORD *)(a2 + 48); if ( v3 ) { if ( !*(_BYTE *)(v3 + 8) ) { v4 = *(void ( **)(_QWORD, _QWORD, _QWORD))(v3 + 48); if ( v4 ) v4(*(_QWORD *)(a1 + 24), *(_QWORD *)(v3 + 40), *(_QWORD *)(v3 + 16)); *(_QWORD *)(v3 + 16) = 0LL; *(_DWORD *)v3 = 0; *(_BYTE *)(v3 + 8) = 1; v5 = v3 + 24; for ( i = (long long *)(v3 + 32); ; i = (long long *)(v7 + 8) ) { v7 = *i; if ( v7 == v5 ) break; v8 = *(_QWORD *)(v7 + 16); if ( *(_WORD *)(v8 + 6) != 33 ) { *(_DWORD *)(v8 + 64) = 0; *(_QWORD *)(v8 + 56) = 0LL; } } } } } }
JS_DetachArrayBuffer: CMP EDX,-0x1 JNZ 0x0013206a PUSH RBX CMP word ptr [RSI + 0x6],0x13 JNZ 0x00132069 MOV RBX,qword ptr [RSI + 0x30] TEST RBX,RBX JZ 0x00132069 CMP byte ptr [RBX + 0x8],0x0 JZ 0x0013206b LAB_00132069: POP RBX LAB_0013206a: RET LAB_0013206b: MOV RAX,qword ptr [RBX + 0x30] TEST RAX,RAX JZ 0x00132082 MOV RDI,qword ptr [RDI + 0x18] MOV RDX,qword ptr [RBX + 0x10] MOV RSI,qword ptr [RBX + 0x28] CALL RAX LAB_00132082: AND qword ptr [RBX + 0x10],0x0 AND dword ptr [RBX],0x0 MOV byte ptr [RBX + 0x8],0x1 LEA RAX,[RBX + 0x18] ADD RBX,0x20 LAB_00132096: MOV RBX,qword ptr [RBX] CMP RBX,RAX JZ 0x00132069 MOV RCX,qword ptr [RBX + 0x10] CMP word ptr [RCX + 0x6],0x21 JZ 0x001320b2 AND dword ptr [RCX + 0x40],0x0 AND qword ptr [RCX + 0x38],0x0 LAB_001320b2: ADD RBX,0x8 JMP 0x00132096
void JS_DetachArrayBuffer(long param_1,long param_2,int param_3) { int4 *puVar1; int4 *puVar2; long lVar3; int8 *puVar4; if ((((param_3 == -1) && (*(short *)(param_2 + 6) == 0x13)) && (puVar1 = *(int4 **)(param_2 + 0x30), puVar1 != (int4 *)0x0)) && (*(char *)(puVar1 + 2) == '\0')) { if (*(code **)(puVar1 + 0xc) != (code *)0x0) { (**(code **)(puVar1 + 0xc)) (*(int8 *)(param_1 + 0x18),*(int8 *)(puVar1 + 10), *(int8 *)(puVar1 + 4)); } *(int8 *)(puVar1 + 4) = 0; *puVar1 = 0; *(int1 *)(puVar1 + 2) = 1; puVar4 = (int8 *)(puVar1 + 8); while (puVar2 = (int4 *)*puVar4, puVar2 != puVar1 + 6) { lVar3 = *(long *)(puVar2 + 4); if (*(short *)(lVar3 + 6) != 0x21) { *(int4 *)(lVar3 + 0x40) = 0; *(int8 *)(lVar3 + 0x38) = 0; } puVar4 = (int8 *)(puVar2 + 2); } } return; }
2,924
llava_image_embed_make_with_bytes
llama.cpp/examples/llava/llava.cpp
struct llava_image_embed * llava_image_embed_make_with_bytes(struct clip_ctx * ctx_clip, int n_threads, const unsigned char * image_bytes, int image_bytes_length) { clip_image_u8 * img = clip_image_u8_init(); if (!clip_image_load_from_bytes(image_bytes, image_bytes_length, img)) { clip_image_u8_free(img); LOG_ERR("%s: can't load image from bytes, is it a valid image?", __func__); return NULL; } float* image_embed = NULL; int n_image_pos = 0; bool image_embed_result = llava_image_embed_make_with_clip_img(ctx_clip, n_threads, img, &image_embed, &n_image_pos); if (!image_embed_result) { clip_image_u8_free(img); LOG_ERR("%s: couldn't embed the image\n", __func__); return NULL; } clip_image_u8_free(img); auto result = (llava_image_embed*)malloc(sizeof(llava_image_embed)); result->embed = image_embed; result->n_image_pos = n_image_pos; return result; }
O3
cpp
llava_image_embed_make_with_bytes: pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movl %ecx, %r15d movq %rdx, %r12 movl %esi, %ebp movq %rdi, %r14 callq 0x1e8e0 movq %rax, %rbx movslq %r15d, %rsi movq %r12, %rdi movq %rax, %rdx callq 0x1d7a0 testb %al, %al je 0x2027a leaq 0x8(%rsp), %rcx movq $0x0, (%rcx) leaq 0x4(%rsp), %r8 movl $0x0, (%r8) movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx callq 0x1c250 movl %eax, %ebp movq %rbx, %rdi callq 0x1c600 testb %bpl, %bpl je 0x20284 movl $0x10, %edi callq 0x1dae0 movq 0x8(%rsp), %rcx movq %rcx, (%rax) movl 0x4(%rsp), %ecx movl %ecx, 0x8(%rax) addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi callq 0x1ebca jmp 0x20289 callq 0x1ebf0 xorl %eax, %eax jmp 0x2026d
llava_image_embed_make_with_bytes: push rbp; int push r15; void * push r14; int push r12; int push rbx; int sub rsp, 10h mov r15d, ecx mov r12, rdx mov ebp, esi mov r14, rdi call _clip_image_u8_init mov rbx, rax movsxd rsi, r15d mov rdi, r12 mov rdx, rax call _clip_image_load_from_bytes test al, al jz short loc_2027A lea rcx, [rsp+38h+var_30]; int mov qword ptr [rcx], 0 lea r8, [rsp+38h+var_34]; int mov dword ptr [r8], 0 mov rdi, r14; int mov esi, ebp; int mov rdx, rbx; int call _llava_image_embed_make_with_clip_img mov ebp, eax mov rdi, rbx; void * call _clip_image_u8_free test bpl, bpl jz short loc_20284 mov edi, 10h call _malloc mov rcx, qword ptr [rsp+38h+var_30] mov [rax], rcx mov ecx, [rsp+38h+var_34] mov [rax+8], ecx loc_2026D: add rsp, 10h pop rbx pop r12 pop r14 pop r15 pop rbp retn loc_2027A: mov rdi, rbx call llava_image_embed_make_with_bytes_cold_1 jmp short loc_20289 loc_20284: call llava_image_embed_make_with_bytes_cold_2 loc_20289: xor eax, eax jmp short loc_2026D
llava_image_embed_make_with_bytes: PUSH RBP PUSH R15 PUSH R14 PUSH R12 PUSH RBX SUB RSP,0x10 MOV R15D,ECX MOV R12,RDX MOV EBP,ESI MOV R14,RDI CALL 0x0011e8e0 MOV RBX,RAX MOVSXD RSI,R15D MOV RDI,R12 MOV RDX,RAX CALL 0x0011d7a0 TEST AL,AL JZ 0x0012027a LEA RCX,[RSP + 0x8] MOV qword ptr [RCX],0x0 LEA R8,[RSP + 0x4] MOV dword ptr [R8],0x0 MOV RDI,R14 MOV ESI,EBP MOV RDX,RBX CALL 0x0011c250 MOV EBP,EAX MOV RDI,RBX CALL 0x0011c600 TEST BPL,BPL JZ 0x00120284 MOV EDI,0x10 CALL 0x0011dae0 MOV RCX,qword ptr [RSP + 0x8] MOV qword ptr [RAX],RCX MOV ECX,dword ptr [RSP + 0x4] MOV dword ptr [RAX + 0x8],ECX LAB_0012026d: ADD RSP,0x10 POP RBX POP R12 POP R14 POP R15 POP RBP RET LAB_0012027a: MOV RDI,RBX CALL 0x0011ebca JMP 0x00120289 LAB_00120284: CALL 0x0011ebf0 LAB_00120289: XOR EAX,EAX JMP 0x0012026d
int8 * llava_image_embed_make_with_bytes (int8 param_1,int4 param_2,int8 param_3,int param_4) { char cVar1; int8 uVar2; int8 *puVar3; uVar2 = clip_image_u8_init(); cVar1 = clip_image_load_from_bytes(param_3,(long)param_4,uVar2); if (cVar1 == '\0') { llava_image_embed_make_with_bytes_cold_1(uVar2); } else { cVar1 = llava_image_embed_make_with_clip_img(param_1,param_2,uVar2); clip_image_u8_free(uVar2); if (cVar1 != '\0') { puVar3 = (int8 *)malloc(0x10); *puVar3 = 0; *(int4 *)(puVar3 + 1) = 0; return puVar3; } llava_image_embed_make_with_bytes_cold_2(); } return (int8 *)0x0; }
2,925
usage
eloqsql/libmariadb/unittest/libmariadb/my_test.h
static void usage() { printf("Execute test with the following options:\n"); printf("-h hostname\n"); printf("-u username\n"); printf("-p password\n"); printf("-d database\n"); printf("-S socketname\n"); printf("-t force use of TLS\n"); printf("-P port number\n"); printf("? displays this help and exits\n"); }
O3
c
usage: pushq %rbp movq %rsp, %rbp leaq 0x1fd3b(%rip), %rsi # 0x36876 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd52(%rip), %rsi # 0x368a0 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd4c(%rip), %rsi # 0x368ad movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd46(%rip), %rsi # 0x368ba movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd40(%rip), %rsi # 0x368c7 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd3a(%rip), %rsi # 0x368d4 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd36(%rip), %rsi # 0x368e3 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd38(%rip), %rsi # 0x368f8 movl $0x1, %edi xorl %eax, %eax callq 0x13030 leaq 0x1fd35(%rip), %rsi # 0x36908 movl $0x1, %edi xorl %eax, %eax popq %rbp jmp 0x13030
usage: push rbp mov rbp, rsp lea rsi, aExecuteTestWit; "Execute test with the following options"... mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aHHostname; "-h hostname\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aUUsername; "-u username\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aPPassword; "-p password\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aDDatabase; "-d database\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aSSocketname; "-S socketname\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aTForceUseOfTls; "-t force use of TLS\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aPPortNumber; "-P port number\n" mov edi, 1 xor eax, eax call ___printf_chk lea rsi, aDisplaysThisHe; "? displays this help and exits\n" mov edi, 1 xor eax, eax pop rbp jmp ___printf_chk
long long usage() { __printf_chk(1LL, "Execute test with the following options:\n"); __printf_chk(1LL, "-h hostname\n"); __printf_chk(1LL, "-u username\n"); __printf_chk(1LL, "-p password\n"); __printf_chk(1LL, "-d database\n"); __printf_chk(1LL, "-S socketname\n"); __printf_chk(1LL, "-t force use of TLS\n"); __printf_chk(1LL, "-P port number\n"); return __printf_chk(1LL, "? displays this help and exits\n"); }
usage: PUSH RBP MOV RBP,RSP LEA RSI,[0x136876] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368a0] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368ad] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368ba] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368c7] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368d4] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368e3] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x1368f8] MOV EDI,0x1 XOR EAX,EAX CALL 0x00113030 LEA RSI,[0x136908] MOV EDI,0x1 XOR EAX,EAX POP RBP JMP 0x00113030
void usage(void) { __printf_chk(1,"Execute test with the following options:\n"); __printf_chk(1,"-h hostname\n"); __printf_chk(1,"-u username\n"); __printf_chk(1,"-p password\n"); __printf_chk(1,"-d database\n"); __printf_chk(1,"-S socketname\n"); __printf_chk(1,"-t force use of TLS\n"); __printf_chk(1,"-P port number\n"); __printf_chk(1,"? displays this help and exits\n"); return; }
2,926
ImDrawList3D::PrimReserve(int, int)
zkingston[P]unknot/build_O1/_deps/implot3d-src/implot3d.cpp
void ImDrawList3D::PrimReserve(int idx_count, int vtx_count) { IM_ASSERT_PARANOID(idx_count >= 0 && vtx_count >= 0 && idx_count % 3 == 0); int vtx_buffer_old_size = VtxBuffer.Size; VtxBuffer.resize(vtx_buffer_old_size + vtx_count); _VtxWritePtr = VtxBuffer.Data + vtx_buffer_old_size; int idx_buffer_old_size = IdxBuffer.Size; IdxBuffer.resize(idx_buffer_old_size + idx_count); _IdxWritePtr = IdxBuffer.Data + idx_buffer_old_size; int z_buffer_old_size = ZBuffer.Size; ZBuffer.resize(z_buffer_old_size + idx_count / 3); _ZWritePtr = ZBuffer.Data + z_buffer_old_size; }
O1
cpp
ImDrawList3D::PrimReserve(int, int): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, %ebp movl %esi, %r14d movq %rdi, %rbx movslq 0x10(%rdi), %r12 addl %r12d, %ebp movl 0x14(%rdi), %eax cmpl %ebp, %eax jge 0x54da0 testl %eax, %eax je 0x54d4d movl %eax, %r13d shrl $0x1f, %r13d addl %eax, %r13d sarl %r13d addl %eax, %r13d jmp 0x54d53 movl $0x8, %r13d cmpl %ebp, %r13d cmovlel %ebp, %r13d cmpl %r13d, %eax jge 0x54da0 movslq %r13d, %rax shlq $0x2, %rax leaq (%rax,%rax,4), %rdi callq 0x2130dc movq %rax, %r15 movq 0x18(%rbx), %rsi testq %rsi, %rsi je 0x54d98 movslq 0x10(%rbx), %rax shlq $0x2, %rax leaq (%rax,%rax,4), %rdx movq %r15, %rdi callq 0xf810 movq 0x18(%rbx), %rdi callq 0x21318e movq %r15, 0x18(%rbx) movl %r13d, 0x14(%rbx) movl %ebp, 0x10(%rbx) leaq (%r12,%r12,4), %rax shlq $0x2, %rax addq 0x18(%rbx), %rax movq %rax, 0x38(%rbx) movslq (%rbx), %r12 leal (%r12,%r14), %ebp movl 0x4(%rbx), %eax cmpl %ebp, %eax jge 0x54e1f testl %eax, %eax je 0x54dd7 movl %eax, %r13d shrl $0x1f, %r13d addl %eax, %r13d sarl %r13d addl %eax, %r13d jmp 0x54ddd movl $0x8, %r13d cmpl %ebp, %r13d cmovlel %ebp, %r13d cmpl %r13d, %eax jge 0x54e1f movslq %r13d, %rdi addq %rdi, %rdi callq 0x2130dc movq %rax, %r15 movq 0x8(%rbx), %rsi testq %rsi, %rsi je 0x54e17 movslq (%rbx), %rdx addq %rdx, %rdx movq %r15, %rdi callq 0xf810 movq 0x8(%rbx), %rdi callq 0x21318e movq %r15, 0x8(%rbx) movl %r13d, 0x4(%rbx) movl %ebp, (%rbx) addq %r12, %r12 addq 0x8(%rbx), %r12 movq %r12, 0x40(%rbx) movslq 0x20(%rbx), %r15 movslq %r14d, %rax imulq $0x55555556, %rax, %r12 # imm = 0x55555556 movq %r12, %rax shrq $0x3f, %rax shrq $0x20, %r12 addl %eax, %r12d addl %r15d, %r12d movl 0x24(%rbx), %eax cmpl %r12d, %eax jge 0x54eac testl %eax, %eax je 0x54e64 movl %eax, %ebp shrl $0x1f, %ebp addl %eax, %ebp sarl %ebp addl %eax, %ebp jmp 0x54e69 movl $0x8, %ebp cmpl %r12d, %ebp cmovlel %r12d, %ebp cmpl %ebp, %eax jge 0x54eac movslq %ebp, %rdi shlq $0x2, %rdi callq 0x2130dc movq %rax, %r14 movq 0x28(%rbx), %rsi testq %rsi, %rsi je 0x54ea5 movslq 0x20(%rbx), %rdx shlq $0x2, %rdx movq %r14, %rdi callq 0xf810 movq 0x28(%rbx), %rdi callq 0x21318e movq %r14, 0x28(%rbx) movl %ebp, 0x24(%rbx) movl %r12d, 0x20(%rbx) shlq $0x2, %r15 addq 0x28(%rbx), %r15 movq %r15, 0x48(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
_ZN12ImDrawList3D11PrimReserveEii: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov ebp, edx mov r14d, esi mov rbx, rdi movsxd r12, dword ptr [rdi+10h] add ebp, r12d mov eax, [rdi+14h] cmp eax, ebp jge short loc_54DA0 test eax, eax jz short loc_54D4D mov r13d, eax shr r13d, 1Fh add r13d, eax sar r13d, 1 add r13d, eax jmp short loc_54D53 loc_54D4D: mov r13d, 8 loc_54D53: cmp r13d, ebp cmovle r13d, ebp cmp eax, r13d jge short loc_54DA0 movsxd rax, r13d shl rax, 2 lea rdi, [rax+rax*4]; this call _ZN5ImGui8MemAllocEm; ImGui::MemAlloc(ulong) mov r15, rax mov rsi, [rbx+18h]; unsigned __int64 test rsi, rsi jz short loc_54D98 movsxd rax, dword ptr [rbx+10h] shl rax, 2 lea rdx, [rax+rax*4] mov rdi, r15 call _memcpy mov rdi, [rbx+18h]; this call _ZN5ImGui7MemFreeEPv; ImGui::MemFree(void *) loc_54D98: mov [rbx+18h], r15 mov [rbx+14h], r13d loc_54DA0: mov [rbx+10h], ebp lea rax, [r12+r12*4] shl rax, 2 add rax, [rbx+18h] mov [rbx+38h], rax movsxd r12, dword ptr [rbx] lea ebp, [r12+r14] mov eax, [rbx+4] cmp eax, ebp jge short loc_54E1F test eax, eax jz short loc_54DD7 mov r13d, eax shr r13d, 1Fh add r13d, eax sar r13d, 1 add r13d, eax jmp short loc_54DDD loc_54DD7: mov r13d, 8 loc_54DDD: cmp r13d, ebp cmovle r13d, ebp cmp eax, r13d jge short loc_54E1F movsxd rdi, r13d add rdi, rdi; this call _ZN5ImGui8MemAllocEm; ImGui::MemAlloc(ulong) mov r15, rax mov rsi, [rbx+8]; unsigned __int64 test rsi, rsi jz short loc_54E17 movsxd rdx, dword ptr [rbx] add rdx, rdx mov rdi, r15 call _memcpy mov rdi, [rbx+8]; this call _ZN5ImGui7MemFreeEPv; ImGui::MemFree(void *) loc_54E17: mov [rbx+8], r15 mov [rbx+4], r13d loc_54E1F: mov [rbx], ebp add r12, r12 add r12, [rbx+8] mov [rbx+40h], r12 movsxd r15, dword ptr [rbx+20h] movsxd rax, r14d imul r12, rax, 55555556h mov rax, r12 shr rax, 3Fh shr r12, 20h add r12d, eax add r12d, r15d mov eax, [rbx+24h] cmp eax, r12d jge short loc_54EAC test eax, eax jz short loc_54E64 mov ebp, eax shr ebp, 1Fh add ebp, eax sar ebp, 1 add ebp, eax jmp short loc_54E69 loc_54E64: mov ebp, 8 loc_54E69: cmp ebp, r12d cmovle ebp, r12d cmp eax, ebp jge short loc_54EAC movsxd rdi, ebp shl rdi, 2; this call _ZN5ImGui8MemAllocEm; ImGui::MemAlloc(ulong) mov r14, rax mov rsi, [rbx+28h]; void * test rsi, rsi jz short loc_54EA5 movsxd rdx, dword ptr [rbx+20h] shl rdx, 2 mov rdi, r14 call _memcpy mov rdi, [rbx+28h]; this call _ZN5ImGui7MemFreeEPv; ImGui::MemFree(void *) loc_54EA5: mov [rbx+28h], r14 mov [rbx+24h], ebp loc_54EAC: mov [rbx+20h], r12d shl r15, 2 add r15, [rbx+28h] mov [rbx+48h], r15 add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long ImDrawList3D::PrimReserve(ImDrawList3D *this, void *a2, int a3) { int v3; // r14d long long v4; // r12 int v5; // ebp int v6; // eax int v7; // r13d long long v8; // r15 long long v9; // r12 int v10; // ebp int v11; // eax int v12; // r13d long long v13; // rax long long v14; // r15 long long v15; // r15 int v16; // r12d long long result; // rax int v18; // ebp long long v19; // r14 void *v20; // rsi v3 = (int)a2; v4 = *((int *)this + 4); v5 = v4 + a3; v6 = *((_DWORD *)this + 5); if ( v6 < (int)v4 + a3 ) { if ( v6 ) v7 = v6 + v6 / 2; else v7 = 8; if ( v7 <= v5 ) v7 = v4 + a3; if ( v6 < v7 ) { v8 = ImGui::MemAlloc((ImGui *)(20LL * v7), (unsigned long long)a2); a2 = (void *)*((_QWORD *)this + 3); if ( a2 ) { memcpy(v8, a2, 20LL * *((int *)this + 4)); ImGui::MemFree(*((ImGui **)this + 3), a2); } *((_QWORD *)this + 3) = v8; *((_DWORD *)this + 5) = v7; } } *((_DWORD *)this + 4) = v5; *((_QWORD *)this + 7) = *((_QWORD *)this + 3) + 20 * v4; v9 = *(int *)this; v10 = v9 + v3; v11 = *((_DWORD *)this + 1); if ( v11 < (int)v9 + v3 ) { if ( v11 ) v12 = v11 + v11 / 2; else v12 = 8; if ( v12 <= v10 ) v12 = v9 + v3; if ( v11 < v12 ) { v13 = ImGui::MemAlloc((ImGui *)(2LL * v12), (unsigned long long)a2); v14 = v13; a2 = (void *)*((_QWORD *)this + 1); if ( a2 ) { memcpy(v13, a2, 2LL * *(int *)this); ImGui::MemFree(*((ImGui **)this + 1), a2); } *((_QWORD *)this + 1) = v14; *((_DWORD *)this + 1) = v12; } } *(_DWORD *)this = v10; *((_QWORD *)this + 8) = *((_QWORD *)this + 1) + 2 * v9; v15 = *((int *)this + 8); v16 = v15 + v3 / 3; result = *((unsigned int *)this + 9); if ( (int)result < v16 ) { if ( (_DWORD)result ) v18 = result + (int)result / 2; else v18 = 8; if ( v18 <= v16 ) v18 = v15 + v3 / 3; if ( (int)result < v18 ) { result = ImGui::MemAlloc((ImGui *)(4LL * v18), (unsigned long long)a2); v19 = result; v20 = (void *)*((_QWORD *)this + 5); if ( v20 ) { memcpy(result, v20, 4LL * *((int *)this + 8)); result = ImGui::MemFree(*((ImGui **)this + 5), v20); } *((_QWORD *)this + 5) = v19; *((_DWORD *)this + 9) = v18; } } *((_DWORD *)this + 8) = v16; *((_QWORD *)this + 9) = *((_QWORD *)this + 5) + 4 * v15; return result; }
PrimReserve: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV EBP,EDX MOV R14D,ESI MOV RBX,RDI MOVSXD R12,dword ptr [RDI + 0x10] ADD EBP,R12D MOV EAX,dword ptr [RDI + 0x14] CMP EAX,EBP JGE 0x00154da0 TEST EAX,EAX JZ 0x00154d4d MOV R13D,EAX SHR R13D,0x1f ADD R13D,EAX SAR R13D,0x1 ADD R13D,EAX JMP 0x00154d53 LAB_00154d4d: MOV R13D,0x8 LAB_00154d53: CMP R13D,EBP CMOVLE R13D,EBP CMP EAX,R13D JGE 0x00154da0 MOVSXD RAX,R13D SHL RAX,0x2 LEA RDI,[RAX + RAX*0x4] CALL 0x003130dc MOV R15,RAX MOV RSI,qword ptr [RBX + 0x18] TEST RSI,RSI JZ 0x00154d98 MOVSXD RAX,dword ptr [RBX + 0x10] SHL RAX,0x2 LEA RDX,[RAX + RAX*0x4] MOV RDI,R15 CALL 0x0010f810 MOV RDI,qword ptr [RBX + 0x18] CALL 0x0031318e LAB_00154d98: MOV qword ptr [RBX + 0x18],R15 MOV dword ptr [RBX + 0x14],R13D LAB_00154da0: MOV dword ptr [RBX + 0x10],EBP LEA RAX,[R12 + R12*0x4] SHL RAX,0x2 ADD RAX,qword ptr [RBX + 0x18] MOV qword ptr [RBX + 0x38],RAX MOVSXD R12,dword ptr [RBX] LEA EBP,[R12 + R14*0x1] MOV EAX,dword ptr [RBX + 0x4] CMP EAX,EBP JGE 0x00154e1f TEST EAX,EAX JZ 0x00154dd7 MOV R13D,EAX SHR R13D,0x1f ADD R13D,EAX SAR R13D,0x1 ADD R13D,EAX JMP 0x00154ddd LAB_00154dd7: MOV R13D,0x8 LAB_00154ddd: CMP R13D,EBP CMOVLE R13D,EBP CMP EAX,R13D JGE 0x00154e1f MOVSXD RDI,R13D ADD RDI,RDI CALL 0x003130dc MOV R15,RAX MOV RSI,qword ptr [RBX + 0x8] TEST RSI,RSI JZ 0x00154e17 MOVSXD RDX,dword ptr [RBX] ADD RDX,RDX MOV RDI,R15 CALL 0x0010f810 MOV RDI,qword ptr [RBX + 0x8] CALL 0x0031318e LAB_00154e17: MOV qword ptr [RBX + 0x8],R15 MOV dword ptr [RBX + 0x4],R13D LAB_00154e1f: MOV dword ptr [RBX],EBP ADD R12,R12 ADD R12,qword ptr [RBX + 0x8] MOV qword ptr [RBX + 0x40],R12 MOVSXD R15,dword ptr [RBX + 0x20] MOVSXD RAX,R14D IMUL R12,RAX,0x55555556 MOV RAX,R12 SHR RAX,0x3f SHR R12,0x20 ADD R12D,EAX ADD R12D,R15D MOV EAX,dword ptr [RBX + 0x24] CMP EAX,R12D JGE 0x00154eac TEST EAX,EAX JZ 0x00154e64 MOV EBP,EAX SHR EBP,0x1f ADD EBP,EAX SAR EBP,0x1 ADD EBP,EAX JMP 0x00154e69 LAB_00154e64: MOV EBP,0x8 LAB_00154e69: CMP EBP,R12D CMOVLE EBP,R12D CMP EAX,EBP JGE 0x00154eac MOVSXD RDI,EBP SHL RDI,0x2 CALL 0x003130dc MOV R14,RAX MOV RSI,qword ptr [RBX + 0x28] TEST RSI,RSI JZ 0x00154ea5 MOVSXD RDX,dword ptr [RBX + 0x20] SHL RDX,0x2 MOV RDI,R14 CALL 0x0010f810 MOV RDI,qword ptr [RBX + 0x28] CALL 0x0031318e LAB_00154ea5: MOV qword ptr [RBX + 0x28],R14 MOV dword ptr [RBX + 0x24],EBP LAB_00154eac: MOV dword ptr [RBX + 0x20],R12D SHL R15,0x2 ADD R15,qword ptr [RBX + 0x28] MOV qword ptr [RBX + 0x48],R15 ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* ImDrawList3D::PrimReserve(int, int) */ void __thiscall ImDrawList3D::PrimReserve(ImDrawList3D *this,int param_1,int param_2) { int iVar1; int iVar2; void *pvVar3; int iVar4; int iVar5; iVar1 = *(int *)(this + 0x10); iVar4 = param_2 + iVar1; iVar2 = *(int *)(this + 0x14); if (iVar2 < iVar4) { if (iVar2 == 0) { iVar5 = 8; } else { iVar5 = iVar2 / 2 + iVar2; } if (iVar5 <= iVar4) { iVar5 = iVar4; } if (iVar2 < iVar5) { pvVar3 = (void *)ImGui::MemAlloc((long)iVar5 * 0x14); if (*(void **)(this + 0x18) != (void *)0x0) { memcpy(pvVar3,*(void **)(this + 0x18),(long)*(int *)(this + 0x10) * 0x14); ImGui::MemFree(*(void **)(this + 0x18)); } *(void **)(this + 0x18) = pvVar3; *(int *)(this + 0x14) = iVar5; } } *(int *)(this + 0x10) = iVar4; *(long *)(this + 0x38) = (long)iVar1 * 0x14 + *(long *)(this + 0x18); iVar1 = *(int *)this; iVar4 = iVar1 + param_1; iVar2 = *(int *)(this + 4); if (iVar2 < iVar4) { if (iVar2 == 0) { iVar5 = 8; } else { iVar5 = iVar2 / 2 + iVar2; } if (iVar5 <= iVar4) { iVar5 = iVar4; } if (iVar2 < iVar5) { pvVar3 = (void *)ImGui::MemAlloc((long)iVar5 * 2); if (*(void **)(this + 8) != (void *)0x0) { memcpy(pvVar3,*(void **)(this + 8),(long)*(int *)this * 2); ImGui::MemFree(*(void **)(this + 8)); } *(void **)(this + 8) = pvVar3; *(int *)(this + 4) = iVar5; } } *(int *)this = iVar4; *(long *)(this + 0x40) = (long)iVar1 * 2 + *(long *)(this + 8); iVar1 = *(int *)(this + 0x20); iVar4 = param_1 / 3 + iVar1; iVar2 = *(int *)(this + 0x24); if (iVar2 < iVar4) { if (iVar2 == 0) { iVar5 = 8; } else { iVar5 = iVar2 / 2 + iVar2; } if (iVar5 <= iVar4) { iVar5 = iVar4; } if (iVar2 < iVar5) { pvVar3 = (void *)ImGui::MemAlloc((long)iVar5 << 2); if (*(void **)(this + 0x28) != (void *)0x0) { memcpy(pvVar3,*(void **)(this + 0x28),(long)*(int *)(this + 0x20) << 2); ImGui::MemFree(*(void **)(this + 0x28)); } *(void **)(this + 0x28) = pvVar3; *(int *)(this + 0x24) = iVar5; } } *(int *)(this + 0x20) = iVar4; *(long *)(this + 0x48) = (long)iVar1 * 4 + *(long *)(this + 0x28); return; }
2,927
plutovg_canvas_fill_text
dmazzella[P]pylunasvg/lunasvg/plutovg/source/plutovg-canvas.c
float plutovg_canvas_fill_text(plutovg_canvas_t* canvas, const void* text, int length, plutovg_text_encoding_t encoding, float x, float y) { plutovg_canvas_new_path(canvas); float advance_width = plutovg_canvas_add_text(canvas, text, length, encoding, x, y); plutovg_canvas_fill(canvas); return advance_width; }
O1
c
plutovg_canvas_fill_text: pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movss %xmm1, (%rsp) movss %xmm0, 0x4(%rsp) movl %ecx, %ebx movl %edx, %ebp movq %rsi, %r14 movq %rdi, %r15 movq 0x10(%rdi), %rdi callq 0xac5e movq %r15, %rdi movq %r14, %rsi movl %ebp, %edx movl %ebx, %ecx movss 0x4(%rsp), %xmm0 movss (%rsp), %xmm1 callq 0x42da movss %xmm0, (%rsp) movq %r15, %rdi callq 0x3f35 movq 0x10(%r15), %rdi callq 0xac5e movss (%rsp), %xmm0 addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
plutovg_canvas_fill_text: push rbp push r15 push r14 push rbx push rax movss [rsp+28h+var_28], xmm1 movss [rsp+28h+var_24], xmm0 mov ebx, ecx mov ebp, edx mov r14, rsi mov r15, rdi mov rdi, [rdi+10h] call plutovg_path_reset mov rdi, r15 mov rsi, r14 mov edx, ebp mov ecx, ebx movss xmm0, [rsp+28h+var_24] movss xmm1, [rsp+28h+var_28] call plutovg_canvas_add_text movss [rsp+28h+var_28], xmm0 mov rdi, r15 call plutovg_canvas_fill_preserve mov rdi, [r15+10h] call plutovg_path_reset movss xmm0, [rsp+28h+var_28] add rsp, 8 pop rbx pop r14 pop r15 pop rbp retn
float plutovg_canvas_fill_text(long long a1, float a2, float a3) { float v4; // [rsp+0h] [rbp-28h] plutovg_path_reset(*(_QWORD *)(a1 + 16)); LODWORD(v4) = plutovg_canvas_add_text(a1, a2, a3); plutovg_canvas_fill_preserve(a1); plutovg_path_reset(*(_QWORD *)(a1 + 16)); return v4; }
plutovg_canvas_fill_text: PUSH RBP PUSH R15 PUSH R14 PUSH RBX PUSH RAX MOVSS dword ptr [RSP],XMM1 MOVSS dword ptr [RSP + 0x4],XMM0 MOV EBX,ECX MOV EBP,EDX MOV R14,RSI MOV R15,RDI MOV RDI,qword ptr [RDI + 0x10] CALL 0x0010ac5e MOV RDI,R15 MOV RSI,R14 MOV EDX,EBP MOV ECX,EBX MOVSS XMM0,dword ptr [RSP + 0x4] MOVSS XMM1,dword ptr [RSP] CALL 0x001042da MOVSS dword ptr [RSP],XMM0 MOV RDI,R15 CALL 0x00103f35 MOV RDI,qword ptr [R15 + 0x10] CALL 0x0010ac5e MOVSS XMM0,dword ptr [RSP] ADD RSP,0x8 POP RBX POP R14 POP R15 POP RBP RET
int4 plutovg_canvas_fill_text (int4 param_1,int4 param_2,long param_3,int8 param_4,int4 param_5, int4 param_6) { int4 uVar1; plutovg_path_reset(*(int8 *)(param_3 + 0x10)); uVar1 = plutovg_canvas_add_text(param_1,param_2,param_3,param_4,param_5,param_6); plutovg_canvas_fill_preserve(param_3); plutovg_path_reset(*(int8 *)(param_3 + 0x10)); return uVar1; }
2,928
mbedtls_base64_encode
msxemulator/build_O3/_deps/pico_sdk-src/lib/mbedtls/library/base64.c
int mbedtls_base64_encode(unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen) { size_t i, n; int C1, C2, C3; unsigned char *p; if (slen == 0) { *olen = 0; return 0; } n = slen / 3 + (slen % 3 != 0); if (n > (BASE64_SIZE_T_MAX - 1) / 4) { *olen = BASE64_SIZE_T_MAX; return MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL; } n *= 4; if ((dlen < n + 1) || (NULL == dst)) { *olen = n + 1; return MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL; } n = (slen / 3) * 3; for (i = 0, p = dst; i < n; i += 3) { C1 = *src++; C2 = *src++; C3 = *src++; *p++ = mbedtls_ct_base64_enc_char((C1 >> 2) & 0x3F); *p++ = mbedtls_ct_base64_enc_char((((C1 & 3) << 4) + (C2 >> 4)) & 0x3F); *p++ = mbedtls_ct_base64_enc_char((((C2 & 15) << 2) + (C3 >> 6)) & 0x3F); *p++ = mbedtls_ct_base64_enc_char(C3 & 0x3F); } if (i < slen) { C1 = *src++; C2 = ((i + 1) < slen) ? *src++ : 0; *p++ = mbedtls_ct_base64_enc_char((C1 >> 2) & 0x3F); *p++ = mbedtls_ct_base64_enc_char((((C1 & 3) << 4) + (C2 >> 4)) & 0x3F); if ((i + 1) < slen) { *p++ = mbedtls_ct_base64_enc_char(((C2 & 15) << 2) & 0x3F); } else { *p++ = '='; } *p++ = '='; } *olen = p - dst; *p = 0; return 0; }
O3
c
mbedtls_base64_encode: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdx, %r15 testq %r8, %r8 je 0x99d07 movq %rcx, %r12 movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB movq %r8, %rax mulq %rcx shrq %rdx movabsq $0x5555555555555555, %r9 # imm = 0x5555555555555555 xorl %ecx, %ecx cmpq %r9, %rax seta %cl addq %rdx, %rcx movq %rcx, %rax shrq $0x3e, %rax je 0x99d13 movq $-0x1, (%r15) jmp 0x99d43 movq $0x0, (%r15) jmp 0x99e59 shlq $0x2, %rcx testq %rdi, %rdi je 0x99d3c cmpq %rsi, %rcx jae 0x99d3c cmpq $0x3, %r8 movq %rdi, 0x18(%rsp) movq %r8, 0x8(%rsp) jae 0x99d4d xorl %r14d, %r14d movq %rdi, %r13 jmp 0x99ddf orq $0x1, %rcx movq %rcx, (%r15) movl $0xffffffd6, %eax # imm = 0xFFFFFFD6 jmp 0x99e5b movq %r15, 0x10(%rsp) leaq (%rdx,%rdx,2), %rax movq %rax, 0x20(%rsp) xorl %r14d, %r14d movq %rdi, %r13 movb (%r12,%r14), %bl movb 0x1(%r12,%r14), %r15b movzbl 0x2(%r12,%r14), %ebp movl %ebx, %eax shrb $0x2, %al movzbl %al, %edi callq 0x824b0 movb %al, (%r13) movl %r15d, %eax shrb $0x4, %al shlb $0x4, %bl orb %al, %bl andb $0x3f, %bl movzbl %bl, %edi callq 0x824b0 movb %al, 0x1(%r13) shlb $0x2, %r15b movl %ebp, %eax shrb $0x6, %al orb %r15b, %al andb $0x3f, %al movzbl %al, %edi callq 0x824b0 movb %al, 0x2(%r13) andl $0x3f, %ebp movl %ebp, %edi callq 0x824b0 movb %al, 0x3(%r13) addq $0x4, %r13 addq $0x3, %r14 cmpq 0x20(%rsp), %r14 jb 0x99d61 addq %r14, %r12 movq 0x10(%rsp), %r15 movq 0x8(%rsp), %r8 cmpq %r8, %r14 jae 0x99e49 movb (%r12), %bpl incq %r14 xorl %ebx, %ebx cmpq %r8, %r14 jae 0x99df8 movzbl 0x1(%r12), %ebx movl %ebp, %eax shrb $0x2, %al movzbl %al, %edi callq 0x824b0 movb %al, (%r13) shlb $0x4, %bpl movl %ebx, %eax shrl $0x4, %eax andb $0x30, %bpl orb %bpl, %al movzbl %al, %edi callq 0x824b0 movb %al, 0x1(%r13) movb $0x3d, %al cmpq 0x8(%rsp), %r14 jae 0x99e3c shlb $0x2, %bl andb $0x3c, %bl movzbl %bl, %edi callq 0x824b0 movb %al, 0x2(%r13) movb $0x3d, 0x3(%r13) addq $0x4, %r13 movq %r13, %rax subq 0x18(%rsp), %rax movq %rax, (%r15) movb $0x0, (%r13) xorl %eax, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
mbedtls_base64_encode: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 28h mov r15, rdx test r8, r8 jz short loc_99D07 mov r12, rcx mov rcx, 0AAAAAAAAAAAAAAABh mov rax, r8 mul rcx shr rdx, 1 mov r9, 5555555555555555h xor ecx, ecx cmp rax, r9 setnbe cl add rcx, rdx mov rax, rcx shr rax, 3Eh jz short loc_99D13 mov qword ptr [r15], 0FFFFFFFFFFFFFFFFh jmp short loc_99D43 loc_99D07: mov qword ptr [r15], 0 jmp loc_99E59 loc_99D13: shl rcx, 2 test rdi, rdi jz short loc_99D3C cmp rcx, rsi jnb short loc_99D3C cmp r8, 3 mov [rsp+58h+var_40], rdi mov [rsp+58h+var_50], r8 jnb short loc_99D4D xor r14d, r14d mov r13, rdi jmp loc_99DDF loc_99D3C: or rcx, 1 mov [r15], rcx loc_99D43: mov eax, 0FFFFFFD6h jmp loc_99E5B loc_99D4D: mov [rsp+58h+var_48], r15 lea rax, [rdx+rdx*2] mov [rsp+58h+var_38], rax xor r14d, r14d mov r13, rdi loc_99D61: mov bl, [r12+r14] mov r15b, [r12+r14+1] movzx ebp, byte ptr [r12+r14+2] mov eax, ebx shr al, 2 movzx edi, al call mbedtls_ct_base64_enc_char mov [r13+0], al mov eax, r15d shr al, 4 shl bl, 4 or bl, al and bl, 3Fh movzx edi, bl call mbedtls_ct_base64_enc_char mov [r13+1], al shl r15b, 2 mov eax, ebp shr al, 6 or al, r15b and al, 3Fh movzx edi, al call mbedtls_ct_base64_enc_char mov [r13+2], al and ebp, 3Fh mov edi, ebp call mbedtls_ct_base64_enc_char mov [r13+3], al add r13, 4 add r14, 3 cmp r14, [rsp+58h+var_38] jb short loc_99D61 add r12, r14 mov r15, [rsp+58h+var_48] mov r8, [rsp+58h+var_50] loc_99DDF: cmp r14, r8 jnb short loc_99E49 mov bpl, [r12] inc r14 xor ebx, ebx cmp r14, r8 jnb short loc_99DF8 movzx ebx, byte ptr [r12+1] loc_99DF8: mov eax, ebp shr al, 2 movzx edi, al call mbedtls_ct_base64_enc_char mov [r13+0], al shl bpl, 4 mov eax, ebx shr eax, 4 and bpl, 30h or al, bpl movzx edi, al call mbedtls_ct_base64_enc_char mov [r13+1], al mov al, 3Dh ; '=' cmp r14, [rsp+58h+var_50] jnb short loc_99E3C shl bl, 2 and bl, 3Ch movzx edi, bl call mbedtls_ct_base64_enc_char loc_99E3C: mov [r13+2], al mov byte ptr [r13+3], 3Dh ; '=' add r13, 4 loc_99E49: mov rax, r13 sub rax, [rsp+58h+var_40] mov [r15], rax mov byte ptr [r13+0], 0 loc_99E59: xor eax, eax loc_99E5B: add rsp, 28h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long mbedtls_base64_encode( _BYTE *a1, unsigned long long a2, unsigned long long *a3, unsigned __int8 *a4, unsigned long long a5) { unsigned long long *v5; // r15 unsigned long long v7; // rcx unsigned long long v8; // r14 _BYTE *v9; // r13 unsigned __int8 v11; // bl unsigned __int8 v12; // r15 unsigned __int8 v13; // bp unsigned __int8 v14; // bp unsigned long long v15; // r14 unsigned int v16; // ebx char v17; // al unsigned long long v18; // [rsp+8h] [rbp-50h] unsigned long long v20; // [rsp+20h] [rbp-38h] v5 = a3; if ( a5 ) { if ( (a5 / 3 + (0xAAAAAAAAAAAAAAABLL * a5 > 0x5555555555555555LL)) >> 62 ) { *a3 = -1LL; return 4294967254LL; } v7 = 4 * (a5 / 3 + (0xAAAAAAAAAAAAAAABLL * a5 > 0x5555555555555555LL)); if ( !a1 || v7 >= a2 ) { *a3 = v7 | 1; return 4294967254LL; } v18 = a5; if ( a5 >= 3 ) { v20 = 3 * (a5 / 3); v8 = 0LL; v9 = a1; do { v11 = a4[v8]; v12 = a4[v8 + 1]; v13 = a4[v8 + 2]; *v9 = mbedtls_ct_base64_enc_char(v11 >> 2); v9[1] = mbedtls_ct_base64_enc_char(((v12 >> 4) | (unsigned __int8)(16 * v11)) & 0x3F); v9[2] = mbedtls_ct_base64_enc_char(((unsigned __int8)(4 * v12) | (v13 >> 6)) & 0x3F); v9[3] = mbedtls_ct_base64_enc_char(v13 & 0x3F); v9 += 4; v8 += 3LL; } while ( v8 < v20 ); a4 += v8; v5 = a3; a5 = v18; } else { v8 = 0LL; v9 = a1; } if ( v8 < a5 ) { v14 = *a4; v15 = v8 + 1; v16 = 0; if ( v15 < a5 ) v16 = a4[1]; *v9 = mbedtls_ct_base64_enc_char(v14 >> 2); v9[1] = mbedtls_ct_base64_enc_char((16 * v14) & 0x30u | (unsigned __int8)(v16 >> 4)); v17 = 61; if ( v15 < v18 ) v17 = mbedtls_ct_base64_enc_char((4 * (_BYTE)v16) & 0x3C); v9[2] = v17; v9[3] = 61; v9 += 4; } *v5 = v9 - a1; *v9 = 0; } else { *a3 = 0LL; } return 0LL; }
mbedtls_base64_encode: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x28 MOV R15,RDX TEST R8,R8 JZ 0x00199d07 MOV R12,RCX MOV RCX,-0x5555555555555555 MOV RAX,R8 MUL RCX SHR RDX,0x1 MOV R9,0x5555555555555555 XOR ECX,ECX CMP RAX,R9 SETA CL ADD RCX,RDX MOV RAX,RCX SHR RAX,0x3e JZ 0x00199d13 MOV qword ptr [R15],-0x1 JMP 0x00199d43 LAB_00199d07: MOV qword ptr [R15],0x0 JMP 0x00199e59 LAB_00199d13: SHL RCX,0x2 TEST RDI,RDI JZ 0x00199d3c CMP RCX,RSI JNC 0x00199d3c CMP R8,0x3 MOV qword ptr [RSP + 0x18],RDI MOV qword ptr [RSP + 0x8],R8 JNC 0x00199d4d XOR R14D,R14D MOV R13,RDI JMP 0x00199ddf LAB_00199d3c: OR RCX,0x1 MOV qword ptr [R15],RCX LAB_00199d43: MOV EAX,0xffffffd6 JMP 0x00199e5b LAB_00199d4d: MOV qword ptr [RSP + 0x10],R15 LEA RAX,[RDX + RDX*0x2] MOV qword ptr [RSP + 0x20],RAX XOR R14D,R14D MOV R13,RDI LAB_00199d61: MOV BL,byte ptr [R12 + R14*0x1] MOV R15B,byte ptr [R12 + R14*0x1 + 0x1] MOVZX EBP,byte ptr [R12 + R14*0x1 + 0x2] MOV EAX,EBX SHR AL,0x2 MOVZX EDI,AL CALL 0x001824b0 MOV byte ptr [R13],AL MOV EAX,R15D SHR AL,0x4 SHL BL,0x4 OR BL,AL AND BL,0x3f MOVZX EDI,BL CALL 0x001824b0 MOV byte ptr [R13 + 0x1],AL SHL R15B,0x2 MOV EAX,EBP SHR AL,0x6 OR AL,R15B AND AL,0x3f MOVZX EDI,AL CALL 0x001824b0 MOV byte ptr [R13 + 0x2],AL AND EBP,0x3f MOV EDI,EBP CALL 0x001824b0 MOV byte ptr [R13 + 0x3],AL ADD R13,0x4 ADD R14,0x3 CMP R14,qword ptr [RSP + 0x20] JC 0x00199d61 ADD R12,R14 MOV R15,qword ptr [RSP + 0x10] MOV R8,qword ptr [RSP + 0x8] LAB_00199ddf: CMP R14,R8 JNC 0x00199e49 MOV BPL,byte ptr [R12] INC R14 XOR EBX,EBX CMP R14,R8 JNC 0x00199df8 MOVZX EBX,byte ptr [R12 + 0x1] LAB_00199df8: MOV EAX,EBP SHR AL,0x2 MOVZX EDI,AL CALL 0x001824b0 MOV byte ptr [R13],AL SHL BPL,0x4 MOV EAX,EBX SHR EAX,0x4 AND BPL,0x30 OR AL,BPL MOVZX EDI,AL CALL 0x001824b0 MOV byte ptr [R13 + 0x1],AL MOV AL,0x3d CMP R14,qword ptr [RSP + 0x8] JNC 0x00199e3c SHL BL,0x2 AND BL,0x3c MOVZX EDI,BL CALL 0x001824b0 LAB_00199e3c: MOV byte ptr [R13 + 0x2],AL MOV byte ptr [R13 + 0x3],0x3d ADD R13,0x4 LAB_00199e49: MOV RAX,R13 SUB RAX,qword ptr [RSP + 0x18] MOV qword ptr [R15],RAX MOV byte ptr [R13],0x0 LAB_00199e59: XOR EAX,EAX LAB_00199e5b: ADD RSP,0x28 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
int8 mbedtls_base64_encode(int1 *param_1,ulong param_2,ulong *param_3,byte *param_4,ulong param_5) { byte bVar1; byte bVar2; byte bVar3; int1 auVar4 [16]; int1 uVar5; int8 uVar6; ulong uVar7; uint uVar8; int1 *puVar9; if (param_5 == 0) { *param_3 = 0; LAB_00199e59: uVar6 = 0; } else { auVar4._8_8_ = 0; auVar4._0_8_ = param_5; uVar7 = (ulong)(0x5555555555555555 < SUB168(auVar4 * ZEXT816(0xaaaaaaaaaaaaaaab),0)) + param_5 / 3; if (uVar7 >> 0x3e == 0) { uVar7 = uVar7 * 4; if ((param_1 != (int1 *)0x0) && (uVar7 < param_2)) { puVar9 = param_1; if (param_5 < 3) { uVar7 = 0; } else { uVar7 = 0; do { bVar2 = param_4[uVar7]; bVar1 = param_4[uVar7 + 1]; bVar3 = param_4[uVar7 + 2]; uVar5 = mbedtls_ct_base64_enc_char(bVar2 >> 2); *puVar9 = uVar5; uVar5 = mbedtls_ct_base64_enc_char((bVar2 & 3) << 4 | bVar1 >> 4); puVar9[1] = uVar5; uVar5 = mbedtls_ct_base64_enc_char(bVar3 >> 6 | (bVar1 & 0xf) << 2); puVar9[2] = uVar5; uVar5 = mbedtls_ct_base64_enc_char(bVar3 & 0x3f); puVar9[3] = uVar5; puVar9 = puVar9 + 4; uVar7 = uVar7 + 3; } while (uVar7 < (param_5 / 3) * 3); param_4 = param_4 + uVar7; } if (uVar7 < param_5) { bVar2 = *param_4; uVar8 = 0; if (uVar7 + 1 < param_5) { uVar8 = (uint)param_4[1]; } uVar5 = mbedtls_ct_base64_enc_char(bVar2 >> 2); *puVar9 = uVar5; uVar5 = mbedtls_ct_base64_enc_char((byte)(uVar8 >> 4) | (bVar2 & 3) << 4); puVar9[1] = uVar5; uVar5 = 0x3d; if (uVar7 + 1 < param_5) { uVar5 = mbedtls_ct_base64_enc_char(((byte)uVar8 & 0xf) << 2); } puVar9[2] = uVar5; puVar9[3] = 0x3d; puVar9 = puVar9 + 4; } *param_3 = (long)puVar9 - (long)param_1; *puVar9 = 0; goto LAB_00199e59; } *param_3 = uVar7 | 1; } else { *param_3 = 0xffffffffffffffff; } uVar6 = 0xffffffd6; } return uVar6; }
2,929
cxxopts::values::abstract_value<bool>::default_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
shubhamoy[P]dir2txt/include/cxxopts.hpp
std::shared_ptr<Value> default_value(const std::string& value) override { m_default = true; m_default_value = value; return shared_from_this(); }
O1
cpp
cxxopts::values::abstract_value<bool>::default_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&): pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movb $0x1, 0x30(%rsi) leaq 0x38(%rsi), %rdi movq %rdx, %rsi callq 0x1d798 addq $0x8, %rbx movq %r14, %rdi movq %rbx, %rsi callq 0x24b04 movq %r14, %rax addq $0x8, %rsp popq %rbx popq %r14 retq
_ZN7cxxopts6values14abstract_valueIbE13default_valueERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: push r14 push rbx push rax mov rbx, rsi mov r14, rdi mov byte ptr [rsi+30h], 1 lea rdi, [rsi+38h] mov rsi, rdx call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_assignERKS4_; std::string::_M_assign(std::string const&) add rbx, 8 mov rdi, r14 mov rsi, rbx call _ZNSt12__shared_ptrIN7cxxopts5ValueELN9__gnu_cxx12_Lock_policyE2EEC2IS1_vEERKSt10__weak_ptrIT_LS3_2EE; std::__shared_ptr<cxxopts::Value,(__gnu_cxx::_Lock_policy)2>::__shared_ptr<cxxopts::Value,void>(std::__weak_ptr<cxxopts::Value,(__gnu_cxx::_Lock_policy)2> const&) mov rax, r14 add rsp, 8 pop rbx pop r14 retn
_QWORD * cxxopts::values::abstract_value<bool>::default_value(_QWORD *a1, long long a2, long long *a3) { *(_BYTE *)(a2 + 48) = 1; std::string::_M_assign((long long *)(a2 + 56), a3); std::__shared_ptr<cxxopts::Value,(__gnu_cxx::_Lock_policy)2>::__shared_ptr<cxxopts::Value,void>( a1, (_QWORD *)(a2 + 8)); return a1; }
default_value: PUSH R14 PUSH RBX PUSH RAX MOV RBX,RSI MOV R14,RDI MOV byte ptr [RSI + 0x30],0x1 LEA RDI,[RSI + 0x38] MOV RSI,RDX CALL 0x0011d798 ADD RBX,0x8 MOV RDI,R14 MOV RSI,RBX CALL 0x00124b04 MOV RAX,R14 ADD RSP,0x8 POP RBX POP R14 RET
/* cxxopts::values::abstract_value<bool>::default_value(std::__cxx11::string const&) */ string * cxxopts::values::abstract_value<bool>::default_value(string *param_1) { string *in_RDX; long in_RSI; *(int1 *)(in_RSI + 0x30) = 1; std::__cxx11::string::_M_assign((string *)(in_RSI + 0x38),in_RDX); std::__shared_ptr<cxxopts::Value,(__gnu_cxx::_Lock_policy)2>::__shared_ptr<cxxopts::Value,void> ((__shared_ptr<cxxopts::Value,(__gnu_cxx::_Lock_policy)2> *)param_1, (__weak_ptr *)(in_RSI + 8)); return param_1; }
2,930
bool nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::contains<char const (&) [12], 0>(char const (&) [12]) const
monkey531[P]llama/common/json.hpp
constexpr bool is_object() const noexcept { return m_data.m_type == value_t::object; }
O1
cpp
bool nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::contains<char const (&) [12], 0>(char const (&) [12]) const: cmpb $0x1, (%rdi) jne 0xc6f12 pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx movq 0x8(%rdi), %r12 movq (%r12), %r15 movq 0x8(%r12), %rax cmpq %rax, %r15 je 0xc6f18 movq %rsi, %r14 movq %r15, %rdi movq %r14, %rsi callq 0x1b230 testl %eax, %eax je 0xc6f15 addq $0x30, %r15 movq 0x8(%r12), %rax cmpq %rax, %r15 jne 0xc6ef3 jmp 0xc6f18 xorl %eax, %eax retq movq %r15, %rax movq 0x8(%rbx), %rcx cmpq 0x8(%rcx), %rax setne %al addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq nop
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE8containsIRA17_KcTnNSt9enable_ifIXsr6detail32is_usable_as_basic_json_key_typeISD_T_EE5valueEiE4typeELi0EEEbOSJ_: cmp byte ptr [rdi], 1 jnz short loc_C6F12 push r15 push r14 push r12 push rbx push rax mov rbx, rdi mov r12, [rdi+8] mov r15, [r12] mov rax, [r12+8] cmp r15, rax jz short loc_C6F18 mov r14, rsi loc_C6EF3: mov rdi, r15 mov rsi, r14 call __ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc; std::string::compare(char const*) test eax, eax jz short loc_C6F15 add r15, 30h ; '0' mov rax, [r12+8] cmp r15, rax jnz short loc_C6EF3 jmp short loc_C6F18 loc_C6F12: xor eax, eax retn loc_C6F15: mov rax, r15 loc_C6F18: mov rcx, [rbx+8] cmp rax, [rcx+8] setnz al add rsp, 8 pop rbx pop r12 pop r14 pop r15 retn
bool ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE8containsIRA17_KcTnNSt9enable_ifIXsr6detail32is_usable_as_basic_json_key_typeISD_T_EE5valueEiE4typeELi0EEEbOSJ_( long long a1, long long a2) { long long *v2; // r12 long long v3; // r15 long long v4; // rax if ( *(_BYTE *)a1 != 1 ) return 0; v2 = *(long long **)(a1 + 8); v3 = *v2; v4 = v2[1]; if ( *v2 != v4 ) { while ( (unsigned int)std::string::compare(v3, a2) ) { v3 += 48LL; v4 = v2[1]; if ( v3 == v4 ) return v4 != *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8LL); } v4 = v3; } return v4 != *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8LL); }
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE8containsIRA17_KcTnNSt9enable_ifIXsr6detail32is_usable_as_basic_json_key_typeISD_T_EE5valueEiE4typeELi0EEEbOSJ_: CMP byte ptr [RDI],0x1 JNZ 0x001c6f12 PUSH R15 PUSH R14 PUSH R12 PUSH RBX PUSH RAX MOV RBX,RDI MOV R12,qword ptr [RDI + 0x8] MOV R15,qword ptr [R12] MOV RAX,qword ptr [R12 + 0x8] CMP R15,RAX JZ 0x001c6f18 MOV R14,RSI LAB_001c6ef3: MOV RDI,R15 MOV RSI,R14 CALL 0x0011b230 TEST EAX,EAX JZ 0x001c6f15 ADD R15,0x30 MOV RAX,qword ptr [R12 + 0x8] CMP R15,RAX JNZ 0x001c6ef3 JMP 0x001c6f18 LAB_001c6f12: XOR EAX,EAX RET LAB_001c6f15: MOV RAX,R15 LAB_001c6f18: MOV RCX,qword ptr [RBX + 0x8] CMP RAX,qword ptr [RCX + 0x8] SETNZ AL ADD RSP,0x8 POP RBX POP R12 POP R14 POP R15 RET
int8 _ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE8containsIRA17_KcTnNSt9enable_ifIXsr6detail32is_usable_as_basic_json_key_typeISD_T_EE5valueEiE4typeELi0EEEbOSJ_ (char *param_1) { long *plVar1; int iVar2; char *pcVar3; char *pcVar4; if (*param_1 != '\x01') { return 0; } plVar1 = *(long **)(param_1 + 8); pcVar3 = (char *)plVar1[1]; pcVar4 = (char *)*plVar1; if ((char *)*plVar1 != pcVar3) { do { pcVar3 = pcVar4; iVar2 = std::__cxx11::string::compare(pcVar3); if (iVar2 == 0) break; pcVar4 = pcVar3 + 0x30; pcVar3 = (char *)plVar1[1]; } while (pcVar4 != pcVar3); } return CONCAT71((int7)((ulong)pcVar3 >> 8),pcVar3 != *(char **)(*(long *)(param_1 + 8) + 8)); }
2,931
my_snprintf_8bit
eloqsql/strings/ctype-simple.c
size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), char* to, size_t n __attribute__((unused)), const char* fmt, ...) { va_list args; size_t result; va_start(args,fmt); result= my_vsnprintf(to, n, fmt, args); va_end(args); return result; }
O0
c
my_snprintf_8bit: pushq %rbp movq %rsp, %rbp subq $0x100, %rsp # imm = 0x100 testb %al, %al je 0x53b4e movaps %xmm0, -0xd0(%rbp) movaps %xmm1, -0xc0(%rbp) movaps %xmm2, -0xb0(%rbp) movaps %xmm3, -0xa0(%rbp) movaps %xmm4, -0x90(%rbp) movaps %xmm5, -0x80(%rbp) movaps %xmm6, -0x70(%rbp) movaps %xmm7, -0x60(%rbp) movq %r9, -0xd8(%rbp) movq %r8, -0xe0(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) leaq -0x100(%rbp), %rax movq %rax, -0x30(%rbp) leaq 0x10(%rbp), %rax movq %rax, -0x38(%rbp) movl $0x30, -0x3c(%rbp) movl $0x20, -0x40(%rbp) movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi movq -0x20(%rbp), %rdx leaq -0x40(%rbp), %rcx callq 0x86d70 movq %rax, -0x48(%rbp) movq -0x48(%rbp), %rax addq $0x100, %rsp # imm = 0x100 popq %rbp retq nopw %cs:(%rax,%rax)
my_snprintf_8bit: push rbp mov rbp, rsp sub rsp, 100h test al, al jz short loc_53B4E movaps [rbp+var_D0], xmm0 movaps [rbp+var_C0], xmm1 movaps [rbp+var_B0], xmm2 movaps [rbp+var_A0], xmm3 movaps [rbp+var_90], xmm4 movaps [rbp+var_80], xmm5 movaps [rbp+var_70], xmm6 movaps [rbp+var_60], xmm7 loc_53B4E: mov [rbp+var_D8], r9 mov [rbp+var_E0], r8 mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov [rbp+var_18], rdx mov [rbp+var_20], rcx lea rax, [rbp+var_100] mov [rbp+var_30], rax lea rax, [rbp+arg_0] mov [rbp+var_38], rax mov [rbp+var_3C], 30h ; '0' mov [rbp+var_40], 20h ; ' ' mov rdi, [rbp+var_10] mov rsi, [rbp+var_18] mov rdx, [rbp+var_20] lea rcx, [rbp+var_40] call my_vsnprintf mov [rbp+var_48], rax mov rax, [rbp+var_48] add rsp, 100h pop rbp retn
long long my_snprintf_8bit( long long a1, long long a2, long long a3, long long a4, long long a5, long long a6, __m128 a7, __m128 a8, __m128 a9, __m128 a10, __m128 a11, __m128 a12, __m128 a13, __m128 a14, char a15) { char v16; // [rsp+0h] [rbp-100h] BYREF long long v17; // [rsp+20h] [rbp-E0h] long long v18; // [rsp+28h] [rbp-D8h] __m128 v19; // [rsp+30h] [rbp-D0h] __m128 v20; // [rsp+40h] [rbp-C0h] __m128 v21; // [rsp+50h] [rbp-B0h] __m128 v22; // [rsp+60h] [rbp-A0h] __m128 v23; // [rsp+70h] [rbp-90h] __m128 v24; // [rsp+80h] [rbp-80h] __m128 v25; // [rsp+90h] [rbp-70h] __m128 v26; // [rsp+A0h] [rbp-60h] _DWORD v27[2]; // [rsp+C0h] [rbp-40h] BYREF char *v28; // [rsp+C8h] [rbp-38h] char *v29; // [rsp+D0h] [rbp-30h] long long v30; // [rsp+E0h] [rbp-20h] long long v31; // [rsp+E8h] [rbp-18h] long long v32; // [rsp+F0h] [rbp-10h] long long v33; // [rsp+F8h] [rbp-8h] v19 = a7; v20 = a8; v21 = a9; v22 = a10; v23 = a11; v24 = a12; v25 = a13; v26 = a14; v18 = a6; v17 = a5; v33 = a1; v32 = a2; v31 = a3; v30 = a4; v29 = &v16; v28 = &a15; v27[1] = 48; v27[0] = 32; return my_vsnprintf(a2, a3, a4, v27); }
my_snprintf_8bit: PUSH RBP MOV RBP,RSP SUB RSP,0x100 TEST AL,AL JZ 0x00153b4e MOVAPS xmmword ptr [RBP + -0xd0],XMM0 MOVAPS xmmword ptr [RBP + -0xc0],XMM1 MOVAPS xmmword ptr [RBP + -0xb0],XMM2 MOVAPS xmmword ptr [RBP + -0xa0],XMM3 MOVAPS xmmword ptr [RBP + -0x90],XMM4 MOVAPS xmmword ptr [RBP + -0x80],XMM5 MOVAPS xmmword ptr [RBP + -0x70],XMM6 MOVAPS xmmword ptr [RBP + -0x60],XMM7 LAB_00153b4e: MOV qword ptr [RBP + -0xd8],R9 MOV qword ptr [RBP + -0xe0],R8 MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV qword ptr [RBP + -0x18],RDX MOV qword ptr [RBP + -0x20],RCX LEA RAX,[RBP + -0x100] MOV qword ptr [RBP + -0x30],RAX LEA RAX,[RBP + 0x10] MOV qword ptr [RBP + -0x38],RAX MOV dword ptr [RBP + -0x3c],0x30 MOV dword ptr [RBP + -0x40],0x20 MOV RDI,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RBP + -0x18] MOV RDX,qword ptr [RBP + -0x20] LEA RCX,[RBP + -0x40] CALL 0x00186d70 MOV qword ptr [RBP + -0x48],RAX MOV RAX,qword ptr [RBP + -0x48] ADD RSP,0x100 POP RBP RET
int8 my_snprintf_8bit(int8 param_1,int8 param_2,int8 param_3,int8 param_4, int8 param_5,int8 param_6,int8 param_7,int8 param_8, int8 param_9,int8 param_10,int8 param_11,int8 param_12, int8 param_13,int8 param_14) { char in_AL; int8 uVar1; int1 local_108 [32]; int8 local_e8; int8 local_e0; int8 local_d8; int8 local_c8; int8 local_b8; int8 local_a8; int8 local_98; int8 local_88; int8 local_78; int8 local_68; int4 local_48; int4 local_44; int1 *local_40; int1 *local_38; int8 local_28; int8 local_20; int8 local_18; int8 local_10; if (in_AL != '\0') { local_d8 = param_1; local_c8 = param_2; local_b8 = param_3; local_a8 = param_4; local_98 = param_5; local_88 = param_6; local_78 = param_7; local_68 = param_8; } local_38 = local_108; local_40 = &stack0x00000008; local_44 = 0x30; local_48 = 0x20; local_e8 = param_13; local_e0 = param_14; local_28 = param_12; local_20 = param_11; local_18 = param_10; local_10 = param_9; uVar1 = my_vsnprintf(param_10,param_11,param_12,&local_48); return uVar1; }
2,932
my_snprintf_8bit
eloqsql/strings/ctype-simple.c
size_t my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)), char* to, size_t n __attribute__((unused)), const char* fmt, ...) { va_list args; size_t result; va_start(args,fmt); result= my_vsnprintf(to, n, fmt, args); va_end(args); return result; }
O3
c
my_snprintf_8bit: pushq %rbp movq %rsp, %rbp subq $0xd0, %rsp movq %rsi, %rdi leaq -0xd0(%rbp), %rsi movq %r8, 0x20(%rsi) movq %r9, 0x28(%rsi) testb %al, %al je 0x3efcd movaps %xmm0, -0xa0(%rbp) movaps %xmm1, -0x90(%rbp) movaps %xmm2, -0x80(%rbp) movaps %xmm3, -0x70(%rbp) movaps %xmm4, -0x60(%rbp) movaps %xmm5, -0x50(%rbp) movaps %xmm6, -0x40(%rbp) movaps %xmm7, -0x30(%rbp) leaq -0x20(%rbp), %rax movq %rsi, 0x10(%rax) leaq 0x10(%rbp), %rsi movq %rsi, 0x8(%rax) movabsq $0x3000000020, %rsi # imm = 0x3000000020 movq %rsi, (%rax) movq %rdx, %rsi movq %rcx, %rdx movq %rax, %rcx callq 0x60c81 addq $0xd0, %rsp popq %rbp retq
my_snprintf_8bit: push rbp mov rbp, rsp sub rsp, 0D0h mov rdi, rsi lea rsi, [rbp+var_D0] mov [rsi+20h], r8 mov [rsi+28h], r9 test al, al jz short loc_3EFCD movaps [rbp+var_A0], xmm0 movaps [rbp+var_90], xmm1 movaps [rbp+var_80], xmm2 movaps [rbp+var_70], xmm3 movaps [rbp+var_60], xmm4 movaps [rbp+var_50], xmm5 movaps [rbp+var_40], xmm6 movaps [rbp+var_30], xmm7 loc_3EFCD: lea rax, [rbp+var_20] mov [rax+10h], rsi lea rsi, [rbp+arg_0] mov [rax+8], rsi mov rsi, 3000000020h mov [rax], rsi mov rsi, rdx mov rdx, rcx mov rcx, rax call my_vsnprintf add rsp, 0D0h pop rbp retn
long long my_snprintf_8bit( __m128 a1, __m128 a2, __m128 a3, __m128 a4, __m128 a5, __m128 a6, __m128 a7, __m128 a8, long long a9, long long a10, long long a11, long long a12, long long a13, long long a14, char a15) { char v16; // [rsp+0h] [rbp-D0h] BYREF long long v17; // [rsp+20h] [rbp-B0h] long long v18; // [rsp+28h] [rbp-A8h] __m128 v19; // [rsp+30h] [rbp-A0h] __m128 v20; // [rsp+40h] [rbp-90h] __m128 v21; // [rsp+50h] [rbp-80h] __m128 v22; // [rsp+60h] [rbp-70h] __m128 v23; // [rsp+70h] [rbp-60h] __m128 v24; // [rsp+80h] [rbp-50h] __m128 v25; // [rsp+90h] [rbp-40h] __m128 v26; // [rsp+A0h] [rbp-30h] long long v27; // [rsp+B0h] [rbp-20h] char *v28; // [rsp+B8h] [rbp-18h] char *v29; // [rsp+C0h] [rbp-10h] v19 = a1; v20 = a2; v21 = a3; v22 = a4; v23 = a5; v24 = a6; v25 = a7; v26 = a8; v17 = a13; v18 = a14; v29 = &v16; v28 = &a15; v27 = 0x3000000020LL; return my_vsnprintf(a10, a11, a12); }
my_snprintf_8bit: PUSH RBP MOV RBP,RSP SUB RSP,0xd0 MOV RDI,RSI LEA RSI,[RBP + -0xd0] MOV qword ptr [RSI + 0x20],R8 MOV qword ptr [RSI + 0x28],R9 TEST AL,AL JZ 0x0013efcd MOVAPS xmmword ptr [RBP + -0xa0],XMM0 MOVAPS xmmword ptr [RBP + -0x90],XMM1 MOVAPS xmmword ptr [RBP + -0x80],XMM2 MOVAPS xmmword ptr [RBP + -0x70],XMM3 MOVAPS xmmword ptr [RBP + -0x60],XMM4 MOVAPS xmmword ptr [RBP + -0x50],XMM5 MOVAPS xmmword ptr [RBP + -0x40],XMM6 MOVAPS xmmword ptr [RBP + -0x30],XMM7 LAB_0013efcd: LEA RAX,[RBP + -0x20] MOV qword ptr [RAX + 0x10],RSI LEA RSI,[RBP + 0x10] MOV qword ptr [RAX + 0x8],RSI MOV RSI,0x3000000020 MOV qword ptr [RAX],RSI MOV RSI,RDX MOV RDX,RCX MOV RCX,RAX CALL 0x00160c81 ADD RSP,0xd0 POP RBP RET
void my_snprintf_8bit(int8 param_1,int8 param_2,int8 param_3,int8 param_4, int8 param_5,int8 param_6,int8 param_7,int8 param_8, int8 param_9,int8 param_10,int8 param_11,int8 param_12, int8 param_13,int8 param_14) { char in_AL; int1 local_d8 [32]; int8 local_b8; int8 local_b0; int8 local_a8; int8 local_98; int8 local_88; int8 local_78; int8 local_68; int8 local_58; int8 local_48; int8 local_38; int8 local_28; int1 *local_20; int1 *local_18; local_18 = local_d8; if (in_AL != '\0') { local_a8 = param_1; local_98 = param_2; local_88 = param_3; local_78 = param_4; local_68 = param_5; local_58 = param_6; local_48 = param_7; local_38 = param_8; } local_20 = &stack0x00000008; local_28 = 0x3000000020; local_b8 = param_13; local_b0 = param_14; my_vsnprintf(param_10,param_11,param_12,&local_28); return; }
2,933
std::hash<minja::Value>::operator()(minja::Value const&) const
monkey531[P]llama/common/minja.hpp
size_t operator()(const minja::Value & v) const { if (!v.is_hashable()) throw std::runtime_error("Unsupported type for hashing: " + v.dump()); return std::hash<json>()(v.get<json>()); }
O2
cpp
std::hash<minja::Value>::operator()(minja::Value const&) const: pushq %rbp pushq %r14 pushq %rbx subq $0x40, %rsp movq %rsi, %r14 movq %rsi, %rdi callq 0x675c4 testb %al, %al je 0x86c48 movq %rsp, %rbx movq %rbx, %rdi movq %r14, %rsi callq 0x86ce4 movq %rbx, %rdi callq 0x87098 movq %rax, %rbx movq %rsp, %rdi callq 0x41bb8 movq %rbx, %rax addq $0x40, %rsp popq %rbx popq %r14 popq %rbp retq pushq $0x10 popq %rdi callq 0x24480 movq %rax, %rbx leaq 0x20(%rsp), %rdi pushq $-0x1 popq %rdx movq %r14, %rsi xorl %ecx, %ecx callq 0x675d4 leaq 0x32a0f(%rip), %rsi # 0xb967b movq %rsp, %rdi leaq 0x20(%rsp), %rdx callq 0x5ce32 movb $0x1, %bpl movq %rsp, %rsi movq %rbx, %rdi callq 0x24ec0 xorl %ebp, %ebp movq 0x7c360(%rip), %rsi # 0x102ff0 movq 0x7c2c1(%rip), %rdx # 0x102f58 movq %rbx, %rdi callq 0x24fa0 movq %rax, %r14 movq %rsp, %rdi callq 0x25288 jmp 0x86cb2 movq %rax, %r14 movb $0x1, %bpl leaq 0x20(%rsp), %rdi callq 0x25288 testb %bpl, %bpl jne 0x86cc6 jmp 0x86cdb movq %rax, %r14 movq %rbx, %rdi callq 0x246c0 jmp 0x86cdb movq %rax, %r14 movq %rsp, %rdi callq 0x41bb8 movq %r14, %rdi callq 0x25020 nop
_ZNKSt4hashIN5minja5ValueEEclERKS1_: push rbp push r14 push rbx sub rsp, 40h mov r14, rsi mov rdi, rsi; this call _ZNK5minja5Value12is_primitiveEv; minja::Value::is_primitive(void) test al, al jz short loc_86C48 mov rbx, rsp mov rdi, rbx mov rsi, r14 call _ZNK5minja5Value3getIN8nlohmann16json_abi_v3_11_310basic_jsonINS3_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS3_14adl_serializerES6_IhSaIhEEvEEEET_v; minja::Value::get<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>>(void) mov rdi, rbx call _ZN8nlohmann16json_abi_v3_11_36detail4hashINS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES5_IhSaIhEEvEEEEmRKT_; nlohmann::json_abi_v3_11_3::detail::hash<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>>(nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void> const&) mov rbx, rax mov rdi, rsp call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvED2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::~basic_json() mov rax, rbx add rsp, 40h pop rbx pop r14 pop rbp retn loc_86C48: push 10h pop rdi; thrown_size call ___cxa_allocate_exception mov rbx, rax lea rdi, [rsp+58h+var_38] push 0FFFFFFFFFFFFFFFFh pop rdx mov rsi, r14 xor ecx, ecx call _ZNK5minja5Value4dumpB5cxx11Eib; minja::Value::dump(int,bool) lea rsi, aUnsupportedTyp; "Unsupported type for hashing: " mov rdi, rsp lea rdx, [rsp+58h+var_38] call _ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_; std::operator+<char>(char const*,std::string&&) mov bpl, 1 mov rsi, rsp mov rdi, rbx call __ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE; std::runtime_error::runtime_error(std::string const&) xor ebp, ebp mov rsi, cs:_ZTISt13runtime_error_ptr; lptinfo mov rdx, cs:_ZNSt13runtime_errorD1Ev_ptr; void (*)(void *) mov rdi, rbx; void * call ___cxa_throw mov r14, rax mov rdi, rsp; void * call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() jmp short loc_86CB2 mov r14, rax mov bpl, 1 loc_86CB2: lea rdi, [rsp+58h+var_38]; void * call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() test bpl, bpl jnz short loc_86CC6 jmp short loc_86CDB mov r14, rax loc_86CC6: mov rdi, rbx; void * call ___cxa_free_exception jmp short loc_86CDB mov r14, rax mov rdi, rsp call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvED2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::~basic_json() loc_86CDB: mov rdi, r14 call __Unwind_Resume
long long std::hash<minja::Value>::operator()(long long a1, minja::Value *a2) { long long v2; // rbx void *exception; // rbx _BYTE v5[32]; // [rsp+0h] [rbp-58h] BYREF _BYTE v6[56]; // [rsp+20h] [rbp-38h] BYREF if ( !minja::Value::is_primitive(a2) ) { exception = __cxa_allocate_exception(0x10uLL); minja::Value::dump[abi:cxx11]((long long)v6, (long long)a2, 0xFFFFFFFF, 0); std::operator+<char>((long long)v5, (long long)"Unsupported type for hashing: ", (long long)v6); std::runtime_error::runtime_error(exception, v5); __cxa_throw( exception, (struct type_info *)&`typeinfo for'std::runtime_error, (void (*)(void *))&std::runtime_error::~runtime_error); } minja::Value::get<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>>( v5, a2); v2 = nlohmann::json_abi_v3_11_3::detail::hash<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>>(v5); nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::~basic_json((long long)v5); return v2; }
operator(): PUSH RBP PUSH R14 PUSH RBX SUB RSP,0x40 MOV R14,RSI MOV RDI,RSI CALL 0x001675c4 TEST AL,AL JZ 0x00186c48 MOV RBX,RSP MOV RDI,RBX MOV RSI,R14 CALL 0x00186ce4 LAB_00186c29: MOV RDI,RBX CALL 0x00187098 LAB_00186c31: MOV RBX,RAX MOV RDI,RSP CALL 0x00141bb8 MOV RAX,RBX ADD RSP,0x40 POP RBX POP R14 POP RBP RET LAB_00186c48: PUSH 0x10 POP RDI CALL 0x00124480 MOV RBX,RAX LAB_00186c53: LEA RDI,[RSP + 0x20] PUSH -0x1 POP RDX MOV RSI,R14 XOR ECX,ECX CALL 0x001675d4 LAB_00186c65: LEA RSI,[0x1b967b] MOV RDI,RSP LEA RDX,[RSP + 0x20] CALL 0x0015ce32 MOV BPL,0x1 LAB_00186c7c: MOV RSI,RSP MOV RDI,RBX CALL 0x00124ec0 XOR EBP,EBP MOV RSI,qword ptr [0x00202ff0] MOV RDX,qword ptr [0x00202f58] MOV RDI,RBX CALL 0x00124fa0
/* std::hash<minja::Value>::TEMPNAMEPLACEHOLDERVALUE(minja::Value const&) const */ ulong __thiscall std::hash<minja::Value>::operator()(hash<minja::Value> *this,Value *param_1) { char cVar1; ulong uVar2; runtime_error *this_00; basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> abStack_58 [32]; int1 local_38 [32]; cVar1 = minja::Value::is_primitive(param_1); if (cVar1 != '\0') { minja::Value:: get<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void>> (); /* try { // try from 00186c29 to 00186c30 has its CatchHandler @ 00186cd0 */ uVar2 = nlohmann::json_abi_v3_11_3::detail:: hash<nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void>> (abStack_58); nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::~basic_json(abStack_58); return uVar2; } this_00 = (runtime_error *)__cxa_allocate_exception(0x10); /* try { // try from 00186c53 to 00186c64 has its CatchHandler @ 00186cc3 */ minja::Value::dump_abi_cxx11_((int)local_38,SUB81(param_1,0)); /* try { // try from 00186c65 to 00186c78 has its CatchHandler @ 00186cac */ operator+((char *)abStack_58,(string *)"Unsupported type for hashing: "); /* try { // try from 00186c7c to 00186c9e has its CatchHandler @ 00186c9f */ std::runtime_error::runtime_error(this_00,(string *)abStack_58); /* WARNING: Subroutine does not return */ __cxa_throw(this_00,PTR_typeinfo_00202ff0,PTR__runtime_error_00202f58); }
2,934
ma_dynstr_append_quoted
eloqsql/libmariadb/libmariadb/ma_string.c
my_bool ma_dynstr_append_quoted(DYNAMIC_STRING *str, const char *append, size_t len, char quote) { size_t additional= str->alloc_increment; size_t lim= additional; uint i; if (ma_dynstr_realloc(str, len + additional + 2)) return TRUE; str->str[str->length++]= quote; for (i= 0; i < len; i++) { register char c= append[i]; if (c == quote || c == '\\') { if (!lim) { if (ma_dynstr_realloc(str, additional)) return TRUE; lim= additional; } lim--; str->str[str->length++]= '\\'; } str->str[str->length++]= c; } str->str[str->length++]= quote; return FALSE; }
O3
c
ma_dynstr_append_quoted: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl %ecx, -0x2c(%rbp) movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r14 movq 0x18(%rdi), %rbx leaq (%rdx,%rbx), %rsi addq $0x2, %rsi callq 0x53cb1 movb $0x1, %cl testb %al, %al jne 0x53e96 movq %rbx, -0x38(%rbp) movq (%r14), %rax movq 0x8(%r14), %rcx leaq 0x1(%rcx), %rdx movq %rdx, 0x8(%r14) movl -0x2c(%rbp), %edx movb %dl, (%rax,%rcx) testq %r15, %r15 je 0x53e7f movq %r12, %rdi movl $0x1, %r12d xorl %eax, %eax movq -0x38(%rbp), %rbx movq %r15, -0x40(%rbp) movb (%rdi,%rax), %r13b cmpb -0x2c(%rbp), %r13b setne %al cmpb $0x5c, %r13b setne %dl testb %dl, %al jne 0x53e61 testq %rbx, %rbx jne 0x53e4b movq %rdi, %r15 movq %r14, %rdi movq -0x38(%rbp), %rbx movq %rbx, %rsi callq 0x53cb1 movq %r15, %rdi movq -0x40(%rbp), %r15 testb %al, %al jne 0x53ea7 decq %rbx movq (%r14), %rax movq 0x8(%r14), %rdx leaq 0x1(%rdx), %rsi movq %rsi, 0x8(%r14) movb $0x5c, (%rax,%rdx) movq (%r14), %rax movq 0x8(%r14), %rdx leaq 0x1(%rdx), %rsi movq %rsi, 0x8(%r14) movb %r13b, (%rax,%rdx) movl %r12d, %eax incl %r12d cmpq %r15, %rax jb 0x53e13 movq (%r14), %rax movq 0x8(%r14), %rcx leaq 0x1(%rcx), %rdx movq %rdx, 0x8(%r14) movl -0x2c(%rbp), %edx movb %dl, (%rax,%rcx) xorl %ecx, %ecx movl %ecx, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movb $0x1, %cl jmp 0x53e96
ma_dynstr_append_quoted: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 18h mov [rbp+var_2C], ecx mov r15, rdx mov r12, rsi mov r14, rdi mov rbx, [rdi+18h] lea rsi, [rdx+rbx] add rsi, 2 call ma_dynstr_realloc mov cl, 1 test al, al jnz loc_53E96 mov [rbp+var_38], rbx mov rax, [r14] mov rcx, [r14+8] lea rdx, [rcx+1] mov [r14+8], rdx mov edx, [rbp+var_2C] mov [rax+rcx], dl test r15, r15 jz short loc_53E7F mov rdi, r12 mov r12d, 1 xor eax, eax mov rbx, [rbp+var_38] mov [rbp+var_40], r15 loc_53E13: mov r13b, [rdi+rax] cmp r13b, byte ptr [rbp+var_2C] setnz al cmp r13b, 5Ch ; '\' setnz dl test al, dl jnz short loc_53E61 test rbx, rbx jnz short loc_53E4B mov r15, rdi mov rdi, r14 mov rbx, [rbp+var_38] mov rsi, rbx call ma_dynstr_realloc mov rdi, r15 mov r15, [rbp+var_40] test al, al jnz short loc_53EA7 loc_53E4B: dec rbx mov rax, [r14] mov rdx, [r14+8] lea rsi, [rdx+1] mov [r14+8], rsi mov byte ptr [rax+rdx], 5Ch ; '\' loc_53E61: mov rax, [r14] mov rdx, [r14+8] lea rsi, [rdx+1] mov [r14+8], rsi mov [rax+rdx], r13b mov eax, r12d inc r12d cmp rax, r15 jb short loc_53E13 loc_53E7F: mov rax, [r14] mov rcx, [r14+8] lea rdx, [rcx+1] mov [r14+8], rdx mov edx, [rbp+var_2C] mov [rax+rcx], dl xor ecx, ecx loc_53E96: mov eax, ecx add rsp, 18h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_53EA7: mov cl, 1 jmp short loc_53E96
long long ma_dynstr_append_quoted(long long *a1, long long a2, unsigned long long a3, char a4) { unsigned long long v4; // r15 long long v5; // rbx bool v6; // al unsigned int v7; // ecx long long v8; // rax long long v9; // rcx unsigned int v10; // r12d unsigned long long v11; // rax char v12; // r13 long long v13; // rax long long v14; // rdx long long v15; // rax long long v16; // rdx long long v17; // rax long long v18; // rcx unsigned long long v20; // [rsp+0h] [rbp-40h] long long v21; // [rsp+8h] [rbp-38h] v4 = a3; v5 = a1[3]; v6 = ma_dynstr_realloc(a1, a3 + v5 + 2); LOBYTE(v7) = 1; if ( !v6 ) { v21 = v5; v8 = *a1; v9 = a1[1]; a1[1] = v9 + 1; *(_BYTE *)(v8 + v9) = a4; if ( v4 ) { v10 = 1; v11 = 0LL; v20 = v4; do { v12 = *(_BYTE *)(a2 + v11); if ( v12 == 92 || v12 == a4 ) { if ( !v5 ) { v5 = v21; v4 = v20; if ( ma_dynstr_realloc(a1, v21) ) { LOBYTE(v7) = 1; return v7; } } --v5; v13 = *a1; v14 = a1[1]; a1[1] = v14 + 1; *(_BYTE *)(v13 + v14) = 92; } v15 = *a1; v16 = a1[1]; a1[1] = v16 + 1; *(_BYTE *)(v15 + v16) = v12; v11 = v10++; } while ( v11 < v4 ); } v17 = *a1; v18 = a1[1]; a1[1] = v18 + 1; *(_BYTE *)(v17 + v18) = a4; return 0; } return v7; }
ma_dynstr_append_quoted: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x18 MOV dword ptr [RBP + -0x2c],ECX MOV R15,RDX MOV R12,RSI MOV R14,RDI MOV RBX,qword ptr [RDI + 0x18] LEA RSI,[RDX + RBX*0x1] ADD RSI,0x2 CALL 0x00153cb1 MOV CL,0x1 TEST AL,AL JNZ 0x00153e96 MOV qword ptr [RBP + -0x38],RBX MOV RAX,qword ptr [R14] MOV RCX,qword ptr [R14 + 0x8] LEA RDX,[RCX + 0x1] MOV qword ptr [R14 + 0x8],RDX MOV EDX,dword ptr [RBP + -0x2c] MOV byte ptr [RAX + RCX*0x1],DL TEST R15,R15 JZ 0x00153e7f MOV RDI,R12 MOV R12D,0x1 XOR EAX,EAX MOV RBX,qword ptr [RBP + -0x38] MOV qword ptr [RBP + -0x40],R15 LAB_00153e13: MOV R13B,byte ptr [RDI + RAX*0x1] CMP R13B,byte ptr [RBP + -0x2c] SETNZ AL CMP R13B,0x5c SETNZ DL TEST AL,DL JNZ 0x00153e61 TEST RBX,RBX JNZ 0x00153e4b MOV R15,RDI MOV RDI,R14 MOV RBX,qword ptr [RBP + -0x38] MOV RSI,RBX CALL 0x00153cb1 MOV RDI,R15 MOV R15,qword ptr [RBP + -0x40] TEST AL,AL JNZ 0x00153ea7 LAB_00153e4b: DEC RBX MOV RAX,qword ptr [R14] MOV RDX,qword ptr [R14 + 0x8] LEA RSI,[RDX + 0x1] MOV qword ptr [R14 + 0x8],RSI MOV byte ptr [RAX + RDX*0x1],0x5c LAB_00153e61: MOV RAX,qword ptr [R14] MOV RDX,qword ptr [R14 + 0x8] LEA RSI,[RDX + 0x1] MOV qword ptr [R14 + 0x8],RSI MOV byte ptr [RAX + RDX*0x1],R13B MOV EAX,R12D INC R12D CMP RAX,R15 JC 0x00153e13 LAB_00153e7f: MOV RAX,qword ptr [R14] MOV RCX,qword ptr [R14 + 0x8] LEA RDX,[RCX + 0x1] MOV qword ptr [R14 + 0x8],RDX MOV EDX,dword ptr [RBP + -0x2c] MOV byte ptr [RAX + RCX*0x1],DL XOR ECX,ECX LAB_00153e96: MOV EAX,ECX ADD RSP,0x18 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_00153ea7: MOV CL,0x1 JMP 0x00153e96
ulong ma_dynstr_append_quoted(long *param_1,long param_2,ulong param_3,int8 param_4) { char cVar1; long lVar2; long lVar3; char cVar4; char cVar5; ulong uVar6; int8 uVar7; long lVar8; long lVar9; ulong uVar10; bool bVar11; lVar2 = param_1[3]; uVar7 = param_4; cVar4 = ma_dynstr_realloc(param_1,param_3 + lVar2 + 2); uVar6 = CONCAT71((int7)((ulong)uVar7 >> 8),1); if (cVar4 == '\0') { lVar8 = param_1[1]; param_1[1] = lVar8 + 1; cVar4 = (char)param_4; *(char *)(*param_1 + lVar8) = cVar4; if (param_3 != 0) { uVar6 = 0; lVar9 = lVar2; uVar10 = 1; do { cVar1 = *(char *)(param_2 + uVar6); if (cVar1 == cVar4 || cVar1 == '\\') { if (lVar9 == 0) { cVar5 = ma_dynstr_realloc(param_1,lVar2); lVar9 = lVar2; if (cVar5 != '\0') { uVar6 = CONCAT71((int7)((ulong)lVar8 >> 8),1); goto LAB_00153e96; } } lVar9 = lVar9 + -1; lVar3 = param_1[1]; param_1[1] = lVar3 + 1; *(int1 *)(*param_1 + lVar3) = 0x5c; } lVar3 = param_1[1]; param_1[1] = lVar3 + 1; *(char *)(*param_1 + lVar3) = cVar1; bVar11 = uVar10 < param_3; uVar6 = uVar10; uVar10 = (ulong)((int)uVar10 + 1); } while (bVar11); } lVar2 = param_1[1]; param_1[1] = lVar2 + 1; *(char *)(*param_1 + lVar2) = cVar4; uVar6 = 0; } LAB_00153e96: return uVar6 & 0xffffffff; }
2,935
translog_assign_id_to_share
eloqsql/storage/maria/ma_loghandler.c
int translog_assign_id_to_share(MARIA_HA *tbl_info, TRN *trn) { uint16 id; MARIA_SHARE *share= tbl_info->s; /* If you give an id to a non-BLOCK_RECORD table, you also need to release this id somewhere. Then you can change the assertion. */ DBUG_ASSERT(share->data_file_type == BLOCK_RECORD); /* re-check under mutex to avoid having 2 ids for the same share */ mysql_mutex_lock(&share->intern_lock); if (unlikely(share->id == 0)) { LSN lsn; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 2]; uchar log_data[FILEID_STORE_SIZE]; /* Inspired by set_short_trid() of trnman.c */ uint i= share->kfile.file % SHARE_ID_MAX + 1; id= 0; do { for ( ; i <= SHARE_ID_MAX ; i++) /* the range is [1..SHARE_ID_MAX] */ { void *tmp= NULL; if (id_to_share[i] == NULL && my_atomic_casptr((void **)&id_to_share[i], &tmp, share)) { id= (uint16) i; break; } } i= 1; /* scan the whole array */ } while (id == 0); DBUG_PRINT("info", ("id_to_share: %p -> %u", share, id)); fileid_store(log_data, id); log_array[TRANSLOG_INTERNAL_PARTS + 0].str= log_data; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data); /* open_file_name is an unresolved name (symlinks are not resolved, datadir is not realpath-ed, etc) which is good: the log can be moved to another directory and continue working. */ log_array[TRANSLOG_INTERNAL_PARTS + 1].str= (uchar *)share->open_file_name.str; log_array[TRANSLOG_INTERNAL_PARTS + 1].length= share->open_file_name.length + 1; /* We can't unlock share->intern_lock before the log entry is written to ensure no one uses the id before it's logged. */ if (unlikely(translog_write_record(&lsn, LOGREC_FILE_ID, trn, tbl_info, (translog_size_t) (sizeof(log_data) + log_array[TRANSLOG_INTERNAL_PARTS + 1].length), sizeof(log_array)/sizeof(log_array[0]), log_array, NULL, NULL))) { mysql_mutex_unlock(&share->intern_lock); return 1; } /* Now when translog record is done, we can set share->id. If we set it before, then translog_write_record may pick up the id before it's written to the log. */ share->id= id; share->state.logrec_file_id= lsn; } mysql_mutex_unlock(&share->intern_lock); return 0; }
O3
c
translog_assign_id_to_share: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rsi, %r15 movq %rdi, %r14 movq (%rdi), %r12 leaq 0x8f0(%r12), %rbx cmpq $0x0, 0x930(%r12) jne 0x4be0f movq %rbx, %rdi callq 0x29220 cmpw $0x0, 0x620(%r12) je 0x4be25 movq 0x930(%r12), %rdi testq %rdi, %rdi jne 0x4bf0e movq %rbx, %rdi callq 0x291e0 xorl %eax, %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x8e040(%rip), %rsi # 0xd9e56 movq %rbx, %rdi movl $0x206a, %edx # imm = 0x206A callq 0x2eb8f jmp 0x4bdd9 movslq 0x760(%r12), %rax imulq $-0x7fff7fff, %rax, %rcx # imm = 0x80008001 shrq $0x20, %rcx addl %eax, %ecx movl %ecx, %edx shrl $0x1f, %edx sarl $0xf, %ecx addl %edx, %ecx movl %ecx, %edx shll $0x10, %edx subl %edx, %ecx addl %ecx, %eax incl %eax cmpl $0xffff, %eax # imm = 0xFFFF ja 0x4be84 movl %eax, %r13d movq 0xbb3878(%rip), %rcx # 0xbff6d8 cmpq $0x0, (%rcx,%r13,8) jne 0x4be78 xorl %eax, %eax lock cmpxchgq %r12, (%rcx,%r13,8) je 0x4be87 movq 0xbb3860(%rip), %rcx # 0xbff6d8 incq %r13 cmpl $0x10000, %r13d # imm = 0x10000 jne 0x4be60 xorl %r13d, %r13d movl $0x1, %eax testw %r13w, %r13w je 0x4be4f leaq -0x2a(%rbp), %rax movw %r13w, (%rax) leaq -0x80(%rbp), %rcx movq %rax, 0x20(%rcx) movq $0x2, 0x28(%rcx) movq 0x5e0(%r12), %rax movq %rax, 0x30(%rcx) movq 0x5e8(%r12), %r8 leaq 0x1(%r8), %rax movq %rax, 0x38(%rcx) addl $0x3, %r8d xorps %xmm0, %xmm0 movups %xmm0, 0x8(%rsp) movq %rcx, (%rsp) leaq -0x38(%rbp), %rdi movl $0x23, %esi movq %r15, %rdx movq %r14, %rcx movl $0x4, %r9d callq 0x2a8ac testb %al, %al jne 0x4bf23 movw %r13w, 0x620(%r12) movq -0x38(%rbp), %rax movq %rax, 0x190(%r12) jmp 0x4bde5 leaq 0x33a0fb(%rip), %rax # 0x386010 movq (%rax), %rax callq *0x160(%rax) jmp 0x4bdf6 movq 0x930(%r12), %rdi testq %rdi, %rdi jne 0x4bf42 movq %rbx, %rdi callq 0x291e0 movl $0x1, %eax jmp 0x4be00 leaq 0x33a0c7(%rip), %rax # 0x386010 movq (%rax), %rax callq *0x160(%rax) jmp 0x4bf30
translog_assign_id_to_share: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 78h mov r15, rsi mov r14, rdi mov r12, [rdi] lea rbx, [r12+8F0h] cmp qword ptr [r12+930h], 0 jnz short loc_4BE0F mov rdi, rbx call _pthread_mutex_lock loc_4BDD9: cmp word ptr [r12+620h], 0 jz short loc_4BE25 loc_4BDE5: mov rdi, [r12+930h] test rdi, rdi jnz loc_4BF0E loc_4BDF6: mov rdi, rbx call _pthread_mutex_unlock xor eax, eax loc_4BE00: add rsp, 78h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_4BE0F: lea rsi, aWorkspaceLlm4b_7; "/workspace/llm4binary/github2025/eloqsq"... mov rdi, rbx mov edx, 206Ah call psi_mutex_lock jmp short loc_4BDD9 loc_4BE25: movsxd rax, dword ptr [r12+760h] imul rcx, rax, 0FFFFFFFF80008001h shr rcx, 20h add ecx, eax mov edx, ecx shr edx, 1Fh sar ecx, 0Fh add ecx, edx mov edx, ecx shl edx, 10h sub ecx, edx add eax, ecx inc eax loc_4BE4F: cmp eax, 0FFFFh ja short loc_4BE84 mov r13d, eax mov rcx, cs:id_to_share loc_4BE60: cmp qword ptr [rcx+r13*8], 0 jnz short loc_4BE78 xor eax, eax lock cmpxchg [rcx+r13*8], r12 jz short loc_4BE87 mov rcx, cs:id_to_share loc_4BE78: inc r13 cmp r13d, offset stru_10000 jnz short loc_4BE60 loc_4BE84: xor r13d, r13d loc_4BE87: mov eax, 1 test r13w, r13w jz short loc_4BE4F lea rax, [rbp+var_2A] mov [rax], r13w lea rcx, [rbp+var_80] mov [rcx+20h], rax mov qword ptr [rcx+28h], 2 mov rax, [r12+5E0h] mov [rcx+30h], rax mov r8, [r12+5E8h] lea rax, [r8+1] mov [rcx+38h], rax add r8d, 3 xorps xmm0, xmm0 movups [rsp+0A0h+var_98], xmm0 mov [rsp+0A0h+var_A0], rcx lea rdi, [rbp+var_38] mov esi, 23h ; '#' mov rdx, r15 mov rcx, r14 mov r9d, 4 call translog_write_record test al, al jnz short loc_4BF23 mov [r12+620h], r13w mov rax, [rbp+var_38] mov [r12+190h], rax jmp loc_4BDE5 loc_4BF0E: lea rax, PSI_server mov rax, [rax] call qword ptr [rax+160h] jmp loc_4BDF6 loc_4BF23: mov rdi, [r12+930h] test rdi, rdi jnz short loc_4BF42 loc_4BF30: mov rdi, rbx call _pthread_mutex_unlock mov eax, 1 jmp loc_4BE00 loc_4BF42: lea rax, PSI_server mov rax, [rax] call qword ptr [rax+160h] jmp short loc_4BF30
long long translog_assign_id_to_share(signed long long *a1, long long a2) { signed long long v2; // r12 long long v3; // rbx unsigned int v5; // eax long long v6; // r13 long long v7; // rcx long long v8; // r8 __int128 v9; // [rsp+20h] [rbp-80h] BYREF __int16 *v10; // [rsp+40h] [rbp-60h] long long v11; // [rsp+48h] [rbp-58h] long long v12; // [rsp+50h] [rbp-50h] long long v13; // [rsp+58h] [rbp-48h] long long v14; // [rsp+68h] [rbp-38h] BYREF __int16 v15; // [rsp+76h] [rbp-2Ah] BYREF v2 = *a1; v3 = *a1 + 2288; if ( *(_QWORD *)(*a1 + 2352) ) psi_mutex_lock( *a1 + 2288, (long long)"/workspace/llm4binary/github2025/eloqsql/storage/maria/ma_loghandler.c", 0x206Au); else pthread_mutex_lock(*a1 + 2288); if ( *(_WORD *)(v2 + 1568) ) { LABEL_4: if ( *(_QWORD *)(v2 + 2352) ) PSI_server[44](); pthread_mutex_unlock(v3); return 0LL; } v5 = *(_DWORD *)(v2 + 1888) % 0xFFFF + 1; do { if ( v5 <= 0xFFFF ) { v6 = v5; v7 = id_to_share; do { if ( !*(_QWORD *)(v7 + 8 * v6) ) { if ( !_InterlockedCompareExchange64((volatile signed long long *)(v7 + 8 * v6), v2, 0LL) ) goto LABEL_16; v7 = id_to_share; } ++v6; } while ( (_DWORD)v6 != (_DWORD)&stru_10000 ); } LOWORD(v6) = 0; LABEL_16: v5 = 1; } while ( !(_WORD)v6 ); v15 = v6; v10 = &v15; v11 = 2LL; v12 = *(_QWORD *)(v2 + 1504); v8 = *(_QWORD *)(v2 + 1512); v13 = v8 + 1; if ( !(unsigned __int8)translog_write_record( (unsigned long long)&v14, (long long *)((char *)&qword_20 + 3), a2, a1, (int)v8 + 3, 4, &v9, 0LL, 0LL) ) { *(_WORD *)(v2 + 1568) = v6; *(_QWORD *)(v2 + 400) = v14; goto LABEL_4; } if ( *(_QWORD *)(v2 + 2352) ) PSI_server[44](); pthread_mutex_unlock(v3); return 1LL; }
translog_assign_id_to_share: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x78 MOV R15,RSI MOV R14,RDI MOV R12,qword ptr [RDI] LEA RBX,[R12 + 0x8f0] CMP qword ptr [R12 + 0x930],0x0 JNZ 0x0014be0f MOV RDI,RBX CALL 0x00129220 LAB_0014bdd9: CMP word ptr [R12 + 0x620],0x0 JZ 0x0014be25 LAB_0014bde5: MOV RDI,qword ptr [R12 + 0x930] TEST RDI,RDI JNZ 0x0014bf0e LAB_0014bdf6: MOV RDI,RBX CALL 0x001291e0 XOR EAX,EAX LAB_0014be00: ADD RSP,0x78 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_0014be0f: LEA RSI,[0x1d9e56] MOV RDI,RBX MOV EDX,0x206a CALL 0x0012eb8f JMP 0x0014bdd9 LAB_0014be25: MOVSXD RAX,dword ptr [R12 + 0x760] IMUL RCX,RAX,-0x7fff7fff SHR RCX,0x20 ADD ECX,EAX MOV EDX,ECX SHR EDX,0x1f SAR ECX,0xf ADD ECX,EDX MOV EDX,ECX SHL EDX,0x10 SUB ECX,EDX ADD EAX,ECX INC EAX LAB_0014be4f: CMP EAX,0xffff JA 0x0014be84 MOV R13D,EAX MOV RCX,qword ptr [0x00cff6d8] LAB_0014be60: CMP qword ptr [RCX + R13*0x8],0x0 JNZ 0x0014be78 XOR EAX,EAX CMPXCHG.LOCK qword ptr [RCX + R13*0x8],R12 JZ 0x0014be87 MOV RCX,qword ptr [0x00cff6d8] LAB_0014be78: INC R13 CMP R13D,0x10000 JNZ 0x0014be60 LAB_0014be84: XOR R13D,R13D LAB_0014be87: MOV EAX,0x1 TEST R13W,R13W JZ 0x0014be4f LEA RAX,[RBP + -0x2a] MOV word ptr [RAX],R13W LEA RCX,[RBP + -0x80] MOV qword ptr [RCX + 0x20],RAX MOV qword ptr [RCX + 0x28],0x2 MOV RAX,qword ptr [R12 + 0x5e0] MOV qword ptr [RCX + 0x30],RAX MOV R8,qword ptr [R12 + 0x5e8] LEA RAX,[R8 + 0x1] MOV qword ptr [RCX + 0x38],RAX ADD R8D,0x3 XORPS XMM0,XMM0 MOVUPS xmmword ptr [RSP + 0x8],XMM0 MOV qword ptr [RSP],RCX LEA RDI,[RBP + -0x38] MOV ESI,0x23 MOV RDX,R15 MOV RCX,R14 MOV R9D,0x4 CALL 0x0012a8ac TEST AL,AL JNZ 0x0014bf23 MOV word ptr [R12 + 0x620],R13W MOV RAX,qword ptr [RBP + -0x38] MOV qword ptr [R12 + 0x190],RAX JMP 0x0014bde5 LAB_0014bf0e: LEA RAX,[0x486010] MOV RAX,qword ptr [RAX] CALL qword ptr [RAX + 0x160] JMP 0x0014bdf6 LAB_0014bf23: MOV RDI,qword ptr [R12 + 0x930] TEST RDI,RDI JNZ 0x0014bf42 LAB_0014bf30: MOV RDI,RBX CALL 0x001291e0 MOV EAX,0x1 JMP 0x0014be00 LAB_0014bf42: LEA RAX,[0x486010] MOV RAX,qword ptr [RAX] CALL qword ptr [RAX + 0x160] JMP 0x0014bf30
int8 translog_assign_id_to_share(long *param_1,int8 param_2) { long *plVar1; pthread_mutex_t *__mutex; long lVar2; char cVar3; long lVar4; short sVar5; ulong uVar6; ulong uVar7; bool bVar8; int1 local_88 [32]; short *local_68; int8 local_60; int8 local_58; long local_50; int8 local_40; short local_32; lVar2 = *param_1; __mutex = (pthread_mutex_t *)(lVar2 + 0x8f0); if (*(long *)(lVar2 + 0x930) == 0) { pthread_mutex_lock(__mutex); } else { psi_mutex_lock(__mutex,"/workspace/llm4binary/github2025/eloqsql/storage/maria/ma_loghandler.c", 0x206a); } if (*(short *)(lVar2 + 0x620) == 0) { uVar6 = (ulong)(*(int *)(lVar2 + 0x760) % 0xffff + 1); do { lVar4 = id_to_share; if ((uint)uVar6 < 0x10000) { do { if (*(long *)(lVar4 + uVar6 * 8) == 0) { plVar1 = (long *)(lVar4 + uVar6 * 8); LOCK(); bVar8 = *plVar1 == 0; if (bVar8) { *plVar1 = lVar2; } UNLOCK(); lVar4 = id_to_share; uVar7 = uVar6; if (bVar8) goto LAB_0014be87; } uVar6 = uVar6 + 1; } while ((int)uVar6 != 0x10000); } uVar7 = 0; LAB_0014be87: uVar6 = 1; sVar5 = (short)uVar7; } while (sVar5 == 0); local_68 = &local_32; local_60 = 2; local_58 = *(int8 *)(lVar2 + 0x5e0); local_50 = *(long *)(lVar2 + 0x5e8) + 1; local_32 = sVar5; cVar3 = translog_write_record (&local_40,0x23,param_2,param_1,(int)*(long *)(lVar2 + 0x5e8) + 3,4,local_88,0 ,0); if (cVar3 != '\0') { if (*(long *)(lVar2 + 0x930) != 0) { (**(code **)(PSI_server + 0x160))(); } pthread_mutex_unlock(__mutex); return 1; } *(short *)(lVar2 + 0x620) = sVar5; *(int8 *)(lVar2 + 400) = local_40; } if (*(long *)(lVar2 + 0x930) != 0) { (**(code **)(PSI_server + 0x160))(); } pthread_mutex_unlock(__mutex); return 0; }
2,936
my_wc_to_printable_8bit
eloqsql/strings/ctype.c
int my_wc_to_printable_8bit(CHARSET_INFO *cs, my_wc_t wc, uchar *str, uchar *end) { /* Special case: swe7 does not have the backslash character. Use dot instead of backslash for escaping. */ uint bs= cs->tab_to_uni && cs->tab_to_uni['\\'] != '\\' ? '.' : '\\'; DBUG_ASSERT(cs->mbminlen == 1); /* Additionally, if the original swe7 string contains backslashes, replace them to dots, so this error message: Invalid swe7 character string: '\xEF\xBC\xB4' is displayed as: Invalid swe7 character string: '.xEF.xBC.xB4' which is more readable than what would happen without '\'-to-dot mapping: Invalid swe7 character string: '.005CxEF.005CxBC.005CxB4' */ if (bs == '.' && wc == '\\') wc= '.'; return my_wc_to_printable_ex(cs, wc, str, end, bs, 1, 1); }
O3
c
my_wc_to_printable_8bit: movq 0x68(%rdi), %rax testq %rax, %rax je 0xd1b59 cmpw $0x5c, 0xb8(%rax) setne %al movl $0x2e, %r9d movl $0x5c, %r8d cmovnel %r9d, %r8d jmp 0xd1b61 movl $0x5c, %r8d xorl %eax, %eax pushq %rbp movq %rsp, %rbp subq $0x10, %rsp testb %al, %al movl $0x2e, %eax cmoveq %rsi, %rax cmpq $0x5c, %rsi cmovneq %rsi, %rax movl $0x1, (%rsp) movq %rax, %rsi movl $0x1, %r9d callq 0xd198c addq $0x10, %rsp popq %rbp retq
my_wc_to_printable_8bit: mov rax, [rdi+68h] test rax, rax jz short loc_D1B59 cmp word ptr [rax+0B8h], 5Ch ; '\' setnz al mov r9d, 2Eh ; '.' mov r8d, 5Ch ; '\' cmovnz r8d, r9d jmp short loc_D1B61 loc_D1B59: mov r8d, 5Ch ; '\' xor eax, eax loc_D1B61: push rbp mov rbp, rsp sub rsp, 10h test al, al mov eax, 2Eh ; '.' cmovz rax, rsi cmp rsi, 5Ch ; '\' cmovnz rax, rsi mov [rsp+18h+var_18], 1 mov rsi, rax mov r9d, 1 call my_wc_to_printable_ex add rsp, 10h pop rbp retn
long long my_wc_to_printable_8bit(long long a1, unsigned long long a2, _BYTE *a3, unsigned long long a4) { long long v4; // rax bool v5; // zf bool v6; // al char v7; // r8 unsigned long long v8; // rax v4 = *(_QWORD *)(a1 + 104); if ( v4 ) { v5 = *(_WORD *)(v4 + 184) == 92; v6 = *(_WORD *)(v4 + 184) != 92; v7 = 92; if ( !v5 ) v7 = 46; } else { v7 = 92; v6 = 0; } v5 = !v6; v8 = 46LL; if ( v5 ) v8 = a2; if ( a2 != 92 ) v8 = a2; return my_wc_to_printable_ex(a1, v8, a3, a4, v7, 1u, 1u); }
my_wc_to_printable_8bit: MOV RAX,qword ptr [RDI + 0x68] TEST RAX,RAX JZ 0x001d1b59 CMP word ptr [RAX + 0xb8],0x5c SETNZ AL MOV R9D,0x2e MOV R8D,0x5c CMOVNZ R8D,R9D JMP 0x001d1b61 LAB_001d1b59: MOV R8D,0x5c XOR EAX,EAX LAB_001d1b61: PUSH RBP MOV RBP,RSP SUB RSP,0x10 TEST AL,AL MOV EAX,0x2e CMOVZ RAX,RSI CMP RSI,0x5c CMOVNZ RAX,RSI MOV dword ptr [RSP],0x1 MOV RSI,RAX MOV R9D,0x1 CALL 0x001d198c ADD RSP,0x10 POP RBP RET
void my_wc_to_printable_8bit(long param_1,long param_2,int8 param_3,int8 param_4) { long lVar1; int8 uVar2; bool bVar3; if (*(long *)(param_1 + 0x68) == 0) { uVar2 = 0x5c; bVar3 = false; } else { bVar3 = *(short *)(*(long *)(param_1 + 0x68) + 0xb8) != 0x5c; uVar2 = 0x5c; if (bVar3) { uVar2 = 0x2e; } } lVar1 = 0x2e; if (!bVar3) { lVar1 = param_2; } if (param_2 != 0x5c) { lVar1 = param_2; } my_wc_to_printable_ex(param_1,lVar1,param_3,param_4,uVar2,1,1); return; }
2,937
delete_tails
eloqsql/storage/maria/ma_blockrec.c
static my_bool delete_tails(MARIA_HA *info, MARIA_RECORD_POS *tails) { my_bool res= 0; DBUG_ENTER("delete_tails"); for (; *tails; tails++) { if (delete_head_or_tail(info, ma_recordpos_to_page(*tails), ma_recordpos_to_dir_entry(*tails), 0, 1)) res= 1; } DBUG_RETURN(res); }
O3
c
delete_tails: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movq (%rsi), %rax testq %rax, %rax je 0x5d388 movq %rsi, %rbx movq %rdi, %r14 addq $0x8, %rbx xorl %r15d, %r15d movl $0x1, %r12d movq %rax, %rsi shrq $0x8, %rsi movzbl %al, %edx movq %r14, %rdi xorl %ecx, %ecx movl $0x1, %r8d callq 0x5c845 testb %al, %al movzbl %r15b, %r15d cmovnel %r12d, %r15d movq (%rbx), %rax addq $0x8, %rbx testq %rax, %rax jne 0x5d356 jmp 0x5d38b xorl %r15d, %r15d movl %r15d, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
delete_tails: push rbp mov rbp, rsp push r15 push r14 push r12 push rbx mov rax, [rsi] test rax, rax jz short loc_5D388 mov rbx, rsi mov r14, rdi add rbx, 8 xor r15d, r15d mov r12d, 1 loc_5D356: mov rsi, rax shr rsi, 8 movzx edx, al mov rdi, r14 xor ecx, ecx mov r8d, 1 call delete_head_or_tail test al, al movzx r15d, r15b cmovnz r15d, r12d mov rax, [rbx] add rbx, 8 test rax, rax jnz short loc_5D356 jmp short loc_5D38B loc_5D388: xor r15d, r15d loc_5D38B: mov eax, r15d pop rbx pop r12 pop r14 pop r15 pop rbp retn
long long delete_tails(_DWORD *a1, unsigned long long *a2) { unsigned long long v2; // rax unsigned long long *v3; // rbx unsigned int v4; // r15d v2 = *a2; if ( *a2 ) { v3 = a2 + 1; LOBYTE(v4) = 0; do { v4 = (unsigned __int8)v4; if ( (unsigned __int8)delete_head_or_tail(a1, v2 >> 8, (unsigned __int8)v2, 0, 1) ) v4 = 1; v2 = *v3++; } while ( v2 ); } else { return 0; } return v4; }
delete_tails: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R12 PUSH RBX MOV RAX,qword ptr [RSI] TEST RAX,RAX JZ 0x0015d388 MOV RBX,RSI MOV R14,RDI ADD RBX,0x8 XOR R15D,R15D MOV R12D,0x1 LAB_0015d356: MOV RSI,RAX SHR RSI,0x8 MOVZX EDX,AL MOV RDI,R14 XOR ECX,ECX MOV R8D,0x1 CALL 0x0015c845 TEST AL,AL MOVZX R15D,R15B CMOVNZ R15D,R12D MOV RAX,qword ptr [RBX] ADD RBX,0x8 TEST RAX,RAX JNZ 0x0015d356 JMP 0x0015d38b LAB_0015d388: XOR R15D,R15D LAB_0015d38b: MOV EAX,R15D POP RBX POP R12 POP R14 POP R15 POP RBP RET
int4 delete_tails(int8 param_1,ulong *param_2) { char cVar1; ulong uVar2; int4 uVar3; uVar2 = *param_2; if (uVar2 == 0) { uVar3 = 0; } else { param_2 = param_2 + 1; uVar3 = 0; do { cVar1 = delete_head_or_tail(param_1,uVar2 >> 8,uVar2 & 0xff,0,1); if (cVar1 != '\0') { uVar3 = 1; } uVar2 = *param_2; param_2 = param_2 + 1; } while (uVar2 != 0); } return uVar3; }
2,938
mysql_free_result_start
eloqsql/libmariadb/libmariadb/mariadb_async.c
int STDCALL mysql_free_result_start(MYSQL_RES *result) { MK_ASYNC_START_BODY_VOID_RETURN( mysql_free_result, result->handle, { WIN_SET_NONBLOCKING(result->handle) parms.result= result; }, /* mysql_free_result() can have NULL in result->handle (this happens when all rows have been fetched and mysql_fetch_row() returned NULL.) So we cannot suspend, but it does not matter, as in this case mysql_free_result() cannot block. It is also legitimate to have NULL result, which will do nothing. */ if (!result || !result->handle) { mysql_free_result(result); return 0; }) }
O3
c
mysql_free_result_start: pushq %rbp movq %rsp, %rbp pushq %r14 pushq %rbx subq $0x10, %rsp movq %rdi, %rbx testq %rdi, %rdi je 0x2e333 movq 0x78(%rbx), %rax testq %rax, %rax je 0x2e333 movq 0x480(%rax), %rax movq 0x28(%rax), %r14 leaq -0x18(%rbp), %rdx movq %rbx, (%rdx) movb $0x1, 0x14(%r14) leaq 0x38(%r14), %rdi leaq 0x9c(%rip), %rsi # 0x2e3b5 callq 0x32174 movw $0x0, 0x14(%r14) testl %eax, %eax jle 0x2e34a movb $0x1, 0x15(%r14) movl (%r14), %r14d jmp 0x2e33e movq %rbx, %rdi callq 0x1aac2 xorl %r14d, %r14d movl %r14d, %eax addq $0x10, %rsp popq %rbx popq %r14 popq %rbp retq xorl %r14d, %r14d testl %eax, %eax jns 0x2e33e movq 0x78(%rbx), %rax movl $0x7d8, 0x90(%rax) # imm = 0x7D8 movl $0x297, %edi # imm = 0x297 addq 0x78(%rbx), %rdi leaq 0x21c91(%rip), %rax # 0x50000 movq (%rax), %rsi movl $0x5, %edx callq 0x13230 movq 0x78(%rbx), %rax xorl %r14d, %r14d movb %r14b, 0x29c(%rax) movl $0x97, %edi addq 0x78(%rbx), %rdi leaq 0x21c76(%rip), %rax # 0x50010 movq 0x40(%rax), %rsi movl $0x1ff, %edx # imm = 0x1FF callq 0x13230 movq 0x78(%rbx), %rax movb %r14b, 0x296(%rax) jmp 0x2e33e
mysql_free_result_start: push rbp mov rbp, rsp push r14 push rbx sub rsp, 10h mov rbx, rdi test rdi, rdi jz short loc_2E333 mov rax, [rbx+78h] test rax, rax jz short loc_2E333 mov rax, [rax+480h] mov r14, [rax+28h] lea rdx, [rbp+var_18] mov [rdx], rbx mov byte ptr [r14+14h], 1 lea rdi, [r14+38h] lea rsi, mysql_free_result_start_internal call my_context_spawn mov word ptr [r14+14h], 0 test eax, eax jle short loc_2E34A mov byte ptr [r14+15h], 1 mov r14d, [r14] jmp short loc_2E33E loc_2E333: mov rdi, rbx call mysql_free_result xor r14d, r14d loc_2E33E: mov eax, r14d add rsp, 10h pop rbx pop r14 pop rbp retn loc_2E34A: xor r14d, r14d test eax, eax jns short loc_2E33E mov rax, [rbx+78h] mov dword ptr [rax+90h], 7D8h mov edi, 297h add rdi, [rbx+78h] lea rax, SQLSTATE_UNKNOWN mov rsi, [rax] mov edx, 5 call _strncpy mov rax, [rbx+78h] xor r14d, r14d mov [rax+29Ch], r14b mov edi, 97h add rdi, [rbx+78h] lea rax, client_errors mov rsi, [rax+40h] mov edx, 1FFh call _strncpy mov rax, [rbx+78h] mov [rax+296h], r14b jmp short loc_2E33E
long long mysql_free_result_start(_QWORD *a1) { long long v1; // rax _BYTE *v2; // r14 int v3; // eax unsigned int v4; // r14d _QWORD *v6; // [rsp+8h] [rbp-18h] BYREF if ( a1 && (v1 = a1[15]) != 0 ) { v2 = *(_BYTE **)(*(_QWORD *)(v1 + 1152) + 40LL); v6 = a1; v2[20] = 1; v3 = my_context_spawn(v2 + 56, mysql_free_result_start_internal, &v6); *((_WORD *)v2 + 10) = 0; if ( v3 <= 0 ) { v4 = 0; if ( v3 < 0 ) { *(_DWORD *)(a1[15] + 144LL) = 2008; strncpy(a1[15] + 663LL, SQLSTATE_UNKNOWN, 5LL); v4 = 0; *(_BYTE *)(a1[15] + 668LL) = 0; strncpy(a1[15] + 151LL, client_errors[8], 511LL); *(_BYTE *)(a1[15] + 662LL) = 0; } } else { v2[21] = 1; return *(unsigned int *)v2; } } else { mysql_free_result(a1); return 0; } return v4; }
mysql_free_result_start: PUSH RBP MOV RBP,RSP PUSH R14 PUSH RBX SUB RSP,0x10 MOV RBX,RDI TEST RDI,RDI JZ 0x0012e333 MOV RAX,qword ptr [RBX + 0x78] TEST RAX,RAX JZ 0x0012e333 MOV RAX,qword ptr [RAX + 0x480] MOV R14,qword ptr [RAX + 0x28] LEA RDX,[RBP + -0x18] MOV qword ptr [RDX],RBX MOV byte ptr [R14 + 0x14],0x1 LEA RDI,[R14 + 0x38] LEA RSI,[0x12e3b5] CALL 0x00132174 MOV word ptr [R14 + 0x14],0x0 TEST EAX,EAX JLE 0x0012e34a MOV byte ptr [R14 + 0x15],0x1 MOV R14D,dword ptr [R14] JMP 0x0012e33e LAB_0012e333: MOV RDI,RBX CALL 0x0011aac2 XOR R14D,R14D LAB_0012e33e: MOV EAX,R14D ADD RSP,0x10 POP RBX POP R14 POP RBP RET LAB_0012e34a: XOR R14D,R14D TEST EAX,EAX JNS 0x0012e33e MOV RAX,qword ptr [RBX + 0x78] MOV dword ptr [RAX + 0x90],0x7d8 MOV EDI,0x297 ADD RDI,qword ptr [RBX + 0x78] LEA RAX,[0x150000] MOV RSI,qword ptr [RAX] MOV EDX,0x5 CALL 0x00113230 MOV RAX,qword ptr [RBX + 0x78] XOR R14D,R14D MOV byte ptr [RAX + 0x29c],R14B MOV EDI,0x97 ADD RDI,qword ptr [RBX + 0x78] LEA RAX,[0x150010] MOV RSI,qword ptr [RAX + 0x40] MOV EDX,0x1ff CALL 0x00113230 MOV RAX,qword ptr [RBX + 0x78] MOV byte ptr [RAX + 0x296],R14B JMP 0x0012e33e
int4 mysql_free_result_start(long param_1) { int4 *puVar1; int iVar2; int4 uVar3; if ((param_1 == 0) || (*(long *)(param_1 + 0x78) == 0)) { mysql_free_result(param_1); uVar3 = 0; } else { puVar1 = *(int4 **)(*(long *)(*(long *)(param_1 + 0x78) + 0x480) + 0x28); *(int1 *)(puVar1 + 5) = 1; iVar2 = my_context_spawn(puVar1 + 0xe,mysql_free_result_start_internal); *(int2 *)(puVar1 + 5) = 0; if (iVar2 < 1) { uVar3 = 0; if (iVar2 < 0) { *(int4 *)(*(long *)(param_1 + 0x78) + 0x90) = 0x7d8; strncpy((char *)(*(long *)(param_1 + 0x78) + 0x297),SQLSTATE_UNKNOWN,5); uVar3 = 0; *(int1 *)(*(long *)(param_1 + 0x78) + 0x29c) = 0; strncpy((char *)(*(long *)(param_1 + 0x78) + 0x97),PTR_s_Client_run_out_of_memory_00150050, 0x1ff); *(int1 *)(*(long *)(param_1 + 0x78) + 0x296) = 0; } } else { *(int1 *)((long)puVar1 + 0x15) = 1; uVar3 = *puVar1; } } return uVar3; }
2,939
do_verify_prepare_field
eloqsql/libmariadb/unittest/libmariadb/my_test.h
int do_verify_prepare_field(MYSQL_RES *result, unsigned int no, const char *name, const char *org_name, enum enum_field_types type __attribute__((unused)), const char *table, const char *org_table, const char *db, unsigned long length __attribute__((unused)), const char *def __attribute__((unused)), const char *file __attribute__((unused)), int line __attribute__((unused))) { MYSQL_FIELD *field; /* MARIADB_CHARSET_INFO *cs; */ FAIL_IF(!(field= mysql_fetch_field_direct(result, no)), "FAILED to get result"); /* cs= mysql_find_charset_nr(field->charsetnr); FAIL_UNLESS(cs, "Couldn't get character set"); */ FAIL_UNLESS(strcmp(field->name, name) == 0, "field->name differs"); FAIL_UNLESS(strcmp(field->org_name, org_name) == 0, "field->org_name differs"); /* if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32) expected_field_length= UINT_MAX32; */ /* XXX: silent column specification change works based on number of bytes a column occupies. So CHAR -> VARCHAR upgrade is possible even for CHAR(2) column if its character set is multibyte. VARCHAR -> CHAR downgrade won't work for VARCHAR(3) as one would expect. */ // if (cs->char_maxlen == 1) // FAIL_UNLESS(field->type == type, "field->type differs"); if (table) FAIL_UNLESS(strcmp(field->table, table) == 0, "field->table differs"); if (org_table) FAIL_UNLESS(strcmp(field->org_table, org_table) == 0, "field->org_table differs"); if (strcmp(field->db,db)) diag("%s / %s", field->db, db); FAIL_UNLESS(strcmp(field->db, db) == 0, "field->db differs"); /* Character set should be taken into account for multibyte encodings, such as utf8. Field length is calculated as number of characters * maximum number of bytes a character can occupy. */ return OK; }
O0
c
do_verify_prepare_field: pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movl 0x38(%rbp), %eax movq 0x30(%rbp), %rax movq 0x28(%rbp), %rax movq 0x20(%rbp), %rax movq 0x18(%rbp), %rax movq 0x10(%rbp), %rax movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl %r8d, -0x2c(%rbp) movq %r9, -0x38(%rbp) movq -0x10(%rbp), %rdi movl -0x14(%rbp), %esi callq 0x22de0 movq %rax, -0x40(%rbp) cmpq $0x0, %rax jne 0x139c9 leaq 0x38754(%rip), %rdi # 0x4c0f7 leaq 0x38760(%rip), %rsi # 0x4c10a leaq 0x3876e(%rip), %rdx # 0x4c11f movl $0x119, %ecx # imm = 0x119 movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x139cb jmp 0x139cd movq -0x40(%rbp), %rax movq (%rax), %rdi movq -0x20(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13a0f leaq 0x3870e(%rip), %rdi # 0x4c0f7 leaq 0x38781(%rip), %rsi # 0x4c171 leaq 0x38728(%rip), %rdx # 0x4c11f movl $0x11c, %ecx # imm = 0x11C movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x13a11 jmp 0x13a13 movq -0x40(%rbp), %rax movq 0x8(%rax), %rdi movq -0x28(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13a56 leaq 0x386c7(%rip), %rdi # 0x4c0f7 leaq 0x3874e(%rip), %rsi # 0x4c185 leaq 0x386e1(%rip), %rdx # 0x4c11f movl $0x11d, %ecx # imm = 0x11D movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x13a58 cmpq $0x0, -0x38(%rbp) je 0x13aa8 jmp 0x13a61 movq -0x40(%rbp), %rax movq 0x10(%rax), %rdi movq -0x38(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13aa4 leaq 0x38679(%rip), %rdi # 0x4c0f7 leaq 0x38718(%rip), %rsi # 0x4c19d leaq 0x38693(%rip), %rdx # 0x4c11f movl $0x12c, %ecx # imm = 0x12C movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x13aa6 jmp 0x13aa8 cmpq $0x0, 0x10(%rbp) je 0x13af5 jmp 0x13ab1 movq -0x40(%rbp), %rax movq 0x18(%rax), %rdi movq 0x10(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13af1 leaq 0x38629(%rip), %rdi # 0x4c0f7 leaq 0x386dd(%rip), %rsi # 0x4c1b2 leaq 0x38643(%rip), %rdx # 0x4c11f movl $0x12e, %ecx # imm = 0x12E movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x13af3 jmp 0x13af5 movq -0x40(%rbp), %rax movq 0x20(%rax), %rdi movq 0x18(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13b25 movq -0x40(%rbp), %rax movq 0x20(%rax), %rsi movq 0x18(%rbp), %rdx leaq 0x386ad(%rip), %rdi # 0x4c1cb movb $0x0, %al callq 0x167e0 jmp 0x13b27 movq -0x40(%rbp), %rax movq 0x20(%rax), %rdi movq 0x18(%rbp), %rsi callq 0x135f0 cmpl $0x0, %eax je 0x13b67 leaq 0x385b3(%rip), %rdi # 0x4c0f7 leaq 0x38688(%rip), %rsi # 0x4c1d3 leaq 0x385cd(%rip), %rdx # 0x4c11f movl $0x131, %ecx # imm = 0x131 movb $0x0, %al callq 0x167e0 movl $0x1, -0x4(%rbp) jmp 0x13b70 jmp 0x13b69 movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x40, %rsp popq %rbp retq nopl (%rax)
do_verify_prepare_field: push rbp mov rbp, rsp sub rsp, 40h mov eax, [rbp+arg_28] mov rax, [rbp+arg_20] mov rax, [rbp+arg_18] mov rax, [rbp+arg_10] mov rax, [rbp+arg_8] mov rax, [rbp+arg_0] mov [rbp+var_10], rdi mov [rbp+var_14], esi mov [rbp+var_20], rdx mov [rbp+var_28], rcx mov [rbp+var_2C], r8d mov [rbp+var_38], r9 mov rdi, [rbp+var_10] mov esi, [rbp+var_14] call mysql_fetch_field_direct mov [rbp+var_40], rax cmp rax, 0 jnz short loc_139C9 lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFailedToGetRes; "FAILED to get result" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 119h mov al, 0 call diag mov [rbp+var_4], 1 jmp loc_13B70 loc_139C9: jmp short $+2 loc_139CB: jmp short $+2 loc_139CD: mov rax, [rbp+var_40] mov rdi, [rax] mov rsi, [rbp+var_20] call _strcmp cmp eax, 0 jz short loc_13A0F lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFieldNameDiffe; "field->name differs" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 11Ch mov al, 0 call diag mov [rbp+var_4], 1 jmp loc_13B70 loc_13A0F: jmp short $+2 loc_13A11: jmp short $+2 loc_13A13: mov rax, [rbp+var_40] mov rdi, [rax+8] mov rsi, [rbp+var_28] call _strcmp cmp eax, 0 jz short loc_13A56 lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFieldOrgNameDi; "field->org_name differs" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 11Dh mov al, 0 call diag mov [rbp+var_4], 1 jmp loc_13B70 loc_13A56: jmp short $+2 loc_13A58: cmp [rbp+var_38], 0 jz short loc_13AA8 jmp short $+2 loc_13A61: mov rax, [rbp+var_40] mov rdi, [rax+10h] mov rsi, [rbp+var_38] call _strcmp cmp eax, 0 jz short loc_13AA4 lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFieldTableDiff; "field->table differs" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 12Ch mov al, 0 call diag mov [rbp+var_4], 1 jmp loc_13B70 loc_13AA4: jmp short $+2 loc_13AA6: jmp short $+2 loc_13AA8: cmp [rbp+arg_0], 0 jz short loc_13AF5 jmp short $+2 loc_13AB1: mov rax, [rbp+var_40] mov rdi, [rax+18h] mov rsi, [rbp+arg_0] call _strcmp cmp eax, 0 jz short loc_13AF1 lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFieldOrgTableD; "field->org_table differs" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 12Eh mov al, 0 call diag mov [rbp+var_4], 1 jmp short loc_13B70 loc_13AF1: jmp short $+2 loc_13AF3: jmp short $+2 loc_13AF5: mov rax, [rbp+var_40] mov rdi, [rax+20h] mov rsi, [rbp+arg_8] call _strcmp cmp eax, 0 jz short loc_13B25 mov rax, [rbp+var_40] mov rsi, [rax+20h] mov rdx, [rbp+arg_8] lea rdi, aSS; "%s / %s" mov al, 0 call diag loc_13B25: jmp short $+2 loc_13B27: mov rax, [rbp+var_40] mov rdi, [rax+20h] mov rsi, [rbp+arg_8] call _strcmp cmp eax, 0 jz short loc_13B67 lea rdi, aErrorSSD; "Error: %s (%s: %d)" lea rsi, aFieldDbDiffers; "field->db differs" lea rdx, aWorkspaceLlm4b; "/workspace/llm4binary/github2025/eloqsq"... mov ecx, 131h mov al, 0 call diag mov [rbp+var_4], 1 jmp short loc_13B70 loc_13B67: jmp short $+2 loc_13B69: mov [rbp+var_4], 0 loc_13B70: mov eax, [rbp+var_4] add rsp, 40h pop rbp retn
long long do_verify_prepare_field( long long a1, unsigned int a2, long long a3, long long a4, long long a5, long long a6, long long a7, long long a8) { int v8; // r8d int v9; // r9d int v10; // r8d int v11; // r9d int v12; // r8d int v13; // r9d int v14; // r8d int v15; // r9d int v16; // r8d int v17; // r9d int v18; // ecx int v19; // r8d int v20; // r9d int v21; // r8d int v22; // r9d _QWORD *field_direct; // [rsp+0h] [rbp-40h] field_direct = (_QWORD *)mysql_fetch_field_direct(a1, a2); if ( field_direct ) { if ( !(unsigned int)strcmp(*field_direct, a3) ) { if ( !(unsigned int)strcmp(field_direct[1], a4) ) { if ( !a6 || !(unsigned int)strcmp(field_direct[2], a6) ) { if ( !a7 || !(unsigned int)strcmp(field_direct[3], a7) ) { if ( (unsigned int)strcmp(field_direct[4], a8) ) diag((unsigned int)"%s / %s", field_direct[4], a8, v18, v19, v20, (char)field_direct); if ( !(unsigned int)strcmp(field_direct[4], a8) ) { return 0; } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"field->db differs", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 305, v21, v22, (char)field_direct); return 1; } } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"field->org_table differs", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 302, v16, v17, (char)field_direct); return 1; } } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"field->table differs", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 300, v14, v15, (char)field_direct); return 1; } } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"field->org_name differs", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 285, v12, v13, (char)field_direct); return 1; } } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"field->name differs", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 284, v10, v11, (char)field_direct); return 1; } } else { diag( (unsigned int)"Error: %s (%s: %d)", (unsigned int)"FAILED to get result", (unsigned int)"/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 281, v8, v9, 0); return 1; } }
do_verify_prepare_field: PUSH RBP MOV RBP,RSP SUB RSP,0x40 MOV EAX,dword ptr [RBP + 0x38] MOV RAX,qword ptr [RBP + 0x30] MOV RAX,qword ptr [RBP + 0x28] MOV RAX,qword ptr [RBP + 0x20] MOV RAX,qword ptr [RBP + 0x18] MOV RAX,qword ptr [RBP + 0x10] MOV qword ptr [RBP + -0x10],RDI MOV dword ptr [RBP + -0x14],ESI MOV qword ptr [RBP + -0x20],RDX MOV qword ptr [RBP + -0x28],RCX MOV dword ptr [RBP + -0x2c],R8D MOV qword ptr [RBP + -0x38],R9 MOV RDI,qword ptr [RBP + -0x10] MOV ESI,dword ptr [RBP + -0x14] CALL 0x00122de0 MOV qword ptr [RBP + -0x40],RAX CMP RAX,0x0 JNZ 0x001139c9 LEA RDI,[0x14c0f7] LEA RSI,[0x14c10a] LEA RDX,[0x14c11f] MOV ECX,0x119 MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_001139c9: JMP 0x001139cb LAB_001139cb: JMP 0x001139cd LAB_001139cd: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RBP + -0x20] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113a0f LEA RDI,[0x14c0f7] LEA RSI,[0x14c171] LEA RDX,[0x14c11f] MOV ECX,0x11c MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_00113a0f: JMP 0x00113a11 LAB_00113a11: JMP 0x00113a13 LAB_00113a13: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX + 0x8] MOV RSI,qword ptr [RBP + -0x28] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113a56 LEA RDI,[0x14c0f7] LEA RSI,[0x14c185] LEA RDX,[0x14c11f] MOV ECX,0x11d MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_00113a56: JMP 0x00113a58 LAB_00113a58: CMP qword ptr [RBP + -0x38],0x0 JZ 0x00113aa8 JMP 0x00113a61 LAB_00113a61: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX + 0x10] MOV RSI,qword ptr [RBP + -0x38] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113aa4 LEA RDI,[0x14c0f7] LEA RSI,[0x14c19d] LEA RDX,[0x14c11f] MOV ECX,0x12c MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_00113aa4: JMP 0x00113aa6 LAB_00113aa6: JMP 0x00113aa8 LAB_00113aa8: CMP qword ptr [RBP + 0x10],0x0 JZ 0x00113af5 JMP 0x00113ab1 LAB_00113ab1: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX + 0x18] MOV RSI,qword ptr [RBP + 0x10] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113af1 LEA RDI,[0x14c0f7] LEA RSI,[0x14c1b2] LEA RDX,[0x14c11f] MOV ECX,0x12e MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_00113af1: JMP 0x00113af3 LAB_00113af3: JMP 0x00113af5 LAB_00113af5: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX + 0x20] MOV RSI,qword ptr [RBP + 0x18] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113b25 MOV RAX,qword ptr [RBP + -0x40] MOV RSI,qword ptr [RAX + 0x20] MOV RDX,qword ptr [RBP + 0x18] LEA RDI,[0x14c1cb] MOV AL,0x0 CALL 0x001167e0 LAB_00113b25: JMP 0x00113b27 LAB_00113b27: MOV RAX,qword ptr [RBP + -0x40] MOV RDI,qword ptr [RAX + 0x20] MOV RSI,qword ptr [RBP + 0x18] CALL 0x001135f0 CMP EAX,0x0 JZ 0x00113b67 LEA RDI,[0x14c0f7] LEA RSI,[0x14c1d3] LEA RDX,[0x14c11f] MOV ECX,0x131 MOV AL,0x0 CALL 0x001167e0 MOV dword ptr [RBP + -0x4],0x1 JMP 0x00113b70 LAB_00113b67: JMP 0x00113b69 LAB_00113b69: MOV dword ptr [RBP + -0x4],0x0 LAB_00113b70: MOV EAX,dword ptr [RBP + -0x4] ADD RSP,0x40 POP RBP RET
int4 do_verify_prepare_field (int8 param_1,int4 param_2,char *param_3,char *param_4,int8 param_5, char *param_6,char *param_7,char *param_8) { int iVar1; int8 *puVar2; int4 local_c; puVar2 = (int8 *)mysql_fetch_field_direct(param_1,param_2); if (puVar2 == (int8 *)0x0) { diag("Error: %s (%s: %d)","FAILED to get result", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h",0x119); local_c = 1; } else { iVar1 = strcmp((char *)*puVar2,param_3); if (iVar1 == 0) { iVar1 = strcmp((char *)puVar2[1],param_4); if (iVar1 == 0) { if ((param_6 == (char *)0x0) || (iVar1 = strcmp((char *)puVar2[2],param_6), iVar1 == 0)) { if ((param_7 == (char *)0x0) || (iVar1 = strcmp((char *)puVar2[3],param_7), iVar1 == 0)) { iVar1 = strcmp((char *)puVar2[4],param_8); if (iVar1 != 0) { diag("%s / %s",puVar2[4],param_8); } iVar1 = strcmp((char *)puVar2[4],param_8); if (iVar1 == 0) { local_c = 0; } else { diag("Error: %s (%s: %d)","field->db differs", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h" ,0x131); local_c = 1; } } else { diag("Error: %s (%s: %d)","field->org_table differs", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h" ,0x12e); local_c = 1; } } else { diag("Error: %s (%s: %d)","field->table differs", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 300); local_c = 1; } } else { diag("Error: %s (%s: %d)","field->org_name differs", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h", 0x11d); local_c = 1; } } else { diag("Error: %s (%s: %d)","field->name differs", "/workspace/llm4binary/github2025/eloqsql/libmariadb/unittest/libmariadb/my_test.h",0x11c ); local_c = 1; } } return local_c; }
2,940
refreshSingleLine(linenoiseState*, int)
ericcurtin[P]linenoise/linenoise.cpp
static void refreshSingleLine(struct linenoiseState * l, int flags) { char seq[64]; size_t pcollen = promptTextColumnLen(l->prompt, strlen(l->prompt)); int fd = l->ofd; char * buf = l->buf; size_t len = l->len; size_t pos = l->pos; std::string ab; while ((pcollen + columnPos(buf, len, pos)) >= l->cols) { int chlen = nextCharLen(buf, len, 0, NULL); buf += chlen; len -= chlen; pos -= chlen; } while (pcollen + columnPos(buf, len, len) > l->cols) { len -= prevCharLen(buf, len, len, NULL); } /* Cursor to left edge */ snprintf(seq, sizeof(seq), "\r"); ab.append(seq); if (flags & REFRESH_WRITE) { /* Write the prompt and the current buffer content */ ab.append(l->prompt); if (maskmode == 1) { while (len--) { ab.append("*"); } } else { ab.append(buf, len); } /* Show hits if any. */ refreshShowHints(ab, l, pcollen); } /* Erase to right */ snprintf(seq, sizeof(seq), "\x1b[0K"); ab.append(seq); if (flags & REFRESH_WRITE) { /* Move cursor to original position. */ snprintf(seq, sizeof(seq), "\r\x1b[%dC", (int) (columnPos(buf, len, pos) + pcollen)); ab.append(seq); } (void) !write(fd, ab.c_str(), ab.size()); /* Can't recover from write error. */ }
O2
cpp
refreshSingleLine(linenoiseState*, int): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movl %esi, 0x8(%rsp) movq %rdi, %rbx movq 0x28(%rdi), %r14 movq %r14, %rdi callq 0x20c0 movq %r14, %rdi movq %rax, %rsi callq 0x3fee movq %rax, %r14 movl 0x14(%rbx), %eax movl %eax, 0xc(%rsp) movq 0x18(%rbx), %r12 movq 0x48(%rbx), %r13 movq 0x38(%rbx), %r15 leaq 0x20(%rsp), %rax movq %rax, -0x10(%rax) andq $0x0, -0x8(%rax) movb $0x0, (%rax) movq %r12, %rdi movq %r13, %rsi movq %r15, %rdx callq 0x4220 addq %r14, %rax cmpq 0x50(%rbx), %rax jb 0x2af1 movq %r12, %rdi movq %r13, %rsi xorl %edx, %edx xorl %ecx, %ecx callq *0x9720(%rip) # 0xc1f0 cltq addq %rax, %r12 subq %rax, %r13 subq %rax, %r15 jmp 0x2aa9 movq %r12, %rdi movq %r13, %rsi movq %r13, %rdx xorl %ecx, %ecx callq *0x96fa(%rip) # 0xc1e8 subq %rax, %r13 movq %r12, %rdi movq %r13, %rsi movq %r13, %rdx callq 0x4220 addq %r14, %rax cmpq 0x50(%rbx), %rax ja 0x2add leaq 0x30(%rsp), %rsi movw $0xd, (%rsi) leaq 0x10(%rsp), %rdi callq 0x2390 testb $0x2, 0x8(%rsp) je 0x2b7c movq 0x28(%rbx), %rsi leaq 0x10(%rsp), %rdi callq 0x2390 cmpb $0x1, 0x96f8(%rip) # 0xc230 jne 0x2b5c movq %r13, %rbp incq %rbp pushq $-0x1 popq %r13 decq %rbp je 0x2b6c leaq 0x10(%rsp), %rdi leaq 0x6d86(%rip), %rsi # 0x98db callq 0x2390 jmp 0x2b44 leaq 0x10(%rsp), %rdi movq %r12, %rsi movq %r13, %rdx callq 0x2060 leaq 0x10(%rsp), %rdi movq %rbx, %rsi movl %r14d, %edx callq 0x4105 leaq 0x30(%rsp), %rsi movb $0x0, 0x4(%rsi) movl $0x4b305b1b, (%rsi) # imm = 0x4B305B1B leaq 0x10(%rsp), %rdi callq 0x2390 testb $0x2, 0x8(%rsp) je 0x2bd5 movq %r12, %rdi movq %r13, %rsi movq %r15, %rdx callq 0x4220 addl %r14d, %eax leaq 0x6d2f(%rip), %rdx # 0x98e3 leaq 0x30(%rsp), %rbx pushq $0x40 popq %rsi movq %rbx, %rdi movl %eax, %ecx xorl %eax, %eax callq 0x22f0 leaq 0x10(%rsp), %rdi movq %rbx, %rsi callq 0x2390 movq 0x10(%rsp), %rsi movq 0x18(%rsp), %rdx movl 0xc(%rsp), %edi callq 0x2080 leaq 0x10(%rsp), %rdi callq 0x20d0 addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x2c09 jmp 0x2c09 jmp 0x2c09 jmp 0x2c09 movq %rax, %rbx leaq 0x10(%rsp), %rdi callq 0x20d0 movq %rbx, %rdi callq 0x2330
_ZL17refreshSingleLineP14linenoiseStatei: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 78h mov [rsp+0A8h+var_A0], esi mov rbx, rdi mov r14, [rdi+28h] mov rdi, r14 call _strlen mov rdi, r14; char * mov rsi, rax; unsigned __int64 call _ZL19promptTextColumnLenPKcm; promptTextColumnLen(char const*,ulong) mov r14, rax mov eax, [rbx+14h] mov [rsp+0A8h+var_9C], eax mov r12, [rbx+18h] mov r13, [rbx+48h] mov r15, [rbx+38h] lea rax, [rsp+0A8h+var_88] mov [rax-10h], rax and qword ptr [rax-8], 0 mov byte ptr [rax], 0 loc_2AA9: mov rdi, r12; char * mov rsi, r13; unsigned __int64 mov rdx, r15; unsigned __int64 call _ZL9columnPosPKcmm; columnPos(char const*,ulong,ulong) add rax, r14 cmp rax, [rbx+50h] jb short loc_2AF1 mov rdi, r12; char * mov rsi, r13; unsigned __int64 xor edx, edx; unsigned __int64 xor ecx, ecx; unsigned __int64 * call cs:_ZL11nextCharLen; defaultNextCharLen(char const*,ulong,ulong,ulong *) cdqe add r12, rax sub r13, rax sub r15, rax jmp short loc_2AA9 loc_2ADD: mov rdi, r12; char * mov rsi, r13; unsigned __int64 mov rdx, r13; unsigned __int64 xor ecx, ecx; unsigned __int64 * call cs:_ZL11prevCharLen; defaultPrevCharLen(char const*,ulong,ulong,ulong *) sub r13, rax loc_2AF1: mov rdi, r12; char * mov rsi, r13; unsigned __int64 mov rdx, r13; unsigned __int64 call _ZL9columnPosPKcmm; columnPos(char const*,ulong,ulong) add rax, r14 cmp rax, [rbx+50h] ja short loc_2ADD lea rsi, [rsp+0A8h+var_78] mov word ptr [rsi], 0Dh lea rdi, [rsp+0A8h+var_98] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc; std::string::append(char const*) test byte ptr [rsp+0A8h+var_A0], 2 jz short loc_2B7C mov rsi, [rbx+28h] lea rdi, [rsp+0A8h+var_98] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc; std::string::append(char const*) cmp cs:_ZL8maskmode, 1; maskmode jnz short loc_2B5C mov rbp, r13 inc rbp push 0FFFFFFFFFFFFFFFFh pop r13 loc_2B44: dec rbp jz short loc_2B6C lea rdi, [rsp+0A8h+var_98] lea rsi, asc_98DB; "*" call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc; std::string::append(char const*) jmp short loc_2B44 loc_2B5C: lea rdi, [rsp+0A8h+var_98] mov rsi, r12 mov rdx, r13 call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm; std::string::append(char const*,ulong) loc_2B6C: lea rdi, [rsp+0A8h+var_98] mov rsi, rbx mov edx, r14d call _ZL16refreshShowHintsRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP14linenoiseStatei; refreshShowHints(std::string &,linenoiseState *,int) loc_2B7C: lea rsi, [rsp+0A8h+var_78] mov byte ptr [rsi+4], 0 mov dword ptr [rsi], 4B305B1Bh lea rdi, [rsp+0A8h+var_98] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc; std::string::append(char const*) test byte ptr [rsp+0A8h+var_A0], 2 jz short loc_2BD5 mov rdi, r12; char * mov rsi, r13; unsigned __int64 mov rdx, r15; unsigned __int64 call _ZL9columnPosPKcmm; columnPos(char const*,ulong,ulong) add eax, r14d lea rdx, aDc; "\r\x1B[%dC" lea rbx, [rsp+0A8h+var_78] push 40h ; '@' pop rsi mov rdi, rbx mov ecx, eax xor eax, eax call _snprintf lea rdi, [rsp+0A8h+var_98] mov rsi, rbx call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc; std::string::append(char const*) loc_2BD5: mov rsi, [rsp+0A8h+var_98] mov rdx, [rsp+0A8h+var_90] mov edi, [rsp+0A8h+var_9C] call _write lea rdi, [rsp+0A8h+var_98] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() add rsp, 78h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn jmp short loc_2C09 jmp short loc_2C09 jmp short loc_2C09 jmp short $+2 loc_2C09: mov rbx, rax lea rdi, [rsp+arg_8] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() mov rdi, rbx call __Unwind_Resume
long long refreshSingleLine(long long a1, char a2) { const char *v2; // r14 unsigned long long v3; // rax long long v4; // r14 const char *v5; // r12 unsigned long long v6; // r13 unsigned long long v7; // r15 int CharLen; // eax unsigned long long v9; // rbp int v10; // eax unsigned int v12; // [rsp+Ch] [rbp-9Ch] char *v13; // [rsp+10h] [rbp-98h] BYREF long long v14; // [rsp+18h] [rbp-90h] char v15; // [rsp+20h] [rbp-88h] BYREF char v16[120]; // [rsp+30h] [rbp-78h] BYREF v2 = *(const char **)(a1 + 40); v3 = strlen(v2); v4 = promptTextColumnLen(v2, v3); v12 = *(_DWORD *)(a1 + 20); v5 = *(const char **)(a1 + 24); v6 = *(_QWORD *)(a1 + 72); v7 = *(_QWORD *)(a1 + 56); v13 = &v15; v14 = 0LL; v15 = 0; while ( (unsigned long long)(v4 + columnPos(v5, v6, v7)) >= *(_QWORD *)(a1 + 80) ) { CharLen = nextCharLen(v5, v6, 0LL, 0LL); v5 += CharLen; v6 -= CharLen; v7 -= CharLen; } while ( (unsigned long long)(v4 + columnPos(v5, v6, v6)) > *(_QWORD *)(a1 + 80) ) v6 -= prevCharLen[0](v5, v6, v6, 0LL); strcpy(v16, "\r"); std::string::append(&v13, v16); if ( (a2 & 2) != 0 ) { std::string::append(&v13, *(_QWORD *)(a1 + 40)); if ( maskmode == 1 ) { v9 = v6 + 1; v6 = -1LL; while ( --v9 ) std::string::append(&v13, "*"); } else { std::string::append(&v13, v5, v6); } refreshShowHints(&v13, a1, (unsigned int)v4); } strcpy(v16, "\x1B[0K"); std::string::append(&v13, v16); if ( (a2 & 2) != 0 ) { v10 = columnPos(v5, v6, v7); snprintf(v16, 64LL, "\r\x1B[%dC", v4 + v10); std::string::append(&v13, v16); } write(v12, v13, v14); return std::string::~string(&v13); }
refreshSingleLine: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x78 MOV dword ptr [RSP + 0x8],ESI MOV RBX,RDI MOV R14,qword ptr [RDI + 0x28] MOV RDI,R14 CALL 0x001020c0 MOV RDI,R14 MOV RSI,RAX CALL 0x00103fee MOV R14,RAX MOV EAX,dword ptr [RBX + 0x14] MOV dword ptr [RSP + 0xc],EAX MOV R12,qword ptr [RBX + 0x18] MOV R13,qword ptr [RBX + 0x48] MOV R15,qword ptr [RBX + 0x38] LEA RAX,[RSP + 0x20] MOV qword ptr [RAX + -0x10],RAX AND qword ptr [RAX + -0x8],0x0 MOV byte ptr [RAX],0x0 LAB_00102aa9: MOV RDI,R12 MOV RSI,R13 MOV RDX,R15 CALL 0x00104220 ADD RAX,R14 CMP RAX,qword ptr [RBX + 0x50] JC 0x00102af1 LAB_00102ac0: MOV RDI,R12 MOV RSI,R13 XOR EDX,EDX XOR ECX,ECX CALL qword ptr [0x0010c1f0] CDQE ADD R12,RAX SUB R13,RAX SUB R15,RAX JMP 0x00102aa9 LAB_00102add: MOV RDI,R12 MOV RSI,R13 MOV RDX,R13 XOR ECX,ECX CALL qword ptr [0x0010c1e8] SUB R13,RAX LAB_00102af1: MOV RDI,R12 MOV RSI,R13 MOV RDX,R13 CALL 0x00104220 ADD RAX,R14 CMP RAX,qword ptr [RBX + 0x50] JA 0x00102add LEA RSI,[RSP + 0x30] MOV word ptr [RSI],0xd LAB_00102b12: LEA RDI,[RSP + 0x10] CALL 0x00102390 TEST byte ptr [RSP + 0x8],0x2 JZ 0x00102b7c MOV RSI,qword ptr [RBX + 0x28] LEA RDI,[RSP + 0x10] CALL 0x00102390 CMP byte ptr [0x0010c230],0x1 JNZ 0x00102b5c MOV RBP,R13 INC RBP PUSH -0x1 POP R13 LAB_00102b44: DEC RBP JZ 0x00102b6c LAB_00102b49: LEA RDI,[RSP + 0x10] LEA RSI,[0x1098db] CALL 0x00102390 JMP 0x00102b44 LAB_00102b5c: LEA RDI,[RSP + 0x10] MOV RSI,R12 MOV RDX,R13 CALL 0x00102060 LAB_00102b6c: LEA RDI,[RSP + 0x10] MOV RSI,RBX MOV EDX,R14D CALL 0x00104105 LAB_00102b7c: LEA RSI,[RSP + 0x30] MOV byte ptr [RSI + 0x4],0x0 MOV dword ptr [RSI],0x4b305b1b LEA RDI,[RSP + 0x10] CALL 0x00102390 TEST byte ptr [RSP + 0x8],0x2 JZ 0x00102bd5 MOV RDI,R12 MOV RSI,R13 MOV RDX,R15 CALL 0x00104220 ADD EAX,R14D LEA RDX,[0x1098e3] LEA RBX,[RSP + 0x30] PUSH 0x40 POP RSI MOV RDI,RBX MOV ECX,EAX XOR EAX,EAX CALL 0x001022f0 LEA RDI,[RSP + 0x10] MOV RSI,RBX CALL 0x00102390 LAB_00102bd5: MOV RSI,qword ptr [RSP + 0x10] MOV RDX,qword ptr [RSP + 0x18] MOV EDI,dword ptr [RSP + 0xc] CALL 0x00102080 LAB_00102be8: LEA RDI,[RSP + 0x10] CALL 0x001020d0 ADD RSP,0x78 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* refreshSingleLine(linenoiseState*, int) */ void refreshSingleLine(linenoiseState *param_1,int param_2) { int __fd; int iVar1; size_t sVar2; long lVar3; long lVar4; char *pcVar5; ulong uVar6; ulong uVar7; int1 *local_98; size_t local_90; int1 local_88 [16]; int4 local_78; int1 local_74; pcVar5 = *(char **)(param_1 + 0x28); sVar2 = strlen(pcVar5); lVar3 = promptTextColumnLen(pcVar5,sVar2); __fd = *(int *)(param_1 + 0x14); pcVar5 = *(char **)(param_1 + 0x18); uVar6 = *(ulong *)(param_1 + 0x48); uVar7 = *(ulong *)(param_1 + 0x38); local_98 = local_88; local_90 = 0; local_88[0] = 0; while( true ) { /* try { // try from 00102aa9 to 00102ab6 has its CatchHandler @ 00102c07 */ lVar4 = columnPos(pcVar5,uVar6,uVar7); if ((ulong)(lVar4 + lVar3) < *(ulong *)(param_1 + 0x50)) break; /* try { // try from 00102ac0 to 00102acf has its CatchHandler @ 00102c05 */ iVar1 = (*(code *)nextCharLen)(pcVar5,uVar6,0); lVar4 = (long)iVar1; pcVar5 = pcVar5 + lVar4; uVar6 = uVar6 - lVar4; uVar7 = uVar7 - lVar4; } while( true ) { lVar4 = columnPos(pcVar5,uVar6,uVar6); if ((ulong)(lVar4 + lVar3) <= *(ulong *)(param_1 + 0x50)) break; /* try { // try from 00102add to 00102afe has its CatchHandler @ 00102c09 */ lVar4 = (*(code *)prevCharLen)(pcVar5,uVar6,uVar6,0); uVar6 = uVar6 - lVar4; } local_78 = CONCAT22(local_78._2_2_,0xd); /* try { // try from 00102b12 to 00102b30 has its CatchHandler @ 00102c01 */ std::__cxx11::string::append((char *)&local_98); if ((param_2 & 2U) != 0) { std::__cxx11::string::append((char *)&local_98); if (maskmode == '\x01') { lVar4 = uVar6 + 1; uVar6 = 0xffffffffffffffff; while (lVar4 = lVar4 + -1, lVar4 != 0) { /* try { // try from 00102b49 to 00102b59 has its CatchHandler @ 00102c03 */ std::__cxx11::string::append((char *)&local_98); } } else { /* try { // try from 00102b5c to 00102be7 has its CatchHandler @ 00102c01 */ std::__cxx11::string::append((char *)&local_98,(ulong)pcVar5); } refreshShowHints((string *)&local_98,param_1,(int)lVar3); } local_74 = 0; local_78 = 0x4b305b1b; std::__cxx11::string::append((char *)&local_98); if ((param_2 & 2U) != 0) { iVar1 = columnPos(pcVar5,uVar6,uVar7); snprintf((char *)&local_78,0x40,"\r\x1b[%dC",(ulong)(uint)(iVar1 + (int)lVar3)); std::__cxx11::string::append((char *)&local_98); } write(__fd,local_98,local_90); std::__cxx11::string::~string((string *)&local_98); return; }
2,941
get_charset_number
eloqsql/mysys/charset.c
uint get_charset_number(const char *charset_name, uint cs_flags, myf flags) { uint id; const char *new_charset_name= flags & MY_UTF8_IS_UTF8MB3 ? "utf8mb3" : "utf8mb4"; my_pthread_once(&charsets_initialized, init_available_charsets); if ((id= get_charset_number_internal(charset_name, cs_flags))) return id; if ((charset_name= !my_strcasecmp(&my_charset_latin1, charset_name, "utf8") ? new_charset_name : NULL)) return get_charset_number_internal(charset_name, cs_flags); return 0; }
O0
c
get_charset_number: pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq -0x20(%rbp), %rdx andq $0x400, %rdx # imm = 0x400 leaq 0x117fb(%rip), %rax # 0x834c0 leaq 0x117ec(%rip), %rcx # 0x834b8 cmpq $0x0, %rdx cmovneq %rcx, %rax movq %rax, -0x30(%rbp) leaq 0x328e05(%rip), %rdi # 0x39aae4 leaq -0x306(%rip), %rsi # 0x719e0 callq 0x2a280 movq -0x10(%rbp), %rdi movl -0x14(%rbp), %esi callq 0x71d80 movl %eax, -0x24(%rbp) cmpl $0x0, %eax je 0x71d07 movl -0x24(%rbp), %eax movl %eax, -0x4(%rbp) jmp 0x71d6a leaq 0x209e42(%rip), %rax # 0x27bb50 movq 0xc0(%rax), %rax movq 0x40(%rax), %rax movq -0x10(%rbp), %rsi leaq 0x209e2c(%rip), %rdi # 0x27bb50 leaq 0x1179d(%rip), %rdx # 0x834c8 callq *%rax cmpl $0x0, %eax jne 0x71d3c movq -0x30(%rbp), %rax movq %rax, -0x38(%rbp) jmp 0x71d44 xorl %eax, %eax movq %rax, -0x38(%rbp) jmp 0x71d44 movq -0x38(%rbp), %rax movq %rax, -0x10(%rbp) cmpq $0x0, %rax je 0x71d63 movq -0x10(%rbp), %rdi movl -0x14(%rbp), %esi callq 0x71d80 movl %eax, -0x4(%rbp) jmp 0x71d6a movl $0x0, -0x4(%rbp) movl -0x4(%rbp), %eax addq $0x40, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
get_charset_number: push rbp mov rbp, rsp sub rsp, 40h mov [rbp+var_10], rdi mov [rbp+var_14], esi mov [rbp+var_20], rdx mov rdx, [rbp+var_20] and rdx, 400h lea rax, aUtf8mb4; "utf8mb4" lea rcx, aUtf8mb3; "utf8mb3" cmp rdx, 0 cmovnz rax, rcx mov [rbp+var_30], rax lea rdi, charsets_initialized lea rsi, init_available_charsets call _pthread_once mov rdi, [rbp+var_10] mov esi, [rbp+var_14] call get_charset_number_internal mov [rbp+var_24], eax cmp eax, 0 jz short loc_71D07 mov eax, [rbp+var_24] mov [rbp+var_4], eax jmp short loc_71D6A loc_71D07: lea rax, my_charset_latin1 mov rax, [rax+0C0h] mov rax, [rax+40h] mov rsi, [rbp+var_10] lea rdi, my_charset_latin1 lea rdx, aUtf8; "utf8" call rax cmp eax, 0 jnz short loc_71D3C mov rax, [rbp+var_30] mov [rbp+var_38], rax jmp short loc_71D44 loc_71D3C: xor eax, eax mov [rbp+var_38], rax jmp short $+2 loc_71D44: mov rax, [rbp+var_38] mov [rbp+var_10], rax cmp rax, 0 jz short loc_71D63 mov rdi, [rbp+var_10] mov esi, [rbp+var_14] call get_charset_number_internal mov [rbp+var_4], eax jmp short loc_71D6A loc_71D63: mov [rbp+var_4], 0 loc_71D6A: mov eax, [rbp+var_4] add rsp, 40h pop rbp retn
long long get_charset_number(long long a1, unsigned int a2, __int16 a3) { const char *v3; // rax const char *v5; // [rsp+8h] [rbp-38h] const char *v6; // [rsp+10h] [rbp-30h] unsigned int charset_number_internal; // [rsp+1Ch] [rbp-24h] v3 = "utf8mb4"; if ( (a3 & 0x400) != 0 ) v3 = "utf8mb3"; v6 = v3; pthread_once(&charsets_initialized, init_available_charsets); charset_number_internal = get_charset_number_internal(a1, a2); if ( charset_number_internal ) { return charset_number_internal; } else { if ( (*(unsigned int ( **)(void *, long long, const char *))(*((_QWORD *)&my_charset_latin1 + 24) + 64LL))( &my_charset_latin1, a1, "utf8") ) { v5 = 0LL; } else { v5 = v6; } if ( v5 ) return (unsigned int)get_charset_number_internal(v5, a2); else return 0; } }
get_charset_number: PUSH RBP MOV RBP,RSP SUB RSP,0x40 MOV qword ptr [RBP + -0x10],RDI MOV dword ptr [RBP + -0x14],ESI MOV qword ptr [RBP + -0x20],RDX MOV RDX,qword ptr [RBP + -0x20] AND RDX,0x400 LEA RAX,[0x1834c0] LEA RCX,[0x1834b8] CMP RDX,0x0 CMOVNZ RAX,RCX MOV qword ptr [RBP + -0x30],RAX LEA RDI,[0x49aae4] LEA RSI,[0x1719e0] CALL 0x0012a280 MOV RDI,qword ptr [RBP + -0x10] MOV ESI,dword ptr [RBP + -0x14] CALL 0x00171d80 MOV dword ptr [RBP + -0x24],EAX CMP EAX,0x0 JZ 0x00171d07 MOV EAX,dword ptr [RBP + -0x24] MOV dword ptr [RBP + -0x4],EAX JMP 0x00171d6a LAB_00171d07: LEA RAX,[0x37bb50] MOV RAX,qword ptr [RAX + 0xc0] MOV RAX,qword ptr [RAX + 0x40] MOV RSI,qword ptr [RBP + -0x10] LEA RDI,[0x37bb50] LEA RDX,[0x1834c8] CALL RAX CMP EAX,0x0 JNZ 0x00171d3c MOV RAX,qword ptr [RBP + -0x30] MOV qword ptr [RBP + -0x38],RAX JMP 0x00171d44 LAB_00171d3c: XOR EAX,EAX MOV qword ptr [RBP + -0x38],RAX JMP 0x00171d44 LAB_00171d44: MOV RAX,qword ptr [RBP + -0x38] MOV qword ptr [RBP + -0x10],RAX CMP RAX,0x0 JZ 0x00171d63 MOV RDI,qword ptr [RBP + -0x10] MOV ESI,dword ptr [RBP + -0x14] CALL 0x00171d80 MOV dword ptr [RBP + -0x4],EAX JMP 0x00171d6a LAB_00171d63: MOV dword ptr [RBP + -0x4],0x0 LAB_00171d6a: MOV EAX,dword ptr [RBP + -0x4] ADD RSP,0x40 POP RBP RET
int get_charset_number(int8 param_1,int4 param_2,ulong param_3) { int iVar1; char *local_40; int local_c; local_40 = "utf8mb4"; if ((param_3 & 0x400) != 0) { local_40 = "utf8mb3"; } pthread_once(&charsets_initialized,init_available_charsets); local_c = get_charset_number_internal(param_1,param_2); if (local_c == 0) { iVar1 = (**(code **)(PTR_my_collation_8bit_simple_ci_handler_0037bc10 + 0x40)) (&my_charset_latin1,param_1,&DAT_001834c8); if (iVar1 != 0) { local_40 = (char *)0x0; } if (local_40 == (char *)0x0) { local_c = 0; } else { local_c = get_charset_number_internal(local_40,param_2); } } return local_c; }
2,942
get_argument
eloqsql/mysys/my_default.c
static char *get_argument(const char *keyword, size_t kwlen, char *ptr, char *name, uint line) { char *end; /* Skip over "include / includedir keyword" and following whitespace */ for (ptr+= kwlen - 1; my_isspace(&my_charset_latin1, ptr[0]); ptr++) {} /* Trim trailing whitespace from directory name The -1 below is for the newline added by fgets() Note that my_isspace() is true for \r and \n */ for (end= ptr + strlen(ptr) - 1; my_isspace(&my_charset_latin1, *(end - 1)); end--) {} end[0]= 0; /* Cut off end space */ /* Print error msg if there is nothing after !include* directive */ if (end <= ptr) { fprintf(stderr, "error: Wrong '!%s' directive in config file: %s at line %d\n", keyword, name, line); return 0; } return ptr; }
O0
c
get_argument: pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movl %r8d, -0x2c(%rbp) movq -0x18(%rbp), %rax subq $0x1, %rax addq -0x20(%rbp), %rax movq %rax, -0x20(%rbp) leaq 0x24c82d(%rip), %rax # 0x280050 movq 0x40(%rax), %rax movq -0x20(%rbp), %rcx movzbl (%rcx), %ecx movzbl 0x1(%rax,%rcx), %eax andl $0x8, %eax cmpl $0x0, %eax je 0x3384b jmp 0x3383d movq -0x20(%rbp), %rax addq $0x1, %rax movq %rax, -0x20(%rbp) jmp 0x3381c movq -0x20(%rbp), %rax movq %rax, -0x40(%rbp) movq -0x20(%rbp), %rdi callq 0x25130 movq %rax, %rcx movq -0x40(%rbp), %rax addq %rcx, %rax addq $-0x1, %rax movq %rax, -0x38(%rbp) leaq 0x24c7db(%rip), %rax # 0x280050 movq 0x40(%rax), %rax movq -0x38(%rbp), %rcx movzbl -0x1(%rcx), %ecx movzbl 0x1(%rax,%rcx), %eax andl $0x8, %eax cmpl $0x0, %eax je 0x3389e jmp 0x33890 movq -0x38(%rbp), %rax addq $-0x1, %rax movq %rax, -0x38(%rbp) jmp 0x3386e movq -0x38(%rbp), %rax movb $0x0, (%rax) movq -0x38(%rbp), %rax cmpq -0x20(%rbp), %rax ja 0x338dd movq 0x1a5722(%rip), %rax # 0x1d8fd8 movq (%rax), %rdi movq -0x10(%rbp), %rdx movq -0x28(%rbp), %rcx movl -0x2c(%rbp), %r8d leaq 0x5019e(%rip), %rsi # 0x83a6a movb $0x0, %al callq 0x25470 movq $0x0, -0x8(%rbp) jmp 0x338e5 movq -0x20(%rbp), %rax movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x40, %rsp popq %rbp retq nop
get_argument: push rbp mov rbp, rsp sub rsp, 40h mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov [rbp+var_20], rdx mov [rbp+var_28], rcx mov [rbp+var_2C], r8d mov rax, [rbp+var_18] sub rax, 1 add rax, [rbp+var_20] mov [rbp+var_20], rax loc_3381C: lea rax, my_charset_latin1 mov rax, [rax+40h] mov rcx, [rbp+var_20] movzx ecx, byte ptr [rcx] movzx eax, byte ptr [rax+rcx+1] and eax, 8 cmp eax, 0 jz short loc_3384B jmp short $+2 loc_3383D: mov rax, [rbp+var_20] add rax, 1 mov [rbp+var_20], rax jmp short loc_3381C loc_3384B: mov rax, [rbp+var_20] mov [rbp+var_40], rax mov rdi, [rbp+var_20] call _strlen mov rcx, rax mov rax, [rbp+var_40] add rax, rcx add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_38], rax loc_3386E: lea rax, my_charset_latin1 mov rax, [rax+40h] mov rcx, [rbp+var_38] movzx ecx, byte ptr [rcx-1] movzx eax, byte ptr [rax+rcx+1] and eax, 8 cmp eax, 0 jz short loc_3389E jmp short $+2 loc_33890: mov rax, [rbp+var_38] add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_38], rax jmp short loc_3386E loc_3389E: mov rax, [rbp+var_38] mov byte ptr [rax], 0 mov rax, [rbp+var_38] cmp rax, [rbp+var_20] ja short loc_338DD mov rax, cs:stderr_ptr mov rdi, [rax] mov rdx, [rbp+var_10] mov rcx, [rbp+var_28] mov r8d, [rbp+var_2C] lea rsi, aErrorWrongSDir; "error: Wrong '!%s' directive in config "... mov al, 0 call _fprintf mov [rbp+var_8], 0 jmp short loc_338E5 loc_338DD: mov rax, [rbp+var_20] mov [rbp+var_8], rax loc_338E5: mov rax, [rbp+var_8] add rsp, 40h pop rbp retn
unsigned __int8 * get_argument(const char *a1, long long a2, long long a3, const char *a4, int a5) { unsigned __int8 *j; // [rsp+8h] [rbp-38h] unsigned __int8 *i; // [rsp+20h] [rbp-20h] for ( i = (unsigned __int8 *)(a3 + a2 - 1); (*(_BYTE *)(*((_QWORD *)&my_charset_latin1 + 8) + *i + 1LL) & 8) != 0; ++i ) ; for ( j = &i[strlen(i) - 1]; (*(_BYTE *)(*((_QWORD *)&my_charset_latin1 + 8) + *(j - 1) + 1LL) & 8) != 0; --j ) ; *j = 0; if ( j > i ) return i; fprintf(stderr, "error: Wrong '!%s' directive in config file: %s at line %d\n", a1, a4, a5); return 0LL; }
get_argument: PUSH RBP MOV RBP,RSP SUB RSP,0x40 MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV qword ptr [RBP + -0x20],RDX MOV qword ptr [RBP + -0x28],RCX MOV dword ptr [RBP + -0x2c],R8D MOV RAX,qword ptr [RBP + -0x18] SUB RAX,0x1 ADD RAX,qword ptr [RBP + -0x20] MOV qword ptr [RBP + -0x20],RAX LAB_0013381c: LEA RAX,[0x380050] MOV RAX,qword ptr [RAX + 0x40] MOV RCX,qword ptr [RBP + -0x20] MOVZX ECX,byte ptr [RCX] MOVZX EAX,byte ptr [RAX + RCX*0x1 + 0x1] AND EAX,0x8 CMP EAX,0x0 JZ 0x0013384b JMP 0x0013383d LAB_0013383d: MOV RAX,qword ptr [RBP + -0x20] ADD RAX,0x1 MOV qword ptr [RBP + -0x20],RAX JMP 0x0013381c LAB_0013384b: MOV RAX,qword ptr [RBP + -0x20] MOV qword ptr [RBP + -0x40],RAX MOV RDI,qword ptr [RBP + -0x20] CALL 0x00125130 MOV RCX,RAX MOV RAX,qword ptr [RBP + -0x40] ADD RAX,RCX ADD RAX,-0x1 MOV qword ptr [RBP + -0x38],RAX LAB_0013386e: LEA RAX,[0x380050] MOV RAX,qword ptr [RAX + 0x40] MOV RCX,qword ptr [RBP + -0x38] MOVZX ECX,byte ptr [RCX + -0x1] MOVZX EAX,byte ptr [RAX + RCX*0x1 + 0x1] AND EAX,0x8 CMP EAX,0x0 JZ 0x0013389e JMP 0x00133890 LAB_00133890: MOV RAX,qword ptr [RBP + -0x38] ADD RAX,-0x1 MOV qword ptr [RBP + -0x38],RAX JMP 0x0013386e LAB_0013389e: MOV RAX,qword ptr [RBP + -0x38] MOV byte ptr [RAX],0x0 MOV RAX,qword ptr [RBP + -0x38] CMP RAX,qword ptr [RBP + -0x20] JA 0x001338dd MOV RAX,qword ptr [0x002d8fd8] MOV RDI,qword ptr [RAX] MOV RDX,qword ptr [RBP + -0x10] MOV RCX,qword ptr [RBP + -0x28] MOV R8D,dword ptr [RBP + -0x2c] LEA RSI,[0x183a6a] MOV AL,0x0 CALL 0x00125470 MOV qword ptr [RBP + -0x8],0x0 JMP 0x001338e5 LAB_001338dd: MOV RAX,qword ptr [RBP + -0x20] MOV qword ptr [RBP + -0x8],RAX LAB_001338e5: MOV RAX,qword ptr [RBP + -0x8] ADD RSP,0x40 POP RBP RET
byte * get_argument(int8 param_1,long param_2,long param_3,int8 param_4,uint param_5) { byte *pbVar1; byte *pbVar2; size_t sVar3; byte *local_40; byte *local_28; byte *local_10; local_28 = (byte *)(param_2 + -1 + param_3); while ((PTR_ctype_latin1_00380090[(ulong)*local_28 + 1] & 8) != 0) { local_28 = local_28 + 1; } sVar3 = strlen((char *)local_28); pbVar2 = local_28 + sVar3; do { local_40 = pbVar2 + -1; pbVar1 = pbVar2 + -2; pbVar2 = local_40; } while ((PTR_ctype_latin1_00380090[(ulong)*pbVar1 + 1] & 8) != 0); *local_40 = 0; if (local_28 < local_40) { local_10 = local_28; } else { fprintf(*(FILE **)PTR_stderr_002d8fd8, "error: Wrong \'!%s\' directive in config file: %s at line %d\n",param_1,param_4, (ulong)param_5); local_10 = (byte *)0x0; } return local_10; }
2,943
lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*)
dmazzella[P]pylunasvg/lunasvg/source/svggeometryelement.cpp
SVGEllipseElement::SVGEllipseElement(Document* document) : SVGGeometryElement(document, ElementID::Ellipse) , m_cx(PropertyID::Cx, LengthDirection::Horizontal, LengthNegativeMode::Allow) , m_cy(PropertyID::Cy, LengthDirection::Vertical, LengthNegativeMode::Allow) , m_rx(PropertyID::Rx, LengthDirection::Diagonal, LengthNegativeMode::Forbid) , m_ry(PropertyID::Ry, LengthDirection::Diagonal, LengthNegativeMode::Forbid) { addProperty(m_cx); addProperty(m_cy); addProperty(m_rx); addProperty(m_ry); }
O0
cpp
lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*): pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x30(%rbp) movq -0x10(%rbp), %rsi movl $0x5, %edx callq 0x2d000 movq -0x30(%rbp), %rdi leaq 0x94117(%rip), %rax # 0xc25d8 movq %rax, (%rdi) addq $0x118, %rdi # imm = 0x118 movq %rdi, -0x28(%rbp) movl $0x8, %esi xorps %xmm0, %xmm0 xorl %r8d, %r8d movl %r8d, %edx movl %r8d, %ecx callq 0x20d00 jmp 0x2e4e7 movq -0x30(%rbp), %rdi addq $0x130, %rdi # imm = 0x130 movq %rdi, -0x38(%rbp) movl $0x9, %esi movl $0x1, %edx xorps %xmm0, %xmm0 xorl %r8d, %r8d movl %r8d, %ecx callq 0x20d00 jmp 0x2e510 movq -0x30(%rbp), %rdi addq $0x148, %rdi # imm = 0x148 movq %rdi, -0x40(%rbp) movl $0x36, %esi movl $0x2, %edx movl $0x1, %ecx xorps %xmm0, %xmm0 xorl %r8d, %r8d callq 0x20d00 jmp 0x2e53b movq -0x30(%rbp), %rdi addq $0x160, %rdi # imm = 0x160 movq %rdi, -0x48(%rbp) movl $0x37, %esi movl $0x2, %edx movl $0x1, %ecx xorps %xmm0, %xmm0 xorl %r8d, %r8d callq 0x20d00 jmp 0x2e566 movq -0x30(%rbp), %rdi movq %rdi, %rsi addq $0x118, %rsi # imm = 0x118 callq 0x19a70 jmp 0x2e57b movq -0x30(%rbp), %rdi movq %rdi, %rsi addq $0x130, %rsi # imm = 0x130 callq 0x19a70 jmp 0x2e590 movq -0x30(%rbp), %rdi movq %rdi, %rsi addq $0x148, %rsi # imm = 0x148 callq 0x19a70 jmp 0x2e5a5 movq -0x30(%rbp), %rdi movq %rdi, %rsi addq $0x160, %rsi # imm = 0x160 callq 0x19a70 jmp 0x2e5ba addq $0x50, %rsp popq %rbp retq movq %rax, %rcx movl %edx, %eax movq %rcx, -0x18(%rbp) movl %eax, -0x1c(%rbp) jmp 0x2e628 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x18(%rbp) movl %eax, -0x1c(%rbp) jmp 0x2e61f movq %rax, %rcx movl %edx, %eax movq %rcx, -0x18(%rbp) movl %eax, -0x1c(%rbp) jmp 0x2e616 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x18(%rbp) movl %eax, -0x1c(%rbp) jmp 0x2e60d movq -0x48(%rbp), %rdi movq %rax, %rcx movl %edx, %eax movq %rcx, -0x18(%rbp) movl %eax, -0x1c(%rbp) callq 0xfb10 movq -0x40(%rbp), %rdi callq 0xfb10 movq -0x38(%rbp), %rdi callq 0xfb10 movq -0x28(%rbp), %rdi callq 0xfb10 movq -0x30(%rbp), %rdi callq 0x24260 movq -0x18(%rbp), %rdi callq 0xb6c0 nopw (%rax,%rax)
_ZN7lunasvg17SVGEllipseElementC2EPNS_8DocumentE: push rbp mov rbp, rsp sub rsp, 50h mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov rdi, [rbp+var_8] mov [rbp+var_30], rdi mov rsi, [rbp+var_10] mov edx, 5 call _ZN7lunasvg18SVGGeometryElementC2EPNS_8DocumentENS_9ElementIDE; lunasvg::SVGGeometryElement::SVGGeometryElement(lunasvg::Document *,lunasvg::ElementID) mov rdi, [rbp+var_30] lea rax, off_C25D8 mov [rdi], rax add rdi, 118h mov [rbp+var_28], rdi mov esi, 8 xorps xmm0, xmm0 xor r8d, r8d mov edx, r8d mov ecx, r8d call _ZN7lunasvg9SVGLengthC2ENS_10PropertyIDENS_15LengthDirectionENS_18LengthNegativeModeEfNS_11LengthUnitsE; lunasvg::SVGLength::SVGLength(lunasvg::PropertyID,lunasvg::LengthDirection,lunasvg::LengthNegativeMode,float,lunasvg::LengthUnits) jmp short $+2 loc_2E4E7: mov rdi, [rbp+var_30] add rdi, 130h mov [rbp+var_38], rdi mov esi, 9 mov edx, 1 xorps xmm0, xmm0 xor r8d, r8d mov ecx, r8d call _ZN7lunasvg9SVGLengthC2ENS_10PropertyIDENS_15LengthDirectionENS_18LengthNegativeModeEfNS_11LengthUnitsE; lunasvg::SVGLength::SVGLength(lunasvg::PropertyID,lunasvg::LengthDirection,lunasvg::LengthNegativeMode,float,lunasvg::LengthUnits) jmp short $+2 loc_2E510: mov rdi, [rbp+var_30] add rdi, 148h mov [rbp+var_40], rdi mov esi, 36h ; '6' mov edx, 2 mov ecx, 1 xorps xmm0, xmm0 xor r8d, r8d call _ZN7lunasvg9SVGLengthC2ENS_10PropertyIDENS_15LengthDirectionENS_18LengthNegativeModeEfNS_11LengthUnitsE; lunasvg::SVGLength::SVGLength(lunasvg::PropertyID,lunasvg::LengthDirection,lunasvg::LengthNegativeMode,float,lunasvg::LengthUnits) jmp short $+2 loc_2E53B: mov rdi, [rbp+var_30] add rdi, 160h mov [rbp+var_48], rdi mov esi, 37h ; '7' mov edx, 2 mov ecx, 1 xorps xmm0, xmm0 xor r8d, r8d call _ZN7lunasvg9SVGLengthC2ENS_10PropertyIDENS_15LengthDirectionENS_18LengthNegativeModeEfNS_11LengthUnitsE; lunasvg::SVGLength::SVGLength(lunasvg::PropertyID,lunasvg::LengthDirection,lunasvg::LengthNegativeMode,float,lunasvg::LengthUnits) jmp short $+2 loc_2E566: mov rdi, [rbp+var_30]; this mov rsi, rdi add rsi, 118h; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) jmp short $+2 loc_2E57B: mov rdi, [rbp+var_30]; this mov rsi, rdi add rsi, 130h; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) jmp short $+2 loc_2E590: mov rdi, [rbp+var_30]; this mov rsi, rdi add rsi, 148h; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) jmp short $+2 loc_2E5A5: mov rdi, [rbp+var_30]; this mov rsi, rdi add rsi, 160h; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) jmp short $+2 loc_2E5BA: add rsp, 50h pop rbp retn mov rcx, rax mov eax, edx mov [rbp+var_18], rcx mov [rbp+var_1C], eax jmp short loc_2E628 mov rcx, rax mov eax, edx mov [rbp+var_18], rcx mov [rbp+var_1C], eax jmp short loc_2E61F mov rcx, rax mov eax, edx mov [rbp+var_18], rcx mov [rbp+var_1C], eax jmp short loc_2E616 mov rcx, rax mov eax, edx mov [rbp+var_18], rcx mov [rbp+var_1C], eax jmp short loc_2E60D mov rdi, [rbp+var_48]; this mov rcx, rax mov eax, edx mov [rbp+var_18], rcx mov [rbp+var_1C], eax call _ZN7lunasvg9SVGLengthD2Ev; lunasvg::SVGLength::~SVGLength() loc_2E60D: mov rdi, [rbp+var_40]; this call _ZN7lunasvg9SVGLengthD2Ev; lunasvg::SVGLength::~SVGLength() loc_2E616: mov rdi, [rbp+var_38]; this call _ZN7lunasvg9SVGLengthD2Ev; lunasvg::SVGLength::~SVGLength() loc_2E61F: mov rdi, [rbp+var_28]; this call _ZN7lunasvg9SVGLengthD2Ev; lunasvg::SVGLength::~SVGLength() loc_2E628: mov rdi, [rbp+var_30]; this call _ZN7lunasvg18SVGGeometryElementD2Ev; lunasvg::SVGGeometryElement::~SVGGeometryElement() mov rdi, [rbp+var_18] call __Unwind_Resume
long long lunasvg::SVGEllipseElement::SVGEllipseElement( lunasvg::SVGEllipseElement *this, lunasvg::Document *a2) { lunasvg::SVGGeometryElement::SVGGeometryElement((long long)this, a2, 5); *(_QWORD *)this = off_C25D8; lunasvg::SVGLength::SVGLength((long long)this + 280, 8u, 0, 0, 0, 0.0); lunasvg::SVGLength::SVGLength((long long)this + 304, 9u, 1, 0, 0, 0.0); lunasvg::SVGLength::SVGLength((long long)this + 328, 0x36u, 2, 1, 0, 0.0); lunasvg::SVGLength::SVGLength((long long)this + 352, 0x37u, 2, 1, 0, 0.0); lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 280)); lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 304)); lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 328)); return lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 352)); }
SVGEllipseElement: PUSH RBP MOV RBP,RSP SUB RSP,0x50 MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV RDI,qword ptr [RBP + -0x8] MOV qword ptr [RBP + -0x30],RDI MOV RSI,qword ptr [RBP + -0x10] MOV EDX,0x5 CALL 0x0012d000 MOV RDI,qword ptr [RBP + -0x30] LEA RAX,[0x1c25d8] MOV qword ptr [RDI],RAX ADD RDI,0x118 MOV qword ptr [RBP + -0x28],RDI LAB_0012e4cf: MOV ESI,0x8 XORPS XMM0,XMM0 XOR R8D,R8D MOV EDX,R8D MOV ECX,R8D CALL 0x00120d00 JMP 0x0012e4e7 LAB_0012e4e7: MOV RDI,qword ptr [RBP + -0x30] ADD RDI,0x130 MOV qword ptr [RBP + -0x38],RDI LAB_0012e4f6: MOV ESI,0x9 MOV EDX,0x1 XORPS XMM0,XMM0 XOR R8D,R8D MOV ECX,R8D CALL 0x00120d00 JMP 0x0012e510 LAB_0012e510: MOV RDI,qword ptr [RBP + -0x30] ADD RDI,0x148 MOV qword ptr [RBP + -0x40],RDI LAB_0012e51f: MOV ESI,0x36 MOV EDX,0x2 MOV ECX,0x1 XORPS XMM0,XMM0 XOR R8D,R8D CALL 0x00120d00 JMP 0x0012e53b LAB_0012e53b: MOV RDI,qword ptr [RBP + -0x30] ADD RDI,0x160 MOV qword ptr [RBP + -0x48],RDI LAB_0012e54a: MOV ESI,0x37 MOV EDX,0x2 MOV ECX,0x1 XORPS XMM0,XMM0 XOR R8D,R8D CALL 0x00120d00 JMP 0x0012e566 LAB_0012e566: MOV RDI,qword ptr [RBP + -0x30] MOV RSI,RDI ADD RSI,0x118 LAB_0012e574: CALL 0x00119a70 JMP 0x0012e57b LAB_0012e57b: MOV RDI,qword ptr [RBP + -0x30] MOV RSI,RDI ADD RSI,0x130 CALL 0x00119a70 JMP 0x0012e590 LAB_0012e590: MOV RDI,qword ptr [RBP + -0x30] MOV RSI,RDI ADD RSI,0x148 CALL 0x00119a70 JMP 0x0012e5a5 LAB_0012e5a5: MOV RDI,qword ptr [RBP + -0x30] MOV RSI,RDI ADD RSI,0x160 CALL 0x00119a70 LAB_0012e5b8: JMP 0x0012e5ba LAB_0012e5ba: ADD RSP,0x50 POP RBP RET
/* lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*) */ void __thiscall lunasvg::SVGEllipseElement::SVGEllipseElement(SVGEllipseElement *this,Document *param_1) { SVGGeometryElement::SVGGeometryElement((SVGGeometryElement *)this,param_1,5); *(int ***)this = &PTR__SVGEllipseElement_001c25d8; /* try { // try from 0012e4cf to 0012e4e4 has its CatchHandler @ 0012e5c0 */ SVGLength::SVGLength((SVGLength *)0x0,this + 0x118,8,0,0); /* try { // try from 0012e4f6 to 0012e50d has its CatchHandler @ 0012e5ce */ SVGLength::SVGLength((SVGLength *)0x0,this + 0x130,9,1,0); /* try { // try from 0012e51f to 0012e538 has its CatchHandler @ 0012e5dc */ SVGLength::SVGLength((SVGLength *)0x0,this + 0x148,0x36,2,1,0); /* try { // try from 0012e54a to 0012e563 has its CatchHandler @ 0012e5ea */ SVGLength::SVGLength((SVGLength *)0x0,this + 0x160,0x37,2,1,0); /* try { // try from 0012e574 to 0012e5b7 has its CatchHandler @ 0012e5f8 */ SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x118)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x130)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x148)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x160)); return; }
2,944
lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*)
dmazzella[P]pylunasvg/lunasvg/source/svggeometryelement.cpp
SVGEllipseElement::SVGEllipseElement(Document* document) : SVGGeometryElement(document, ElementID::Ellipse) , m_cx(PropertyID::Cx, LengthDirection::Horizontal, LengthNegativeMode::Allow) , m_cy(PropertyID::Cy, LengthDirection::Vertical, LengthNegativeMode::Allow) , m_rx(PropertyID::Rx, LengthDirection::Diagonal, LengthNegativeMode::Forbid) , m_ry(PropertyID::Ry, LengthDirection::Diagonal, LengthNegativeMode::Forbid) { addProperty(m_cx); addProperty(m_cy); addProperty(m_rx); addProperty(m_ry); }
O1
cpp
lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx movl $0x5, %edx callq 0x102f8 leaq 0x44bc5(%rip), %rax # 0x593c0 movq %rax, (%rbx) xorps %xmm0, %xmm0 movups %xmm0, 0x98(%rbx) xorl %eax, %eax movq %rax, 0xa8(%rbx) movabsq $0x408000003f800000, %rcx # imm = 0x408000003F800000 movq %rcx, 0xb0(%rbx) movl %eax, 0xb8(%rbx) movw $0x0, 0xbc(%rbx) movups %xmm0, 0xc0(%rbx) movups %xmm0, 0xd0(%rbx) leaq 0x2e932(%rip), %rcx # 0x43178 movl (%rcx), %ecx movl %ecx, 0xe0(%rbx) movl %eax, 0xe4(%rbx) movq %rax, 0xe8(%rbx) movl %ecx, 0xf0(%rbx) movups %xmm0, 0xf4(%rbx) movups %xmm0, 0x102(%rbx) leaq 0x44d42(%rip), %rax # 0x595b8 movq %rax, (%rbx) leaq 0x118(%rbx), %r14 movq %r14, %rdi movl $0x8, %esi callq 0x1f3bc leaq 0x4657c(%rip), %rbp # 0x5ae10 addq $0x10, %rbp movq %rbp, 0x118(%rbx) movw $0x0, 0x121(%rbx) movl $0x0, 0x124(%rbx) movb $0x0, 0x128(%rbx) leaq 0x130(%rbx), %r15 movq %r15, %rdi movl $0x9, %esi callq 0x1f3bc movq %rbp, 0x130(%rbx) movw $0x1, 0x139(%rbx) movl $0x0, 0x13c(%rbx) movb $0x0, 0x140(%rbx) leaq 0x148(%rbx), %r12 movq %r12, %rdi movl $0x36, %esi callq 0x1f3bc movq %rbp, 0x148(%rbx) movw $0x102, 0x151(%rbx) # imm = 0x102 movl $0x0, 0x154(%rbx) movb $0x0, 0x158(%rbx) leaq 0x160(%rbx), %r13 movq %r13, %rdi movl $0x37, %esi callq 0x1f3bc movq %rbp, 0x160(%rbx) movw $0x102, 0x169(%rbx) # imm = 0x102 movl $0x0, 0x16c(%rbx) movb $0x0, 0x170(%rbx) movq %rbx, %rdi movq %r14, %rsi callq 0xfbfe movq %rbx, %rdi movq %r15, %rsi callq 0xfbfe movq %rbx, %rdi movq %r12, %rsi callq 0xfbfe movq %rbx, %rdi movq %r13, %rsi callq 0xfbfe addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq jmp 0x1499b jmp 0x1499b jmp 0x1499b jmp 0x1499b movq %rax, %r14 movq %rbx, %rdi callq 0x15038 movq %r14, %rdi callq 0xa5c0
_ZN7lunasvg17SVGEllipseElementC2EPNS_8DocumentE: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov rbx, rdi mov edx, 5 call _ZN7lunasvg18SVGGraphicsElementC2EPNS_8DocumentENS_9ElementIDE; lunasvg::SVGGraphicsElement::SVGGraphicsElement(lunasvg::Document *,lunasvg::ElementID) lea rax, off_593C0 mov [rbx], rax xorps xmm0, xmm0 movups xmmword ptr [rbx+98h], xmm0 xor eax, eax mov [rbx+0A8h], rax mov rcx, 408000003F800000h mov [rbx+0B0h], rcx mov [rbx+0B8h], eax mov word ptr [rbx+0BCh], 0 movups xmmword ptr [rbx+0C0h], xmm0 movups xmmword ptr [rbx+0D0h], xmm0 lea rcx, _ZN7lunasvg5Color11TransparentE; lunasvg::Color::Transparent mov ecx, [rcx] mov [rbx+0E0h], ecx mov [rbx+0E4h], eax mov [rbx+0E8h], rax mov [rbx+0F0h], ecx movups xmmword ptr [rbx+0F4h], xmm0 movups xmmword ptr [rbx+102h], xmm0 lea rax, off_595B8 mov [rbx], rax lea r14, [rbx+118h] mov rdi, r14 mov esi, 8 call _ZN7lunasvg11SVGPropertyC2ENS_10PropertyIDE; lunasvg::SVGProperty::SVGProperty(lunasvg::PropertyID) lea rbp, _ZTVN7lunasvg9SVGLengthE; `vtable for'lunasvg::SVGLength add rbp, 10h mov [rbx+118h], rbp mov word ptr [rbx+121h], 0 mov dword ptr [rbx+124h], 0 mov byte ptr [rbx+128h], 0 lea r15, [rbx+130h] mov rdi, r15 mov esi, 9 call _ZN7lunasvg11SVGPropertyC2ENS_10PropertyIDE; lunasvg::SVGProperty::SVGProperty(lunasvg::PropertyID) mov [rbx+130h], rbp mov word ptr [rbx+139h], 1 mov dword ptr [rbx+13Ch], 0 mov byte ptr [rbx+140h], 0 lea r12, [rbx+148h] mov rdi, r12 mov esi, 36h ; '6' call _ZN7lunasvg11SVGPropertyC2ENS_10PropertyIDE; lunasvg::SVGProperty::SVGProperty(lunasvg::PropertyID) mov [rbx+148h], rbp mov word ptr [rbx+151h], 102h mov dword ptr [rbx+154h], 0 mov byte ptr [rbx+158h], 0 lea r13, [rbx+160h] mov rdi, r13 mov esi, 37h ; '7' call _ZN7lunasvg11SVGPropertyC2ENS_10PropertyIDE; lunasvg::SVGProperty::SVGProperty(lunasvg::PropertyID) mov [rbx+160h], rbp mov word ptr [rbx+169h], 102h mov dword ptr [rbx+16Ch], 0 mov byte ptr [rbx+170h], 0 mov rdi, rbx; this mov rsi, r14; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) mov rdi, rbx; this mov rsi, r15; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) mov rdi, rbx; this mov rsi, r12; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) mov rdi, rbx; this mov rsi, r13; lunasvg::SVGProperty * call _ZN7lunasvg10SVGElement11addPropertyERNS_11SVGPropertyE; lunasvg::SVGElement::addProperty(lunasvg::SVGProperty &) add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn jmp short loc_1499B jmp short loc_1499B jmp short loc_1499B jmp short $+2 loc_1499B: mov r14, rax mov rdi, rbx; this call _ZN7lunasvg18SVGGeometryElementD2Ev; lunasvg::SVGGeometryElement::~SVGGeometryElement() mov rdi, r14 call __Unwind_Resume
_QWORD * lunasvg::SVGEllipseElement::SVGEllipseElement( lunasvg::SVGEllipseElement *this, lunasvg::Document *a2) { lunasvg::SVGGraphicsElement::SVGGraphicsElement((long long)this, (long long)a2, 5); *(_QWORD *)this = &off_593C0; *(_OWORD *)((char *)this + 152) = 0LL; *((_QWORD *)this + 21) = 0LL; *((_QWORD *)this + 22) = 0x408000003F800000LL; *((_DWORD *)this + 46) = 0; *((_WORD *)this + 94) = 0; *((_OWORD *)this + 12) = 0LL; *((_OWORD *)this + 13) = 0LL; *((_DWORD *)this + 56) = lunasvg::Color::Transparent; *((_DWORD *)this + 57) = 0; *((_QWORD *)this + 29) = 0LL; *((_DWORD *)this + 60) = lunasvg::Color::Transparent; *(_OWORD *)((char *)this + 244) = 0LL; *(_OWORD *)((char *)this + 258) = 0LL; *(_QWORD *)this = off_595B8; lunasvg::SVGProperty::SVGProperty((char *)this + 280, 8LL); *((_QWORD *)this + 35) = &`vtable for'lunasvg::SVGLength + 2; *(_WORD *)((char *)this + 289) = 0; *((_DWORD *)this + 73) = 0; *((_BYTE *)this + 296) = 0; lunasvg::SVGProperty::SVGProperty((char *)this + 304, 9LL); *((_QWORD *)this + 38) = &`vtable for'lunasvg::SVGLength + 2; *(_WORD *)((char *)this + 313) = 1; *((_DWORD *)this + 79) = 0; *((_BYTE *)this + 320) = 0; lunasvg::SVGProperty::SVGProperty((char *)this + 328, 54LL); *((_QWORD *)this + 41) = &`vtable for'lunasvg::SVGLength + 2; *(_WORD *)((char *)this + 337) = 258; *((_DWORD *)this + 85) = 0; *((_BYTE *)this + 344) = 0; lunasvg::SVGProperty::SVGProperty((char *)this + 352, 55LL); *((_QWORD *)this + 44) = &`vtable for'lunasvg::SVGLength + 2; *(_WORD *)((char *)this + 361) = 258; *((_DWORD *)this + 91) = 0; *((_BYTE *)this + 368) = 0; lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 280)); lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 304)); lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 328)); return lunasvg::SVGElement::addProperty(this, (lunasvg::SVGEllipseElement *)((char *)this + 352)); }
SVGEllipseElement: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV RBX,RDI MOV EDX,0x5 CALL 0x001102f8 LEA RAX,[0x1593c0] MOV qword ptr [RBX],RAX XORPS XMM0,XMM0 MOVUPS xmmword ptr [RBX + 0x98],XMM0 XOR EAX,EAX MOV qword ptr [RBX + 0xa8],RAX MOV RCX,0x408000003f800000 MOV qword ptr [RBX + 0xb0],RCX MOV dword ptr [RBX + 0xb8],EAX MOV word ptr [RBX + 0xbc],0x0 MOVUPS xmmword ptr [RBX + 0xc0],XMM0 MOVUPS xmmword ptr [RBX + 0xd0],XMM0 LEA RCX,[0x143178] MOV ECX,dword ptr [RCX] MOV dword ptr [RBX + 0xe0],ECX MOV dword ptr [RBX + 0xe4],EAX MOV qword ptr [RBX + 0xe8],RAX MOV dword ptr [RBX + 0xf0],ECX MOVUPS xmmword ptr [RBX + 0xf4],XMM0 MOVUPS xmmword ptr [RBX + 0x102],XMM0 LEA RAX,[0x1595b8] MOV qword ptr [RBX],RAX LEA R14,[RBX + 0x118] LAB_00114880: MOV RDI,R14 MOV ESI,0x8 CALL 0x0011f3bc LEA RBP,[0x15ae10] ADD RBP,0x10 MOV qword ptr [RBX + 0x118],RBP MOV word ptr [RBX + 0x121],0x0 MOV dword ptr [RBX + 0x124],0x0 MOV byte ptr [RBX + 0x128],0x0 LEA R15,[RBX + 0x130] LAB_001148c0: MOV RDI,R15 MOV ESI,0x9 CALL 0x0011f3bc MOV qword ptr [RBX + 0x130],RBP MOV word ptr [RBX + 0x139],0x1 MOV dword ptr [RBX + 0x13c],0x0 MOV byte ptr [RBX + 0x140],0x0 LEA R12,[RBX + 0x148] LAB_001148f5: MOV RDI,R12 MOV ESI,0x36 CALL 0x0011f3bc MOV qword ptr [RBX + 0x148],RBP MOV word ptr [RBX + 0x151],0x102 MOV dword ptr [RBX + 0x154],0x0 MOV byte ptr [RBX + 0x158],0x0 LEA R13,[RBX + 0x160] LAB_0011492a: MOV RDI,R13 MOV ESI,0x37 CALL 0x0011f3bc MOV qword ptr [RBX + 0x160],RBP MOV word ptr [RBX + 0x169],0x102 MOV dword ptr [RBX + 0x16c],0x0 MOV byte ptr [RBX + 0x170],0x0 LAB_00114958: MOV RDI,RBX MOV RSI,R14 CALL 0x0010fbfe MOV RDI,RBX MOV RSI,R15 CALL 0x0010fbfe MOV RDI,RBX MOV RSI,R12 CALL 0x0010fbfe MOV RDI,RBX MOV RSI,R13 CALL 0x0010fbfe LAB_00114984: ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* lunasvg::SVGEllipseElement::SVGEllipseElement(lunasvg::Document*) */ void __thiscall lunasvg::SVGEllipseElement::SVGEllipseElement(SVGEllipseElement *this,Document *param_1) { int4 uVar1; SVGGraphicsElement::SVGGraphicsElement((SVGGraphicsElement *)this,param_1,5); *(int ***)this = &PTR__SVGGeometryElement_001593c0; *(int8 *)(this + 0x98) = 0; *(int8 *)(this + 0xa0) = 0; *(int8 *)(this + 0xa8) = 0; *(int8 *)(this + 0xb0) = 0x408000003f800000; *(int4 *)(this + 0xb8) = 0; *(int2 *)(this + 0xbc) = 0; *(int8 *)(this + 0xc0) = 0; *(int8 *)(this + 200) = 0; *(int8 *)(this + 0xd0) = 0; *(int8 *)(this + 0xd8) = 0; uVar1 = Color::Transparent; *(int4 *)(this + 0xe0) = Color::Transparent; *(int4 *)(this + 0xe4) = 0; *(int8 *)(this + 0xe8) = 0; *(int4 *)(this + 0xf0) = uVar1; *(int8 *)(this + 0xf4) = 0; *(int8 *)(this + 0xfc) = 0; *(int8 *)(this + 0x102) = 0; *(int8 *)(this + 0x10a) = 0; *(int ***)this = &PTR__SVGEllipseElement_001595b8; /* try { // try from 00114880 to 0011488c has its CatchHandler @ 00114999 */ SVGProperty::SVGProperty((SVGProperty *)(this + 0x118),8); *(int ***)(this + 0x118) = &PTR__SVGProperty_0015ae20; *(int2 *)(this + 0x121) = 0; *(int4 *)(this + 0x124) = 0; this[0x128] = (SVGEllipseElement)0x0; /* try { // try from 001148c0 to 001148cc has its CatchHandler @ 00114997 */ SVGProperty::SVGProperty((SVGProperty *)(this + 0x130),9); *(int ***)(this + 0x130) = &PTR__SVGProperty_0015ae20; *(int2 *)(this + 0x139) = 1; *(int4 *)(this + 0x13c) = 0; this[0x140] = (SVGEllipseElement)0x0; /* try { // try from 001148f5 to 00114901 has its CatchHandler @ 00114995 */ SVGProperty::SVGProperty((SVGProperty *)(this + 0x148),0x36); *(int ***)(this + 0x148) = &PTR__SVGProperty_0015ae20; *(int2 *)(this + 0x151) = 0x102; *(int4 *)(this + 0x154) = 0; this[0x158] = (SVGEllipseElement)0x0; /* try { // try from 0011492a to 00114936 has its CatchHandler @ 00114993 */ SVGProperty::SVGProperty((SVGProperty *)(this + 0x160),0x37); *(int ***)(this + 0x160) = &PTR__SVGProperty_0015ae20; *(int2 *)(this + 0x169) = 0x102; *(int4 *)(this + 0x16c) = 0; this[0x170] = (SVGEllipseElement)0x0; /* try { // try from 00114958 to 00114983 has its CatchHandler @ 0011499b */ SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x118)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x130)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x148)); SVGElement::addProperty((SVGElement *)this,(SVGProperty *)(this + 0x160)); return; }
2,945
my_caseup_str_mb
eloqsql/strings/ctype-mb.c
size_t my_caseup_str_mb(CHARSET_INFO * cs, char *str) { register uint32 l; register const uchar *map= cs->to_upper; char *str_orig= str; while (*str) { /* Pointing after the '\0' is safe here. */ if ((l= my_ismbchar(cs, str, str + cs->mbmaxlen))) str+= l; else { *str= (char) map[(uchar)*str]; str++; } } return (size_t) (str - str_orig); }
O3
c
my_caseup_str_mb: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movq %rsi, %rbx cmpb $0x0, (%rsi) movq %rsi, %rax je 0x39cf4 movq %rdi, %r14 movq 0x50(%rdi), %r12 movq %rbx, %r15 movl 0x9c(%r14), %edx addq %r15, %rdx movq 0xb8(%r14), %rax movq %r14, %rdi movq %r15, %rsi callq *0xc0(%rax) cmpl $0x2, %eax jge 0x39ce4 movzbl (%r15), %eax movb (%r12,%rax), %al movb %al, (%r15) movl $0x1, %ecx jmp 0x39ce6 movl %eax, %ecx leaq (%r15,%rcx), %rax cmpb $0x0, (%r15,%rcx) movq %rax, %r15 jne 0x39cb0 subq %rbx, %rax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
my_caseup_str_mb: push rbp mov rbp, rsp push r15 push r14 push r12 push rbx mov rbx, rsi cmp byte ptr [rsi], 0 mov rax, rsi jz short loc_39CF4 mov r14, rdi mov r12, [rdi+50h] mov r15, rbx loc_39CB0: mov edx, [r14+9Ch] add rdx, r15 mov rax, [r14+0B8h] mov rdi, r14 mov rsi, r15 call qword ptr [rax+0C0h] cmp eax, 2 jge short loc_39CE4 movzx eax, byte ptr [r15] mov al, [r12+rax] mov [r15], al mov ecx, 1 jmp short loc_39CE6 loc_39CE4: mov ecx, eax loc_39CE6: lea rax, [r15+rcx] cmp byte ptr [r15+rcx], 0 mov r15, rax jnz short loc_39CB0 loc_39CF4: sub rax, rbx pop rbx pop r12 pop r14 pop r15 pop rbp retn
long long my_caseup_str_mb(long long a1, _BYTE *a2) { _BYTE *v2; // rax long long v3; // r12 _BYTE *v4; // r15 int v5; // eax long long v6; // rcx bool v7; // zf v2 = a2; if ( *a2 ) { v3 = *(_QWORD *)(a1 + 80); v4 = a2; do { v5 = (*(long long ( **)(long long, _BYTE *, _BYTE *))(*(_QWORD *)(a1 + 184) + 192LL))( a1, v4, &v4[*(unsigned int *)(a1 + 156)]); if ( v5 >= 2 ) { v6 = (unsigned int)v5; } else { *v4 = *(_BYTE *)(v3 + (unsigned __int8)*v4); v6 = 1LL; } v2 = &v4[v6]; v7 = v4[v6] == 0; v4 += v6; } while ( !v7 ); } return v2 - a2; }
my_caseup_str_mb: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R12 PUSH RBX MOV RBX,RSI CMP byte ptr [RSI],0x0 MOV RAX,RSI JZ 0x00139cf4 MOV R14,RDI MOV R12,qword ptr [RDI + 0x50] MOV R15,RBX LAB_00139cb0: MOV EDX,dword ptr [R14 + 0x9c] ADD RDX,R15 MOV RAX,qword ptr [R14 + 0xb8] MOV RDI,R14 MOV RSI,R15 CALL qword ptr [RAX + 0xc0] CMP EAX,0x2 JGE 0x00139ce4 MOVZX EAX,byte ptr [R15] MOV AL,byte ptr [R12 + RAX*0x1] MOV byte ptr [R15],AL MOV ECX,0x1 JMP 0x00139ce6 LAB_00139ce4: MOV ECX,EAX LAB_00139ce6: LEA RAX,[R15 + RCX*0x1] CMP byte ptr [R15 + RCX*0x1],0x0 MOV R15,RAX JNZ 0x00139cb0 LAB_00139cf4: SUB RAX,RBX POP RBX POP R12 POP R14 POP R15 POP RBP RET
long my_caseup_str_mb(long param_1,byte *param_2) { byte *pbVar1; long lVar2; uint uVar3; byte *pbVar4; ulong uVar5; byte *pbVar6; pbVar4 = param_2; if (*param_2 != 0) { lVar2 = *(long *)(param_1 + 0x50); pbVar6 = param_2; do { uVar3 = (**(code **)(*(long *)(param_1 + 0xb8) + 0xc0)) (param_1,pbVar6,pbVar6 + *(uint *)(param_1 + 0x9c)); if ((int)uVar3 < 2) { *pbVar6 = *(byte *)(lVar2 + (ulong)*pbVar6); uVar5 = 1; } else { uVar5 = (ulong)uVar3; } pbVar4 = pbVar6 + uVar5; pbVar1 = pbVar6 + uVar5; pbVar6 = pbVar4; } while (*pbVar1 != 0); } return (long)pbVar4 - (long)param_2; }
2,946
nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::get_binary() const
monkey531[P]llama/common/json.hpp
const binary_t& get_binary() const { if (!is_binary()) { JSON_THROW(type_error::create(302, detail::concat("type must be binary, but is ", type_name()), this)); } return *get_ptr<const binary_t*>(); }
O2
cpp
nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::get_binary() const: pushq %rbp pushq %r14 pushq %rbx subq $0x30, %rsp movq %rdi, %r14 cmpb $0x8, (%rdi) jne 0x9f5f7 movq 0x8(%r14), %rax addq $0x30, %rsp popq %rbx popq %r14 popq %rbp retq pushq $0x20 popq %rdi callq 0x265e0 movq %rax, %rbx movq %r14, %rdi callq 0x6ad6a leaq 0x8(%rsp), %rdx movq %rax, (%rdx) leaq 0x3408a(%rip), %rsi # 0xd36a3 leaq 0x10(%rsp), %rdi callq 0x7faff movb $0x1, %bpl leaq 0x10(%rsp), %rdx movq %rbx, %rdi movl $0x12e, %esi # imm = 0x12E movq %r14, %rcx callq 0x7fa12 xorl %ebp, %ebp leaq 0x80b64(%rip), %rsi # 0x1201a8 leaq -0x37bc9(%rip), %rdx # 0x67a82 movq %rbx, %rdi callq 0x275b0 movq %rax, %r14 leaq 0x10(%rsp), %rdi callq 0x27998 testb %bpl, %bpl jne 0x9f66a jmp 0x9f672 movq %rax, %r14 movq %rbx, %rdi callq 0x268f0 movq %r14, %rdi callq 0x27660
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE10get_binaryEv: push rbp; char push r14; int push rbx; int sub rsp, 30h mov r14, rdi cmp byte ptr [rdi], 8 jnz short loc_9F5F7 mov rax, [r14+8] add rsp, 30h pop rbx pop r14 pop rbp retn loc_9F5F7: push 20h ; ' ' pop rdi; thrown_size call ___cxa_allocate_exception mov rbx, rax mov rdi, r14 call _ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE9type_nameEv; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::type_name(void) lea rdx, [rsp+48h+var_40] mov [rdx], rax lea rsi, aTypeMustBeBina; "type must be binary, but is " lea rdi, [rsp+48h+var_38] call _ZN8nlohmann16json_abi_v3_11_36detail6concatINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJRA29_KcPS9_EEET_DpOT0_; nlohmann::json_abi_v3_11_3::detail::concat<std::string,char const(&)[29],char const*>(char const(&)[29],char const* &&) mov bpl, 1 lea rdx, [rsp+48h+var_38] mov rdi, rbx; this mov esi, 12Eh; int mov rcx, r14 call _ZN8nlohmann16json_abi_v3_11_36detail10type_error6createIPKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES6_IhSaIhEEvEETnNSt9enable_ifIXsr21is_basic_json_contextIT_EE5valueEiE4typeELi0EEES2_iRKSC_SK_ xor ebp, ebp lea rsi, _ZTIN8nlohmann16json_abi_v3_11_36detail10type_errorE; lptinfo lea rdx, _ZN8nlohmann16json_abi_v3_11_36detail9exceptionD2Ev; void (*)(void *) mov rdi, rbx; void * call ___cxa_throw mov r14, rax lea rdi, [rsp+48h+var_38]; void * call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() test bpl, bpl jnz short loc_9F66A jmp short loc_9F672 mov r14, rax loc_9F66A: mov rdi, rbx; void * call ___cxa_free_exception loc_9F672: mov rdi, r14 call __Unwind_Resume
long long nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::get_binary( long long a1) { nlohmann::json_abi_v3_11_3::detail::type_error *exception; // rbx const char *v3; // [rsp+8h] [rbp-40h] BYREF _BYTE v4[56]; // [rsp+10h] [rbp-38h] BYREF if ( *(_BYTE *)a1 != 8 ) { exception = (nlohmann::json_abi_v3_11_3::detail::type_error *)__cxa_allocate_exception(0x20uLL); v3 = nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::type_name((unsigned __int8 *)a1); nlohmann::json_abi_v3_11_3::detail::concat<std::string,char const(&)[29],char const*>( (long long)v4, (long long)"type must be binary, but is ", &v3); ZN8nlohmann16json_abi_v3_11_36detail10type_error6createIPKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES6_IhSaIhEEvEETnNSt9enable_ifIXsr21is_basic_json_contextIT_EE5valueEiE4typeELi0EEES2_iRKSC_SK_( exception, 302, (long long)v4); __cxa_throw( exception, (struct type_info *)&`typeinfo for'nlohmann::json_abi_v3_11_3::detail::type_error, (void (*)(void *))nlohmann::json_abi_v3_11_3::detail::exception::~exception); } return *(_QWORD *)(a1 + 8); }
get_binary: PUSH RBP PUSH R14 PUSH RBX SUB RSP,0x30 MOV R14,RDI CMP byte ptr [RDI],0x8 JNZ 0x0019f5f7 MOV RAX,qword ptr [R14 + 0x8] ADD RSP,0x30 POP RBX POP R14 POP RBP RET LAB_0019f5f7: PUSH 0x20 POP RDI CALL 0x001265e0 MOV RBX,RAX MOV RDI,R14 CALL 0x0016ad6a LEA RDX,[RSP + 0x8] MOV qword ptr [RDX],RAX LAB_0019f612: LEA RSI,[0x1d36a3] LEA RDI,[RSP + 0x10] CALL 0x0017faff MOV BPL,0x1 LAB_0019f626: LEA RDX,[RSP + 0x10] MOV RDI,RBX MOV ESI,0x12e MOV RCX,R14 CALL 0x0017fa12 XOR EBP,EBP LEA RSI,[0x2201a8] LEA RDX,[0x167a82] MOV RDI,RBX CALL 0x001275b0
/* nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map, std::vector, std::__cxx11::string, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> >, void>::get_binary() const */ int8 __thiscall nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::get_binary(basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> *this) { int8 uVar1; char *local_40; detail local_38 [32]; if (*this == (basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> )0x8) { return *(int8 *)(this + 8); } uVar1 = __cxa_allocate_exception(0x20); local_40 = (char *)type_name(this); /* try { // try from 0019f612 to 0019f622 has its CatchHandler @ 0019f667 */ detail::concat<std::__cxx11::string,char_const(&)[29],char_const*> (local_38,"type must be binary, but is ",&local_40); /* try { // try from 0019f626 to 0019f652 has its CatchHandler @ 0019f653 */ _ZN8nlohmann16json_abi_v3_11_36detail10type_error6createIPKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES6_IhSaIhEEvEETnNSt9enable_ifIXsr21is_basic_json_contextIT_EE5valueEiE4typeELi0EEES2_iRKSC_SK_ (uVar1,0x12e,local_38,this); /* WARNING: Subroutine does not return */ __cxa_throw(uVar1,&detail::type_error::typeinfo,detail::exception::~exception); }
2,947
sanitize_cond(PFS_cond*)
eloqsql/storage/perfschema/pfs_instr.cc
PFS_cond *sanitize_cond(PFS_cond *unsafe) { return global_cond_container.sanitize(unsafe); }
O3
cpp
sanitize_cond(PFS_cond*): pushq %rbp movq %rsp, %rbp movq %rdi, %rax xorl %ecx, %ecx leaq 0x35d1b4(%rip), %rdx # 0x393fa8 movq 0xa8(%rdx,%rcx,8), %rdi testq %rdi, %rdi je 0x36e24 movq 0x48(%rdi), %rsi cmpq %rax, %rsi ja 0x36e24 movq 0x50(%rdi), %rdi shlq $0x6, %rdi addq %rsi, %rdi cmpq %rax, %rdi jbe 0x36e24 movl %eax, %edi subl %esi, %edi testb $0x3f, %dil je 0x36e32 incq %rcx cmpq $0x100, %rcx # imm = 0x100 jne 0x36df4 xorl %eax, %eax popq %rbp retq
_Z13sanitize_condP8PFS_cond: push rbp mov rbp, rsp mov rax, rdi xor ecx, ecx lea rdx, global_cond_container loc_36DF4: mov rdi, [rdx+rcx*8+0A8h] test rdi, rdi jz short loc_36E24 mov rsi, [rdi+48h] cmp rsi, rax ja short loc_36E24 mov rdi, [rdi+50h] shl rdi, 6 add rdi, rsi cmp rdi, rax jbe short loc_36E24 mov edi, eax sub edi, esi test dil, 3Fh jz short loc_36E32 loc_36E24: inc rcx cmp rcx, 100h jnz short loc_36DF4 xor eax, eax loc_36E32: pop rbp retn
unsigned long long sanitize_cond(unsigned long long a1) { unsigned long long result; // rax long long v2; // rcx long long v3; // rdi unsigned long long v4; // rsi result = a1; v2 = 0LL; while ( 1 ) { v3 = global_cond_container[v2 + 21]; if ( v3 ) { v4 = *(_QWORD *)(v3 + 72); if ( v4 <= result && v4 + (*(_QWORD *)(v3 + 80) << 6) > result && (((_BYTE)result - (_BYTE)v4) & 0x3F) == 0 ) break; } if ( ++v2 == 256 ) return 0LL; } return result; }
sanitize_cond: PUSH RBP MOV RBP,RSP MOV RAX,RDI XOR ECX,ECX LEA RDX,[0x493fa8] LAB_00136df4: MOV RDI,qword ptr [RDX + RCX*0x8 + 0xa8] TEST RDI,RDI JZ 0x00136e24 MOV RSI,qword ptr [RDI + 0x48] CMP RSI,RAX JA 0x00136e24 MOV RDI,qword ptr [RDI + 0x50] SHL RDI,0x6 ADD RDI,RSI CMP RDI,RAX JBE 0x00136e24 MOV EDI,EAX SUB EDI,ESI TEST DIL,0x3f JZ 0x00136e32 LAB_00136e24: INC RCX CMP RCX,0x100 JNZ 0x00136df4 XOR EAX,EAX LAB_00136e32: POP RBP RET
/* sanitize_cond(PFS_cond*) */ PFS_cond * sanitize_cond(PFS_cond *param_1) { long lVar1; PFS_cond *pPVar2; long lVar3; lVar3 = 0; while( true ) { lVar1 = *(long *)(global_cond_container + lVar3 * 8 + 0xa8); if ((((lVar1 != 0) && (pPVar2 = *(PFS_cond **)(lVar1 + 0x48), pPVar2 <= param_1)) && (param_1 < pPVar2 + *(long *)(lVar1 + 0x50) * 0x40)) && (((int)param_1 - (int)pPVar2 & 0x3fU) == 0)) break; lVar3 = lVar3 + 1; if (lVar3 == 0x100) { return (PFS_cond *)0x0; } } return param_1; }
2,948
httplib::detail::read_socket(int, void*, unsigned long, int)::'lambda'()::operator()() const
hkr04[P]cpp-mcp/common/httplib.h
inline ssize_t read_socket(socket_t sock, void *ptr, size_t size, int flags) { return handle_EINTR([&]() { return recv(sock, #ifdef _WIN32 static_cast<char *>(ptr), static_cast<int>(size), #else ptr, size, #endif flags); }); }
O2
c
httplib::detail::read_socket(int, void*, unsigned long, int)::'lambda'()::operator()() const: movq (%rdi), %rax movq 0x8(%rdi), %rcx movl (%rax), %eax movq (%rcx), %rsi movq 0x10(%rdi), %rcx movq (%rcx), %rdx movq 0x18(%rdi), %rcx movl (%rcx), %ecx movl %eax, %edi jmp 0xa1f0
_ZZN7httplib6detail11read_socketEiPvmiENKUlvE_clEv: mov rax, [rdi] mov rcx, [rdi+8] mov eax, [rax] mov rsi, [rcx] mov rcx, [rdi+10h] mov rdx, [rcx] mov rcx, [rdi+18h] mov ecx, [rcx] mov edi, eax jmp _recv
long long httplib::detail::read_socket(int,void *,unsigned long,int)::{lambda(void)#1}::operator()( unsigned int **a1) { return recv(**a1, *(_QWORD *)a1[1], *(_QWORD *)a1[2], *a1[3]); }
operator(): MOV RAX,qword ptr [RDI] MOV RCX,qword ptr [RDI + 0x8] MOV EAX,dword ptr [RAX] MOV RSI,qword ptr [RCX] MOV RCX,qword ptr [RDI + 0x10] MOV RDX,qword ptr [RCX] MOV RCX,qword ptr [RDI + 0x18] MOV ECX,dword ptr [RCX] MOV EDI,EAX JMP 0x0010a1f0
/* httplib::detail::read_socket(int, void*, unsigned long, int)::{lambda()#1}::TEMPNAMEPLACEHOLDERVALUE() const */ void __thiscall httplib::detail::read_socket(int,void*,unsigned_long,int)::{lambda()#1}::operator() (_lambda___1_ *this) { recv(**(int **)this,(void *)**(int8 **)(this + 8),**(size_t **)(this + 0x10), **(int **)(this + 0x18)); return; }
2,949
my_strcasecmp_utf8mb4
eloqsql/strings/ctype-utf8.c
static int my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) { MY_UNICASE_INFO *uni_plane= cs->caseinfo; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; if ((uchar) s[0] < 128) { /* s[0] is between 0 and 127. It represents a single byte character. Convert it into weight according to collation. */ s_wc= my_unicase_default_page00[(uchar) s[0]].tolower; s++; } else { int res= my_mb_wc_utf8mb4_no_range(cs, &s_wc, (const uchar*) s); /* In the case of wrong multibyte sequence we will call strcmp() for byte-to-byte comparison. */ if (res <= 0) return strcmp(s, t); s+= res; my_tolower_utf8mb4(uni_plane, &s_wc); } /* Do the same for the second string */ if ((uchar) t[0] < 128) { /* Convert single byte character into weight */ t_wc= my_unicase_default_page00[(uchar) t[0]].tolower; t++; } else { int res= my_mb_wc_utf8mb4_no_range(cs, &t_wc, (const uchar*) t); if (res <= 0) return strcmp(s, t); t+= res; my_tolower_utf8mb4(uni_plane, &t_wc); } /* Now we have two weights, let's compare them */ if ( s_wc != t_wc ) return ((int) s_wc) - ((int) t_wc); } return ((int) (uchar) s[0]) - ((int) (uchar) t[0]); }
O3
c
my_strcasecmp_utf8mb4: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rdx, %rbx movb (%rsi), %al testb %al, %al je 0x75abd movq %rsi, %r14 movq 0x78(%rdi), %r15 leaq 0x2f9d78(%rip), %r12 # 0x36f760 cmpb $0x0, (%rbx) je 0x75ab7 testb %al, %al js 0x75a0a movzbl %al, %eax leaq (%rax,%rax,2), %rax movl 0x4(%r12,%rax,4), %r13d movq %r13, -0x30(%rbp) incq %r14 jmp 0x75a51 leaq -0x30(%rbp), %rdi movq %r14, %rsi callq 0x75577 testl %eax, %eax je 0x75add movl %eax, %eax addq %rax, %r14 movq -0x30(%rbp), %r13 cmpq (%r15), %r13 ja 0x75a51 movq 0x8(%r15), %rax movq %r13, %rcx shrq $0x8, %rcx movq (%rax,%rcx,8), %rax testq %rax, %rax je 0x75a51 movzbl %r13b, %ecx leaq (%rcx,%rcx,2), %rcx movl 0x4(%rax,%rcx,4), %r13d movq %r13, -0x30(%rbp) movsbq (%rbx), %rax testq %rax, %rax js 0x75a68 leaq (%rax,%rax,2), %rax movl 0x4(%r12,%rax,4), %eax incq %rbx jmp 0x75aa5 leaq -0x38(%rbp), %rdi movq %rbx, %rsi callq 0x75577 testl %eax, %eax je 0x75add movl %eax, %eax addq %rax, %rbx movq -0x38(%rbp), %rax cmpq (%r15), %rax ja 0x75aa5 movq 0x8(%r15), %rcx movq %rax, %rdx shrq $0x8, %rdx movq (%rcx,%rdx,8), %rcx testq %rcx, %rcx je 0x75aa5 movzbl %al, %eax leaq (%rax,%rax,2), %rax movl 0x4(%rcx,%rax,4), %eax cmpq %rax, %r13 jne 0x75ad8 movb (%r14), %al testb %al, %al jne 0x759e8 xorl %eax, %eax movzbl %al, %r13d jmp 0x75ac0 xorl %r13d, %r13d movzbl (%rbx), %eax subl %eax, %r13d movl %r13d, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq subl %eax, %r13d jmp 0x75ac6 movq %r14, %rdi movq %rbx, %rsi callq 0x26490 movl %eax, %r13d jmp 0x75ac6
my_strcasecmp_utf8mb4: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 18h mov rbx, rdx mov al, [rsi] test al, al jz loc_75ABD mov r14, rsi mov r15, [rdi+78h] lea r12, my_unicase_default_page00 loc_759E8: cmp byte ptr [rbx], 0 jz loc_75AB7 test al, al js short loc_75A0A movzx eax, al lea rax, [rax+rax*2] mov r13d, [r12+rax*4+4] mov [rbp+var_30], r13 inc r14 jmp short loc_75A51 loc_75A0A: lea rdi, [rbp+var_30] mov rsi, r14 call my_mb_wc_utf8mb4_no_range test eax, eax jz loc_75ADD mov eax, eax add r14, rax mov r13, [rbp+var_30] cmp r13, [r15] ja short loc_75A51 mov rax, [r15+8] mov rcx, r13 shr rcx, 8 mov rax, [rax+rcx*8] test rax, rax jz short loc_75A51 movzx ecx, r13b lea rcx, [rcx+rcx*2] mov r13d, [rax+rcx*4+4] mov [rbp+var_30], r13 loc_75A51: movsx rax, byte ptr [rbx] test rax, rax js short loc_75A68 lea rax, [rax+rax*2] mov eax, [r12+rax*4+4] inc rbx jmp short loc_75AA5 loc_75A68: lea rdi, [rbp+var_38] mov rsi, rbx call my_mb_wc_utf8mb4_no_range test eax, eax jz short loc_75ADD mov eax, eax add rbx, rax mov rax, [rbp+var_38] cmp rax, [r15] ja short loc_75AA5 mov rcx, [r15+8] mov rdx, rax shr rdx, 8 mov rcx, [rcx+rdx*8] test rcx, rcx jz short loc_75AA5 movzx eax, al lea rax, [rax+rax*2] mov eax, [rcx+rax*4+4] loc_75AA5: cmp r13, rax jnz short loc_75AD8 mov al, [r14] test al, al jnz loc_759E8 xor eax, eax loc_75AB7: movzx r13d, al jmp short loc_75AC0 loc_75ABD: xor r13d, r13d loc_75AC0: movzx eax, byte ptr [rbx] sub r13d, eax loc_75AC6: mov eax, r13d add rsp, 18h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_75AD8: sub r13d, eax jmp short loc_75AC6 loc_75ADD: mov rdi, r14 mov rsi, rbx call _strcmp mov r13d, eax jmp short loc_75AC6
long long my_strcasecmp_utf8mb4(long long a1, unsigned __int8 *a2, unsigned __int8 *a3) { unsigned __int8 v4; // al unsigned __int8 *v5; // r14 _QWORD *v6; // r15 unsigned long long v7; // r13 unsigned int v8; // eax long long v9; // rax long long v10; // rax unsigned long long v11; // rax unsigned int v12; // eax long long v13; // rcx int v14; // r13d unsigned long long v17; // [rsp+8h] [rbp-38h] BYREF unsigned long long v18[6]; // [rsp+10h] [rbp-30h] BYREF v4 = *a2; if ( *a2 ) { v5 = a2; v6 = *(_QWORD **)(a1 + 120); while ( 1 ) { if ( !*a3 ) goto LABEL_19; if ( (v4 & 0x80u) != 0 ) { v8 = my_mb_wc_utf8mb4_no_range(v18, v5); if ( !v8 ) return (unsigned int)strcmp(v5, a3); v5 += v8; v7 = v18[0]; if ( v18[0] <= *v6 ) { v9 = *(_QWORD *)(v6[1] + 8 * (v18[0] >> 8)); if ( v9 ) { v7 = *(unsigned int *)(v9 + 12LL * LOBYTE(v18[0]) + 4); v18[0] = v7; } } } else { v7 = (unsigned int)my_unicase_default_page00[3 * v4 + 1]; v18[0] = v7; ++v5; } v10 = (char)*a3; if ( v10 < 0 ) { v12 = my_mb_wc_utf8mb4_no_range(&v17, a3); if ( !v12 ) return (unsigned int)strcmp(v5, a3); a3 += v12; v11 = v17; if ( v17 <= *v6 ) { v13 = *(_QWORD *)(v6[1] + 8 * (v17 >> 8)); if ( v13 ) v11 = *(unsigned int *)(v13 + 12LL * (unsigned __int8)v17 + 4); } } else { v11 = (unsigned int)my_unicase_default_page00[3 * v10 + 1]; ++a3; } if ( v7 != v11 ) return (unsigned int)(v7 - v11); v4 = *v5; if ( !*v5 ) { v4 = 0; LABEL_19: v14 = v4; return (unsigned int)(v14 - *a3); } } } v14 = 0; return (unsigned int)(v14 - *a3); }
my_strcasecmp_utf8mb4: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x18 MOV RBX,RDX MOV AL,byte ptr [RSI] TEST AL,AL JZ 0x00175abd MOV R14,RSI MOV R15,qword ptr [RDI + 0x78] LEA R12,[0x46f760] LAB_001759e8: CMP byte ptr [RBX],0x0 JZ 0x00175ab7 TEST AL,AL JS 0x00175a0a MOVZX EAX,AL LEA RAX,[RAX + RAX*0x2] MOV R13D,dword ptr [R12 + RAX*0x4 + 0x4] MOV qword ptr [RBP + -0x30],R13 INC R14 JMP 0x00175a51 LAB_00175a0a: LEA RDI,[RBP + -0x30] MOV RSI,R14 CALL 0x00175577 TEST EAX,EAX JZ 0x00175add MOV EAX,EAX ADD R14,RAX MOV R13,qword ptr [RBP + -0x30] CMP R13,qword ptr [R15] JA 0x00175a51 MOV RAX,qword ptr [R15 + 0x8] MOV RCX,R13 SHR RCX,0x8 MOV RAX,qword ptr [RAX + RCX*0x8] TEST RAX,RAX JZ 0x00175a51 MOVZX ECX,R13B LEA RCX,[RCX + RCX*0x2] MOV R13D,dword ptr [RAX + RCX*0x4 + 0x4] MOV qword ptr [RBP + -0x30],R13 LAB_00175a51: MOVSX RAX,byte ptr [RBX] TEST RAX,RAX JS 0x00175a68 LEA RAX,[RAX + RAX*0x2] MOV EAX,dword ptr [R12 + RAX*0x4 + 0x4] INC RBX JMP 0x00175aa5 LAB_00175a68: LEA RDI,[RBP + -0x38] MOV RSI,RBX CALL 0x00175577 TEST EAX,EAX JZ 0x00175add MOV EAX,EAX ADD RBX,RAX MOV RAX,qword ptr [RBP + -0x38] CMP RAX,qword ptr [R15] JA 0x00175aa5 MOV RCX,qword ptr [R15 + 0x8] MOV RDX,RAX SHR RDX,0x8 MOV RCX,qword ptr [RCX + RDX*0x8] TEST RCX,RCX JZ 0x00175aa5 MOVZX EAX,AL LEA RAX,[RAX + RAX*0x2] MOV EAX,dword ptr [RCX + RAX*0x4 + 0x4] LAB_00175aa5: CMP R13,RAX JNZ 0x00175ad8 MOV AL,byte ptr [R14] TEST AL,AL JNZ 0x001759e8 XOR EAX,EAX LAB_00175ab7: MOVZX R13D,AL JMP 0x00175ac0 LAB_00175abd: XOR R13D,R13D LAB_00175ac0: MOVZX EAX,byte ptr [RBX] SUB R13D,EAX LAB_00175ac6: MOV EAX,R13D ADD RSP,0x18 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_00175ad8: SUB R13D,EAX JMP 0x00175ac6 LAB_00175add: MOV RDI,R14 MOV RSI,RBX CALL 0x00126490 MOV R13D,EAX JMP 0x00175ac6
int my_strcasecmp_utf8mb4(long param_1,byte *param_2,byte *param_3) { ulong *puVar1; long lVar2; ulong uVar3; byte bVar4; uint uVar5; int iVar6; ulong uVar7; ulong local_40; ulong local_38; bVar4 = *param_2; if (bVar4 == 0) { uVar5 = 0; } else { puVar1 = *(ulong **)(param_1 + 0x78); do { if (*param_3 == 0) goto LAB_00175ab7; if ((char)bVar4 < '\0') { uVar5 = my_mb_wc_utf8mb4_no_range(&local_38,param_2); if (uVar5 == 0) goto LAB_00175add; param_2 = param_2 + uVar5; if ((local_38 <= *puVar1) && (lVar2 = *(long *)(puVar1[1] + (local_38 >> 8) * 8), lVar2 != 0)) { local_38 = (ulong)*(uint *)(lVar2 + 4 + (local_38 & 0xff) * 0xc); } } else { local_38 = (ulong)*(uint *)(my_unicase_default_page00 + (ulong)bVar4 * 0xc + 4); param_2 = param_2 + 1; } uVar3 = local_38; bVar4 = *param_3; if ((long)(char)bVar4 < 0) { uVar5 = my_mb_wc_utf8mb4_no_range(&local_40,param_3); if (uVar5 == 0) { LAB_00175add: iVar6 = strcmp((char *)param_2,(char *)param_3); return iVar6; } param_3 = param_3 + uVar5; uVar7 = local_40; if ((local_40 <= *puVar1) && (lVar2 = *(long *)(puVar1[1] + (local_40 >> 8) * 8), lVar2 != 0)) { uVar7 = (ulong)*(uint *)(lVar2 + 4 + (local_40 & 0xff) * 0xc); } } else { param_3 = param_3 + 1; uVar7 = (ulong)*(uint *)(my_unicase_default_page00 + (long)(char)bVar4 * 0xc + 4); } if (uVar3 != uVar7) { return (int)uVar3 - (int)uVar7; } bVar4 = *param_2; } while (bVar4 != 0); bVar4 = 0; LAB_00175ab7: uVar5 = (uint)bVar4; } return uVar5 - *param_3; }
2,950
add_compiled_collation
eloqsql/mysys/charset.c
void add_compiled_collation(struct charset_info_st *cs) { DBUG_ASSERT(cs->number < array_elements(all_charsets)); all_charsets[cs->number]= cs; cs->state|= MY_CS_AVAILABLE; if ((my_hash_insert(&charset_name_hash, (uchar*) cs))) { #ifndef DBUG_OFF CHARSET_INFO *org= (CHARSET_INFO*) my_hash_search(&charset_name_hash, (uchar*) cs->cs_name.str, cs->cs_name.length); DBUG_ASSERT(org); DBUG_ASSERT(org->cs_name.str == cs->cs_name.str); DBUG_ASSERT(org->cs_name.length == strlen(cs->cs_name.str)); #endif } }
O3
c
add_compiled_collation: pushq %rbp movq %rsp, %rbp movq %rdi, %rsi movl (%rdi), %eax leaq 0xb7af1b(%rip), %rcx # 0xc27fb0 movq %rdi, (%rcx,%rax,8) orb $0x2, 0xd(%rdi) leaq 0xb7ef0c(%rip), %rdi # 0xc2bfb0 popq %rbp jmp 0xaf64e
add_compiled_collation: push rbp mov rbp, rsp mov rsi, rdi mov eax, [rdi] lea rcx, all_charsets mov [rcx+rax*8], rdi or byte ptr [rdi+0Dh], 2 lea rdi, charset_name_hash pop rbp jmp my_hash_insert
long long add_compiled_collation(unsigned int *a1) { all_charsets[*a1] = a1; *((_BYTE *)a1 + 13) |= 2u; return my_hash_insert(&charset_name_hash, a1); }
add_compiled_collation: PUSH RBP MOV RBP,RSP MOV RSI,RDI MOV EAX,dword ptr [RDI] LEA RCX,[0xd27fb0] MOV qword ptr [RCX + RAX*0x8],RDI OR byte ptr [RDI + 0xd],0x2 LEA RDI,[0xd2bfb0] POP RBP JMP 0x001af64e
void add_compiled_collation(uint *param_1) { (&all_charsets)[*param_1] = param_1; *(byte *)((long)param_1 + 0xd) = *(byte *)((long)param_1 + 0xd) | 2; my_hash_insert(charset_name_hash,param_1); return; }
2,951
async_func_init
bluesky950520[P]quickjs/quickjs.c
static __exception int async_func_init(JSContext *ctx, JSAsyncFunctionState *s, JSValue func_obj, JSValue this_obj, int argc, JSValue *argv) { JSObject *p; JSFunctionBytecode *b; JSStackFrame *sf; int local_count, i, arg_buf_len, n; sf = &s->frame; init_list_head(&sf->var_ref_list); p = JS_VALUE_GET_OBJ(func_obj); b = p->u.func.function_bytecode; sf->is_strict_mode = b->is_strict_mode; sf->cur_pc = b->byte_code_buf; arg_buf_len = max_int(b->arg_count, argc); local_count = arg_buf_len + b->var_count + b->stack_size; sf->arg_buf = js_malloc(ctx, sizeof(JSValue) * max_int(local_count, 1)); if (!sf->arg_buf) return -1; sf->cur_func = js_dup(func_obj); s->this_val = js_dup(this_obj); s->argc = argc; sf->arg_count = arg_buf_len; sf->var_buf = sf->arg_buf + arg_buf_len; sf->cur_sp = sf->var_buf + b->var_count; for(i = 0; i < argc; i++) sf->arg_buf[i] = js_dup(argv[i]); n = arg_buf_len + b->var_count; for(i = argc; i < n; i++) sf->arg_buf[i] = JS_UNDEFINED; return 0; }
O0
c
async_func_init: subq $0xc8, %rsp movq 0xd8(%rsp), %rax movl 0xd0(%rsp), %eax movq %rdx, 0xb0(%rsp) movq %rcx, 0xb8(%rsp) movq %r8, 0xa0(%rsp) movq %r9, 0xa8(%rsp) movq %rdi, 0x98(%rsp) movq %rsi, 0x90(%rsp) movq 0x90(%rsp), %rax addq $0x18, %rax movq %rax, 0x78(%rsp) movq 0x78(%rsp), %rdi addq $0x28, %rdi callq 0x22390 movq 0xb0(%rsp), %rax movq %rax, 0x88(%rsp) movq 0x88(%rsp), %rax movq 0x30(%rax), %rax movq %rax, 0x80(%rsp) movq 0x80(%rsp), %rax movw 0x18(%rax), %ax andw $0x1, %ax movzbl %al, %edx movq 0x78(%rsp), %rax movl 0x40(%rax), %ecx andl $0x1, %edx shll $0x1f, %edx andl $0x7fffffff, %ecx # imm = 0x7FFFFFFF orl %edx, %ecx movl %ecx, 0x40(%rax) movq 0x80(%rsp), %rax movq 0x20(%rax), %rcx movq 0x78(%rsp), %rax movq %rcx, 0x38(%rax) movq 0x80(%rsp), %rax movzwl 0x40(%rax), %edi movl 0xd0(%rsp), %esi callq 0x5d310 movl %eax, 0x6c(%rsp) movl 0x6c(%rsp), %eax movq 0x80(%rsp), %rcx movzwl 0x42(%rcx), %ecx addl %ecx, %eax movq 0x80(%rsp), %rcx movzwl 0x46(%rcx), %ecx addl %ecx, %eax movl %eax, 0x74(%rsp) movq 0x98(%rsp), %rax movq %rax, 0x20(%rsp) movl 0x74(%rsp), %edi movl $0x1, %esi callq 0x5d310 movq 0x20(%rsp), %rdi movslq %eax, %rsi shlq $0x4, %rsi callq 0x21cb0 movq %rax, %rcx movq 0x78(%rsp), %rax movq %rcx, 0x18(%rax) movq 0x78(%rsp), %rax cmpq $0x0, 0x18(%rax) jne 0x7210e movl $0xffffffff, 0xc4(%rsp) # imm = 0xFFFFFFFF jmp 0x72303 movq 0x78(%rsp), %rax movq %rax, 0x10(%rsp) movq 0xb0(%rsp), %rdi movq 0xb8(%rsp), %rsi callq 0x216d0 movq %rax, %rcx movq 0x10(%rsp), %rax movq %rcx, 0x58(%rsp) movq %rdx, 0x60(%rsp) movq 0x58(%rsp), %rcx movq %rcx, 0x8(%rax) movq 0x60(%rsp), %rcx movq %rcx, 0x10(%rax) movq 0x90(%rsp), %rax movq %rax, 0x18(%rsp) movq 0xa0(%rsp), %rdi movq 0xa8(%rsp), %rsi callq 0x216d0 movq %rax, %rcx movq 0x18(%rsp), %rax movq %rcx, 0x48(%rsp) movq %rdx, 0x50(%rsp) movq 0x48(%rsp), %rcx movq %rcx, (%rax) movq 0x50(%rsp), %rcx movq %rcx, 0x8(%rax) movl 0xd0(%rsp), %ecx movq 0x90(%rsp), %rax movl %ecx, 0x10(%rax) movl 0x6c(%rsp), %edx movq 0x78(%rsp), %rax movl 0x40(%rax), %ecx andl $0x7fffffff, %edx # imm = 0x7FFFFFFF andl $0x80000000, %ecx # imm = 0x80000000 orl %edx, %ecx movl %ecx, 0x40(%rax) movq 0x78(%rsp), %rax movq 0x18(%rax), %rcx movslq 0x6c(%rsp), %rax shlq $0x4, %rax addq %rax, %rcx movq 0x78(%rsp), %rax movq %rcx, 0x20(%rax) movq 0x78(%rsp), %rax movq 0x20(%rax), %rcx movq 0x80(%rsp), %rax movzwl 0x42(%rax), %eax cltq shlq $0x4, %rax addq %rax, %rcx movq 0x78(%rsp), %rax movq %rcx, 0x48(%rax) movl $0x0, 0x70(%rsp) movl 0x70(%rsp), %eax cmpl 0xd0(%rsp), %eax jge 0x72289 movq 0x78(%rsp), %rax movq 0x18(%rax), %rax movslq 0x70(%rsp), %rcx shlq $0x4, %rcx addq %rcx, %rax movq %rax, 0x8(%rsp) movq 0xd8(%rsp), %rax movslq 0x70(%rsp), %rcx shlq $0x4, %rcx addq %rcx, %rax movq (%rax), %rdi movq 0x8(%rax), %rsi callq 0x216d0 movq %rax, %rcx movq 0x8(%rsp), %rax movq %rcx, 0x38(%rsp) movq %rdx, 0x40(%rsp) movq 0x38(%rsp), %rcx movq %rcx, (%rax) movq 0x40(%rsp), %rcx movq %rcx, 0x8(%rax) movl 0x70(%rsp), %eax addl $0x1, %eax movl %eax, 0x70(%rsp) jmp 0x72212 movl 0x6c(%rsp), %eax movq 0x80(%rsp), %rcx movzwl 0x42(%rcx), %ecx addl %ecx, %eax movl %eax, 0x68(%rsp) movl 0xd0(%rsp), %eax movl %eax, 0x70(%rsp) movl 0x70(%rsp), %eax cmpl 0x68(%rsp), %eax jge 0x722f8 movq 0x78(%rsp), %rax movq 0x18(%rax), %rax movslq 0x70(%rsp), %rcx shlq $0x4, %rcx addq %rcx, %rax movl $0x0, 0x28(%rsp) movq $0x3, 0x30(%rsp) movq 0x28(%rsp), %rcx movq %rcx, (%rax) movq 0x30(%rsp), %rcx movq %rcx, 0x8(%rax) movl 0x70(%rsp), %eax addl $0x1, %eax movl %eax, 0x70(%rsp) jmp 0x722aa movl $0x0, 0xc4(%rsp) movl 0xc4(%rsp), %eax addq $0xc8, %rsp retq nopw %cs:(%rax,%rax)
async_func_init: sub rsp, 0C8h mov rax, [rsp+0C8h+arg_8] mov eax, [rsp+0C8h+arg_0] mov [rsp+0C8h+var_18], rdx mov [rsp+0C8h+var_10], rcx mov [rsp+0C8h+var_28], r8 mov [rsp+0C8h+var_20], r9 mov [rsp+0C8h+var_30], rdi mov [rsp+0C8h+var_38], rsi mov rax, [rsp+0C8h+var_38] add rax, 18h mov [rsp+0C8h+var_50], rax mov rdi, [rsp+0C8h+var_50] add rdi, 28h ; '(' call init_list_head_0 mov rax, [rsp+0C8h+var_18] mov [rsp+0C8h+var_40], rax mov rax, [rsp+0C8h+var_40] mov rax, [rax+30h] mov [rsp+0C8h+var_48], rax mov rax, [rsp+0C8h+var_48] mov ax, [rax+18h] and ax, 1 movzx edx, al mov rax, [rsp+0C8h+var_50] mov ecx, [rax+40h] and edx, 1 shl edx, 1Fh and ecx, 7FFFFFFFh or ecx, edx mov [rax+40h], ecx mov rax, [rsp+0C8h+var_48] mov rcx, [rax+20h] mov rax, [rsp+0C8h+var_50] mov [rax+38h], rcx mov rax, [rsp+0C8h+var_48] movzx edi, word ptr [rax+40h] mov esi, [rsp+0C8h+arg_0] call max_int_0 mov [rsp+0C8h+var_5C], eax mov eax, [rsp+0C8h+var_5C] mov rcx, [rsp+0C8h+var_48] movzx ecx, word ptr [rcx+42h] add eax, ecx mov rcx, [rsp+0C8h+var_48] movzx ecx, word ptr [rcx+46h] add eax, ecx mov [rsp+0C8h+var_54], eax mov rax, [rsp+0C8h+var_30] mov [rsp+0C8h+var_A8], rax mov edi, [rsp+0C8h+var_54] mov esi, 1 call max_int_0 mov rdi, [rsp+0C8h+var_A8] movsxd rsi, eax shl rsi, 4 call js_malloc mov rcx, rax mov rax, [rsp+0C8h+var_50] mov [rax+18h], rcx mov rax, [rsp+0C8h+var_50] cmp qword ptr [rax+18h], 0 jnz short loc_7210E mov [rsp+0C8h+var_4], 0FFFFFFFFh jmp loc_72303 loc_7210E: mov rax, [rsp+0C8h+var_50] mov [rsp+0C8h+var_B8], rax mov rdi, [rsp+0C8h+var_18] mov rsi, [rsp+0C8h+var_10] call js_dup mov rcx, rax mov rax, [rsp+0C8h+var_B8] mov [rsp+0C8h+var_70], rcx mov [rsp+0C8h+var_68], rdx mov rcx, [rsp+0C8h+var_70] mov [rax+8], rcx mov rcx, [rsp+0C8h+var_68] mov [rax+10h], rcx mov rax, [rsp+0C8h+var_38] mov [rsp+0C8h+var_B0], rax mov rdi, [rsp+0C8h+var_28] mov rsi, [rsp+0C8h+var_20] call js_dup mov rcx, rax mov rax, [rsp+0C8h+var_B0] mov [rsp+0C8h+var_80], rcx mov [rsp+0C8h+var_78], rdx mov rcx, [rsp+0C8h+var_80] mov [rax], rcx mov rcx, [rsp+0C8h+var_78] mov [rax+8], rcx mov ecx, [rsp+0C8h+arg_0] mov rax, [rsp+0C8h+var_38] mov [rax+10h], ecx mov edx, [rsp+0C8h+var_5C] mov rax, [rsp+0C8h+var_50] mov ecx, [rax+40h] and edx, 7FFFFFFFh and ecx, 80000000h or ecx, edx mov [rax+40h], ecx mov rax, [rsp+0C8h+var_50] mov rcx, [rax+18h] movsxd rax, [rsp+0C8h+var_5C] shl rax, 4 add rcx, rax mov rax, [rsp+0C8h+var_50] mov [rax+20h], rcx mov rax, [rsp+0C8h+var_50] mov rcx, [rax+20h] mov rax, [rsp+0C8h+var_48] movzx eax, word ptr [rax+42h] cdqe shl rax, 4 add rcx, rax mov rax, [rsp+0C8h+var_50] mov [rax+48h], rcx mov [rsp+0C8h+var_58], 0 loc_72212: mov eax, [rsp+0C8h+var_58] cmp eax, [rsp+0C8h+arg_0] jge short loc_72289 mov rax, [rsp+0C8h+var_50] mov rax, [rax+18h] movsxd rcx, [rsp+0C8h+var_58] shl rcx, 4 add rax, rcx mov [rsp+0C8h+var_C0], rax mov rax, [rsp+0C8h+arg_8] movsxd rcx, [rsp+0C8h+var_58] shl rcx, 4 add rax, rcx mov rdi, [rax] mov rsi, [rax+8] call js_dup mov rcx, rax mov rax, [rsp+0C8h+var_C0] mov [rsp+0C8h+var_90], rcx mov [rsp+0C8h+var_88], rdx mov rcx, [rsp+0C8h+var_90] mov [rax], rcx mov rcx, [rsp+0C8h+var_88] mov [rax+8], rcx mov eax, [rsp+0C8h+var_58] add eax, 1 mov [rsp+0C8h+var_58], eax jmp short loc_72212 loc_72289: mov eax, [rsp+0C8h+var_5C] mov rcx, [rsp+0C8h+var_48] movzx ecx, word ptr [rcx+42h] add eax, ecx mov [rsp+0C8h+var_60], eax mov eax, [rsp+0C8h+arg_0] mov [rsp+0C8h+var_58], eax loc_722AA: mov eax, [rsp+0C8h+var_58] cmp eax, [rsp+0C8h+var_60] jge short loc_722F8 mov rax, [rsp+0C8h+var_50] mov rax, [rax+18h] movsxd rcx, [rsp+0C8h+var_58] shl rcx, 4 add rax, rcx mov dword ptr [rsp+0C8h+var_A0], 0 mov [rsp+0C8h+var_98], 3 mov rcx, [rsp+0C8h+var_A0] mov [rax], rcx mov rcx, [rsp+0C8h+var_98] mov [rax+8], rcx mov eax, [rsp+0C8h+var_58] add eax, 1 mov [rsp+0C8h+var_58], eax jmp short loc_722AA loc_722F8: mov [rsp+0C8h+var_4], 0 loc_72303: mov eax, [rsp+0C8h+var_4] add rsp, 0C8h retn
long long async_func_init( long long a1, long long a2, long long a3, unsigned int a4, _DWORD *a5, unsigned int a6, signed int a7, long long a8) { int v8; // eax long long v9; // rdx long long v10; // rdx long long v11; // rdx _QWORD *v12; // rax _QWORD *v14; // [rsp+8h] [rbp-C0h] long long v15; // [rsp+28h] [rbp-A0h] signed int v16; // [rsp+68h] [rbp-60h] int v17; // [rsp+6Ch] [rbp-5Ch] signed int i; // [rsp+70h] [rbp-58h] signed int j; // [rsp+70h] [rbp-58h] long long v20; // [rsp+80h] [rbp-48h] init_list_head_0((_QWORD *)(a2 + 64)); v20 = *(_QWORD *)(a3 + 48); *(_DWORD *)(a2 + 88) = ((*(_WORD *)(v20 + 24) & 1) << 31) | *(_DWORD *)(a2 + 88) & 0x7FFFFFFF; *(_QWORD *)(a2 + 80) = *(_QWORD *)(v20 + 32); v17 = max_int_0(*(unsigned __int16 *)(v20 + 64), a7); v8 = max_int_0(*(unsigned __int16 *)(v20 + 70) + (unsigned int)*(unsigned __int16 *)(v20 + 66) + v17, 1u); *(_QWORD *)(a2 + 48) = js_malloc(a1, 16LL * v8); if ( *(_QWORD *)(a2 + 48) ) { *(_QWORD *)(a2 + 32) = js_dup((_DWORD *)a3, a4); *(_QWORD *)(a2 + 40) = v9; *(_QWORD *)a2 = js_dup(a5, a6); *(_QWORD *)(a2 + 8) = v10; *(_DWORD *)(a2 + 16) = a7; *(_DWORD *)(a2 + 88) = v17 & 0x7FFFFFFF | *(_DWORD *)(a2 + 88) & 0x80000000; *(_QWORD *)(a2 + 56) = 16LL * v17 + *(_QWORD *)(a2 + 48); *(_QWORD *)(a2 + 96) = 16LL * *(unsigned __int16 *)(v20 + 66) + *(_QWORD *)(a2 + 56); for ( i = 0; i < a7; ++i ) { v14 = (_QWORD *)(16LL * i + *(_QWORD *)(a2 + 48)); *v14 = js_dup(*(_DWORD **)(16LL * i + a8), *(_QWORD *)(16LL * i + a8 + 8)); v14[1] = v11; } v16 = *(unsigned __int16 *)(v20 + 66) + v17; for ( j = a7; j < v16; ++j ) { v12 = (_QWORD *)(16LL * j + *(_QWORD *)(a2 + 48)); LODWORD(v15) = 0; *v12 = v15; v12[1] = 3LL; } return 0; } else { return (unsigned int)-1; } }
async_func_init: SUB RSP,0xc8 MOV RAX,qword ptr [RSP + 0xd8] MOV EAX,dword ptr [RSP + 0xd0] MOV qword ptr [RSP + 0xb0],RDX MOV qword ptr [RSP + 0xb8],RCX MOV qword ptr [RSP + 0xa0],R8 MOV qword ptr [RSP + 0xa8],R9 MOV qword ptr [RSP + 0x98],RDI MOV qword ptr [RSP + 0x90],RSI MOV RAX,qword ptr [RSP + 0x90] ADD RAX,0x18 MOV qword ptr [RSP + 0x78],RAX MOV RDI,qword ptr [RSP + 0x78] ADD RDI,0x28 CALL 0x00122390 MOV RAX,qword ptr [RSP + 0xb0] MOV qword ptr [RSP + 0x88],RAX MOV RAX,qword ptr [RSP + 0x88] MOV RAX,qword ptr [RAX + 0x30] MOV qword ptr [RSP + 0x80],RAX MOV RAX,qword ptr [RSP + 0x80] MOV AX,word ptr [RAX + 0x18] AND AX,0x1 MOVZX EDX,AL MOV RAX,qword ptr [RSP + 0x78] MOV ECX,dword ptr [RAX + 0x40] AND EDX,0x1 SHL EDX,0x1f AND ECX,0x7fffffff OR ECX,EDX MOV dword ptr [RAX + 0x40],ECX MOV RAX,qword ptr [RSP + 0x80] MOV RCX,qword ptr [RAX + 0x20] MOV RAX,qword ptr [RSP + 0x78] MOV qword ptr [RAX + 0x38],RCX MOV RAX,qword ptr [RSP + 0x80] MOVZX EDI,word ptr [RAX + 0x40] MOV ESI,dword ptr [RSP + 0xd0] CALL 0x0015d310 MOV dword ptr [RSP + 0x6c],EAX MOV EAX,dword ptr [RSP + 0x6c] MOV RCX,qword ptr [RSP + 0x80] MOVZX ECX,word ptr [RCX + 0x42] ADD EAX,ECX MOV RCX,qword ptr [RSP + 0x80] MOVZX ECX,word ptr [RCX + 0x46] ADD EAX,ECX MOV dword ptr [RSP + 0x74],EAX MOV RAX,qword ptr [RSP + 0x98] MOV qword ptr [RSP + 0x20],RAX MOV EDI,dword ptr [RSP + 0x74] MOV ESI,0x1 CALL 0x0015d310 MOV RDI,qword ptr [RSP + 0x20] MOVSXD RSI,EAX SHL RSI,0x4 CALL 0x00121cb0 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x78] MOV qword ptr [RAX + 0x18],RCX MOV RAX,qword ptr [RSP + 0x78] CMP qword ptr [RAX + 0x18],0x0 JNZ 0x0017210e MOV dword ptr [RSP + 0xc4],0xffffffff JMP 0x00172303 LAB_0017210e: MOV RAX,qword ptr [RSP + 0x78] MOV qword ptr [RSP + 0x10],RAX MOV RDI,qword ptr [RSP + 0xb0] MOV RSI,qword ptr [RSP + 0xb8] CALL 0x001216d0 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x10] MOV qword ptr [RSP + 0x58],RCX MOV qword ptr [RSP + 0x60],RDX MOV RCX,qword ptr [RSP + 0x58] MOV qword ptr [RAX + 0x8],RCX MOV RCX,qword ptr [RSP + 0x60] MOV qword ptr [RAX + 0x10],RCX MOV RAX,qword ptr [RSP + 0x90] MOV qword ptr [RSP + 0x18],RAX MOV RDI,qword ptr [RSP + 0xa0] MOV RSI,qword ptr [RSP + 0xa8] CALL 0x001216d0 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x18] MOV qword ptr [RSP + 0x48],RCX MOV qword ptr [RSP + 0x50],RDX MOV RCX,qword ptr [RSP + 0x48] MOV qword ptr [RAX],RCX MOV RCX,qword ptr [RSP + 0x50] MOV qword ptr [RAX + 0x8],RCX MOV ECX,dword ptr [RSP + 0xd0] MOV RAX,qword ptr [RSP + 0x90] MOV dword ptr [RAX + 0x10],ECX MOV EDX,dword ptr [RSP + 0x6c] MOV RAX,qword ptr [RSP + 0x78] MOV ECX,dword ptr [RAX + 0x40] AND EDX,0x7fffffff AND ECX,0x80000000 OR ECX,EDX MOV dword ptr [RAX + 0x40],ECX MOV RAX,qword ptr [RSP + 0x78] MOV RCX,qword ptr [RAX + 0x18] MOVSXD RAX,dword ptr [RSP + 0x6c] SHL RAX,0x4 ADD RCX,RAX MOV RAX,qword ptr [RSP + 0x78] MOV qword ptr [RAX + 0x20],RCX MOV RAX,qword ptr [RSP + 0x78] MOV RCX,qword ptr [RAX + 0x20] MOV RAX,qword ptr [RSP + 0x80] MOVZX EAX,word ptr [RAX + 0x42] CDQE SHL RAX,0x4 ADD RCX,RAX MOV RAX,qword ptr [RSP + 0x78] MOV qword ptr [RAX + 0x48],RCX MOV dword ptr [RSP + 0x70],0x0 LAB_00172212: MOV EAX,dword ptr [RSP + 0x70] CMP EAX,dword ptr [RSP + 0xd0] JGE 0x00172289 MOV RAX,qword ptr [RSP + 0x78] MOV RAX,qword ptr [RAX + 0x18] MOVSXD RCX,dword ptr [RSP + 0x70] SHL RCX,0x4 ADD RAX,RCX MOV qword ptr [RSP + 0x8],RAX MOV RAX,qword ptr [RSP + 0xd8] MOVSXD RCX,dword ptr [RSP + 0x70] SHL RCX,0x4 ADD RAX,RCX MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RAX + 0x8] CALL 0x001216d0 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x8] MOV qword ptr [RSP + 0x38],RCX MOV qword ptr [RSP + 0x40],RDX MOV RCX,qword ptr [RSP + 0x38] MOV qword ptr [RAX],RCX MOV RCX,qword ptr [RSP + 0x40] MOV qword ptr [RAX + 0x8],RCX MOV EAX,dword ptr [RSP + 0x70] ADD EAX,0x1 MOV dword ptr [RSP + 0x70],EAX JMP 0x00172212 LAB_00172289: MOV EAX,dword ptr [RSP + 0x6c] MOV RCX,qword ptr [RSP + 0x80] MOVZX ECX,word ptr [RCX + 0x42] ADD EAX,ECX MOV dword ptr [RSP + 0x68],EAX MOV EAX,dword ptr [RSP + 0xd0] MOV dword ptr [RSP + 0x70],EAX LAB_001722aa: MOV EAX,dword ptr [RSP + 0x70] CMP EAX,dword ptr [RSP + 0x68] JGE 0x001722f8 MOV RAX,qword ptr [RSP + 0x78] MOV RAX,qword ptr [RAX + 0x18] MOVSXD RCX,dword ptr [RSP + 0x70] SHL RCX,0x4 ADD RAX,RCX MOV dword ptr [RSP + 0x28],0x0 MOV qword ptr [RSP + 0x30],0x3 MOV RCX,qword ptr [RSP + 0x28] MOV qword ptr [RAX],RCX MOV RCX,qword ptr [RSP + 0x30] MOV qword ptr [RAX + 0x8],RCX MOV EAX,dword ptr [RSP + 0x70] ADD EAX,0x1 MOV dword ptr [RSP + 0x70],EAX JMP 0x001722aa LAB_001722f8: MOV dword ptr [RSP + 0xc4],0x0 LAB_00172303: MOV EAX,dword ptr [RSP + 0xc4] ADD RSP,0xc8 RET
int4 async_func_init(int8 param_1,int1 (*param_2) [16],long param_3,int8 param_4, int8 param_5,int8 param_6,int param_7,long param_8) { ushort uVar1; long lVar2; long lVar3; uint uVar4; int iVar5; int8 uVar6; int8 *puVar7; long *plVar8; int1 auVar9 [16]; uint uStack_9c; int local_58; int4 local_4; init_list_head(param_2 + 4); lVar2 = *(long *)(param_3 + 0x30); *(uint *)(param_2[5] + 8) = *(uint *)(param_2[5] + 8) & 0x7fffffff | (uint)((byte)*(int2 *)(lVar2 + 0x18) & 1) << 0x1f; *(int8 *)param_2[5] = *(int8 *)(lVar2 + 0x20); uVar4 = max_int(*(int2 *)(lVar2 + 0x40),param_7); iVar5 = max_int(uVar4 + *(ushort *)(lVar2 + 0x42) + (uint)*(ushort *)(lVar2 + 0x46),1); uVar6 = js_malloc(param_1,(long)iVar5 << 4); *(int8 *)param_2[3] = uVar6; if (*(long *)param_2[3] == 0) { local_4 = 0xffffffff; } else { auVar9 = js_dup(param_3,param_4); param_2[2] = auVar9; auVar9 = js_dup(param_5,param_6); *param_2 = auVar9; *(int *)param_2[1] = param_7; *(uint *)(param_2[5] + 8) = *(uint *)(param_2[5] + 8) & 0x80000000 | uVar4 & 0x7fffffff; *(long *)(param_2[3] + 8) = *(long *)param_2[3] + (long)(int)uVar4 * 0x10; *(long *)param_2[6] = *(long *)(param_2[3] + 8) + (long)(int)(uint)*(ushort *)(lVar2 + 0x42) * 0x10; for (local_58 = 0; local_58 < param_7; local_58 = local_58 + 1) { lVar3 = *(long *)param_2[3]; puVar7 = (int8 *)(param_8 + (long)local_58 * 0x10); auVar9 = js_dup(*puVar7,puVar7[1]); *(int1 (*) [16])(lVar3 + (long)local_58 * 0x10) = auVar9; } uVar1 = *(ushort *)(lVar2 + 0x42); for (local_58 = param_7; local_58 < (int)(uVar4 + uVar1); local_58 = local_58 + 1) { plVar8 = (long *)(*(long *)param_2[3] + (long)local_58 * 0x10); *plVar8 = (ulong)uStack_9c << 0x20; plVar8[1] = 3; } local_4 = 0; } return local_4; }
2,952
async_func_init
bluesky950520[P]quickjs/quickjs.c
static __exception int async_func_init(JSContext *ctx, JSAsyncFunctionState *s, JSValue func_obj, JSValue this_obj, int argc, JSValue *argv) { JSObject *p; JSFunctionBytecode *b; JSStackFrame *sf; int local_count, i, arg_buf_len, n; sf = &s->frame; init_list_head(&sf->var_ref_list); p = JS_VALUE_GET_OBJ(func_obj); b = p->u.func.function_bytecode; sf->is_strict_mode = b->is_strict_mode; sf->cur_pc = b->byte_code_buf; arg_buf_len = max_int(b->arg_count, argc); local_count = arg_buf_len + b->var_count + b->stack_size; sf->arg_buf = js_malloc(ctx, sizeof(JSValue) * max_int(local_count, 1)); if (!sf->arg_buf) return -1; sf->cur_func = js_dup(func_obj); s->this_val = js_dup(this_obj); s->argc = argc; sf->arg_count = arg_buf_len; sf->var_buf = sf->arg_buf + arg_buf_len; sf->cur_sp = sf->var_buf + b->var_count; for(i = 0; i < argc; i++) sf->arg_buf[i] = js_dup(argv[i]); n = arg_buf_len + b->var_count; for(i = argc; i < n; i++) sf->arg_buf[i] = JS_UNDEFINED; return 0; }
O1
c
async_func_init: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %r9, 0x10(%rsp) movq %r8, %r15 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbx movl 0x50(%rsp), %edx leaq 0x40(%rsi), %rax movq %rax, 0x40(%rsi) movq %rax, 0x48(%rsi) movq 0x30(%r13), %rbp movl 0x18(%rbp), %eax shll $0x1f, %eax movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF andl 0x58(%rsi), %ecx orl %eax, %ecx movl %ecx, 0x58(%rsi) movq 0x20(%rbp), %rax movq %rax, 0x50(%rsi) movzwl 0x40(%rbp), %r14d cmpl %edx, %r14d cmovlel %edx, %r14d movzwl 0x42(%rbp), %eax movzwl 0x46(%rbp), %ecx addl %eax, %ecx addl %r14d, %ecx cmpl $0x2, %ecx pushq $0x1 popq %rsi cmovgel %ecx, %esi shlq $0x4, %rsi callq 0xede6 movq %rax, 0x30(%rbx) testq %rax, %rax je 0x10d56 movq %r13, 0x8(%rsp) cmpl $-0x9, %r12d jb 0x10c78 movq 0x8(%rsp), %rcx incl (%rcx) movq %r13, 0x20(%rbx) movq %r12, 0x28(%rbx) movq %r15, 0x8(%rsp) movq 0x10(%rsp), %rdx cmpl $-0x9, %edx movl 0x50(%rsp), %r11d jb 0x10c9b movq 0x8(%rsp), %rcx incl (%rcx) movq %r15, (%rbx) movq %rdx, 0x8(%rbx) movl %r11d, 0x10(%rbx) movl $0x80000000, %ecx # imm = 0x80000000 andl 0x58(%rbx), %ecx orl %r14d, %ecx movl %ecx, 0x58(%rbx) movl %r14d, %ecx movq %rcx, %rdx shlq $0x4, %rdx addq %rdx, %rax movq %rax, 0x38(%rbx) movzwl 0x42(%rbp), %edx shll $0x4, %edx addq %rax, %rdx movq %rdx, 0x60(%rbx) testl %r11d, %r11d jle 0x10d18 movq 0x58(%rsp), %rax movl %r11d, %edx shlq $0x4, %rdx xorl %esi, %esi movq 0x30(%rbx), %rdi movq (%rax,%rsi), %r8 movq 0x8(%rax,%rsi), %r9 movq %r8, 0x8(%rsp) cmpl $-0x9, %r9d jb 0x10d06 movq 0x8(%rsp), %r10 incl (%r10) movq %r8, (%rdi,%rsi) movq %r9, 0x8(%rdi,%rsi) addq $0x10, %rsi cmpq %rsi, %rdx jne 0x10ce6 movzwl 0x42(%rbp), %edx addl %edx, %r14d xorl %eax, %eax cmpl %r11d, %r14d jle 0x10d59 movslq %r11d, %rsi addq %rdx, %rcx subq %rsi, %rcx movq %rsi, %rdx shlq $0x4, %rdx orq $0x8, %rdx movq 0x30(%rbx), %rsi andl $0x0, -0x8(%rsi,%rdx) movq $0x3, (%rsi,%rdx) addq $0x10, %rdx decq %rcx jne 0x10d3a jmp 0x10d59 pushq $-0x1 popq %rax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
async_func_init: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 18h mov [rsp+48h+var_38], r9 mov r15, r8 mov r12, rcx mov r13, rdx mov rbx, rsi mov edx, [rsp+48h+arg_0] lea rax, [rsi+40h] mov [rsi+40h], rax mov [rsi+48h], rax mov rbp, [r13+30h] mov eax, [rbp+18h] shl eax, 1Fh mov ecx, 7FFFFFFFh and ecx, [rsi+58h] or ecx, eax mov [rsi+58h], ecx mov rax, [rbp+20h] mov [rsi+50h], rax movzx r14d, word ptr [rbp+40h] cmp r14d, edx cmovle r14d, edx movzx eax, word ptr [rbp+42h] movzx ecx, word ptr [rbp+46h] add ecx, eax add ecx, r14d cmp ecx, 2 push 1 pop rsi cmovge esi, ecx shl rsi, 4 call js_malloc mov [rbx+30h], rax test rax, rax jz loc_10D56 mov [rsp+48h+var_40], r13 cmp r12d, 0FFFFFFF7h jb short loc_10C78 mov rcx, [rsp+48h+var_40] inc dword ptr [rcx] loc_10C78: mov [rbx+20h], r13 mov [rbx+28h], r12 mov [rsp+48h+var_40], r15 mov rdx, [rsp+48h+var_38] cmp edx, 0FFFFFFF7h mov r11d, [rsp+48h+arg_0] jb short loc_10C9B mov rcx, [rsp+48h+var_40] inc dword ptr [rcx] loc_10C9B: mov [rbx], r15 mov [rbx+8], rdx mov [rbx+10h], r11d mov ecx, 80000000h and ecx, [rbx+58h] or ecx, r14d mov [rbx+58h], ecx mov ecx, r14d mov rdx, rcx shl rdx, 4 add rax, rdx mov [rbx+38h], rax movzx edx, word ptr [rbp+42h] shl edx, 4 add rdx, rax mov [rbx+60h], rdx test r11d, r11d jle short loc_10D18 mov rax, [rsp+48h+arg_8] mov edx, r11d shl rdx, 4 xor esi, esi loc_10CE6: mov rdi, [rbx+30h] mov r8, [rax+rsi] mov r9, [rax+rsi+8] mov [rsp+48h+var_40], r8 cmp r9d, 0FFFFFFF7h jb short loc_10D06 mov r10, [rsp+48h+var_40] inc dword ptr [r10] loc_10D06: mov [rdi+rsi], r8 mov [rdi+rsi+8], r9 add rsi, 10h cmp rdx, rsi jnz short loc_10CE6 loc_10D18: movzx edx, word ptr [rbp+42h] add r14d, edx xor eax, eax cmp r14d, r11d jle short loc_10D59 movsxd rsi, r11d add rcx, rdx sub rcx, rsi mov rdx, rsi shl rdx, 4 or rdx, 8 loc_10D3A: mov rsi, [rbx+30h] and dword ptr [rsi+rdx-8], 0 mov qword ptr [rsi+rdx], 3 add rdx, 10h dec rcx jnz short loc_10D3A jmp short loc_10D59 loc_10D56: push 0FFFFFFFFFFFFFFFFh pop rax loc_10D59: add rsp, 18h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long async_func_init( long long a1, long long a2, long long a3, long long a4, _DWORD *a5, long long a6, int a7, long long a8) { long long v12; // rbp unsigned int v13; // r14d int v14; // ecx long long v15; // rsi long long v16; // rax long long v17; // rax long long v18; // rsi long long v19; // rdi long long v20; // r8 long long v21; // r9 long long v22; // rdx long long result; // rax long long v24; // rcx long long v25; // rdx long long v26; // rsi *(_QWORD *)(a2 + 64) = a2 + 64; *(_QWORD *)(a2 + 72) = a2 + 64; v12 = *(_QWORD *)(a3 + 48); *(_DWORD *)(a2 + 88) = (*(_DWORD *)(v12 + 24) << 31) | *(_DWORD *)(a2 + 88) & 0x7FFFFFFF; *(_QWORD *)(a2 + 80) = *(_QWORD *)(v12 + 32); v13 = *(unsigned __int16 *)(v12 + 64); if ( (int)v13 <= a7 ) v13 = a7; v14 = v13 + *(unsigned __int16 *)(v12 + 66) + *(unsigned __int16 *)(v12 + 70); v15 = 1LL; if ( v14 >= 2 ) v15 = (unsigned int)v14; v16 = js_malloc(a1, 16 * v15); *(_QWORD *)(a2 + 48) = v16; if ( !v16 ) return -1LL; if ( (unsigned int)a4 >= 0xFFFFFFF7 ) ++*(_DWORD *)a3; *(_QWORD *)(a2 + 32) = a3; *(_QWORD *)(a2 + 40) = a4; if ( (unsigned int)a6 >= 0xFFFFFFF7 ) ++*a5; *(_QWORD *)a2 = a5; *(_QWORD *)(a2 + 8) = a6; *(_DWORD *)(a2 + 16) = a7; *(_DWORD *)(a2 + 88) = v13 | *(_DWORD *)(a2 + 88) & 0x80000000; v17 = 16LL * v13 + v16; *(_QWORD *)(a2 + 56) = v17; *(_QWORD *)(a2 + 96) = v17 + 16 * (unsigned int)*(unsigned __int16 *)(v12 + 66); if ( a7 > 0 ) { v18 = 0LL; do { v19 = *(_QWORD *)(a2 + 48); v20 = *(_QWORD *)(a8 + v18); v21 = *(_QWORD *)(a8 + v18 + 8); if ( (unsigned int)v21 >= 0xFFFFFFF7 ) ++**(_DWORD **)(a8 + v18); *(_QWORD *)(v19 + v18) = v20; *(_QWORD *)(v19 + v18 + 8) = v21; v18 += 16LL; } while ( 16LL * (unsigned int)a7 != v18 ); } v22 = *(unsigned __int16 *)(v12 + 66); result = 0LL; if ( (int)(v22 + v13) > a7 ) { v24 = v22 + v13 - a7; v25 = (16LL * a7) | 8; do { v26 = *(_QWORD *)(a2 + 48); *(_DWORD *)(v26 + v25 - 8) = 0; *(_QWORD *)(v26 + v25) = 3LL; v25 += 16LL; --v24; } while ( v24 ); } return result; }
2,953
async_func_init
bluesky950520[P]quickjs/quickjs.c
static __exception int async_func_init(JSContext *ctx, JSAsyncFunctionState *s, JSValue func_obj, JSValue this_obj, int argc, JSValue *argv) { JSObject *p; JSFunctionBytecode *b; JSStackFrame *sf; int local_count, i, arg_buf_len, n; sf = &s->frame; init_list_head(&sf->var_ref_list); p = JS_VALUE_GET_OBJ(func_obj); b = p->u.func.function_bytecode; sf->is_strict_mode = b->is_strict_mode; sf->cur_pc = b->byte_code_buf; arg_buf_len = max_int(b->arg_count, argc); local_count = arg_buf_len + b->var_count + b->stack_size; sf->arg_buf = js_malloc(ctx, sizeof(JSValue) * max_int(local_count, 1)); if (!sf->arg_buf) return -1; sf->cur_func = js_dup(func_obj); s->this_val = js_dup(this_obj); s->argc = argc; sf->arg_count = arg_buf_len; sf->var_buf = sf->arg_buf + arg_buf_len; sf->cur_sp = sf->var_buf + b->var_count; for(i = 0; i < argc; i++) sf->arg_buf[i] = js_dup(argv[i]); n = arg_buf_len + b->var_count; for(i = argc; i < n; i++) sf->arg_buf[i] = JS_UNDEFINED; return 0; }
O2
c
async_func_init: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %r9, %r14 movq %r8, (%rsp) movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbx movl 0x40(%rsp), %edx leaq 0x40(%rsi), %rax movq %rax, 0x40(%rsi) movq %rax, 0x48(%rsi) movq 0x30(%r13), %r15 movl 0x18(%r15), %eax shll $0x1f, %eax movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF andl 0x58(%rsi), %ecx orl %eax, %ecx movl %ecx, 0x58(%rsi) movq 0x20(%r15), %rax movq %rax, 0x50(%rsi) movzwl 0x40(%r15), %ebp cmpl %edx, %ebp cmovlel %edx, %ebp movzwl 0x42(%r15), %esi addl %ebp, %esi movzwl 0x46(%r15), %eax leal (%rsi,%rax), %ecx cmpl $0x1, %ecx adcl %eax, %esi shlq $0x4, %rsi callq 0x17214 movq %rax, 0x30(%rbx) testq %rax, %rax je 0x3adb5 cmpl $-0x9, %r12d jb 0x3acf0 incl (%r13) movq %r13, 0x20(%rbx) movq %r12, 0x28(%rbx) cmpl $-0x9, %r14d movl 0x40(%rsp), %r9d movq (%rsp), %rdx jb 0x3ad09 incl (%rdx) movq 0x48(%rsp), %rcx movq %rdx, (%rbx) movq %r14, 0x8(%rbx) movl %r9d, 0x10(%rbx) movl $0x80000000, %edx # imm = 0x80000000 andl 0x58(%rbx), %edx orl %ebp, %edx movl %edx, 0x58(%rbx) movl %ebp, %edx shlq $0x4, %rdx addq %rdx, %rax movq %rax, 0x38(%rbx) movzwl 0x42(%r15), %edx shll $0x4, %edx addq %rax, %rdx movq %rdx, 0x60(%rbx) xorl %eax, %eax testl %r9d, %r9d movl $0x0, %edx cmovgl %r9d, %edx shlq $0x4, %rdx cmpq %rax, %rdx je 0x3ad7d movq 0x30(%rbx), %rsi movq (%rcx,%rax), %rdi movq 0x8(%rcx,%rax), %r8 cmpl $-0x9, %r8d jb 0x3ad6e incl (%rdi) movq %rdi, (%rsi,%rax) movq %r8, 0x8(%rsi,%rax) addq $0x10, %rax jmp 0x3ad54 movzwl 0x42(%r15), %eax addl %eax, %ebp movslq %r9d, %rax movq %rax, %rcx shlq $0x4, %rcx orq $0x8, %rcx cmpq %rbp, %rax jge 0x3adb1 movq 0x30(%rbx), %rdx andl $0x0, -0x8(%rdx,%rcx) movq $0x3, (%rdx,%rcx) incq %rax addq $0x10, %rcx jmp 0x3ad92 xorl %eax, %eax jmp 0x3adb8 pushq $-0x1 popq %rax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
async_func_init: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov r14, r9 mov [rsp+38h+var_38], r8 mov r12, rcx mov r13, rdx mov rbx, rsi mov edx, [rsp+38h+arg_0] lea rax, [rsi+40h] mov [rsi+40h], rax mov [rsi+48h], rax mov r15, [r13+30h] mov eax, [r15+18h] shl eax, 1Fh mov ecx, 7FFFFFFFh and ecx, [rsi+58h] or ecx, eax mov [rsi+58h], ecx mov rax, [r15+20h] mov [rsi+50h], rax movzx ebp, word ptr [r15+40h] cmp ebp, edx cmovle ebp, edx movzx esi, word ptr [r15+42h] add esi, ebp movzx eax, word ptr [r15+46h] lea ecx, [rsi+rax] cmp ecx, 1 adc esi, eax shl rsi, 4 call js_malloc mov [rbx+30h], rax test rax, rax jz loc_3ADB5 cmp r12d, 0FFFFFFF7h jb short loc_3ACF0 inc dword ptr [r13+0] loc_3ACF0: mov [rbx+20h], r13 mov [rbx+28h], r12 cmp r14d, 0FFFFFFF7h mov r9d, [rsp+38h+arg_0] mov rdx, [rsp+38h+var_38] jb short loc_3AD09 inc dword ptr [rdx] loc_3AD09: mov rcx, [rsp+38h+arg_8] mov [rbx], rdx mov [rbx+8], r14 mov [rbx+10h], r9d mov edx, 80000000h and edx, [rbx+58h] or edx, ebp mov [rbx+58h], edx mov edx, ebp shl rdx, 4 add rax, rdx mov [rbx+38h], rax movzx edx, word ptr [r15+42h] shl edx, 4 add rdx, rax mov [rbx+60h], rdx xor eax, eax test r9d, r9d mov edx, 0 cmovg edx, r9d shl rdx, 4 loc_3AD54: cmp rdx, rax jz short loc_3AD7D mov rsi, [rbx+30h] mov rdi, [rcx+rax] mov r8, [rcx+rax+8] cmp r8d, 0FFFFFFF7h jb short loc_3AD6E inc dword ptr [rdi] loc_3AD6E: mov [rsi+rax], rdi mov [rsi+rax+8], r8 add rax, 10h jmp short loc_3AD54 loc_3AD7D: movzx eax, word ptr [r15+42h] add ebp, eax movsxd rax, r9d mov rcx, rax shl rcx, 4 or rcx, 8 loc_3AD92: cmp rax, rbp jge short loc_3ADB1 mov rdx, [rbx+30h] and dword ptr [rdx+rcx-8], 0 mov qword ptr [rdx+rcx], 3 inc rax add rcx, 10h jmp short loc_3AD92 loc_3ADB1: xor eax, eax jmp short loc_3ADB8 loc_3ADB5: push 0FFFFFFFFFFFFFFFFh pop rax loc_3ADB8: add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long async_func_init( long long a1, long long a2, long long a3, long long a4, _DWORD *a5, long long a6, int a7, long long a8) { long long v12; // r15 int v13; // ebp long long v14; // rax long long v15; // rax long long v16; // rax long long v17; // rdx long long v18; // rdx long long v19; // rsi _DWORD *v20; // rdi long long v21; // r8 long long v22; // rbp long long v23; // rax long long v24; // rcx long long v25; // rdx *(_QWORD *)(a2 + 64) = a2 + 64; *(_QWORD *)(a2 + 72) = a2 + 64; v12 = *(_QWORD *)(a3 + 48); *(_DWORD *)(a2 + 88) = (*(_DWORD *)(v12 + 24) << 31) | *(_DWORD *)(a2 + 88) & 0x7FFFFFFF; *(_QWORD *)(a2 + 80) = *(_QWORD *)(v12 + 32); v13 = *(unsigned __int16 *)(v12 + 64); if ( v13 <= a7 ) v13 = a7; v14 = js_malloc( a1, 16LL * (*(unsigned __int16 *)(v12 + 70) + (v13 + *(unsigned __int16 *)(v12 + 66) + *(unsigned __int16 *)(v12 + 70) == 0) + v13 + (unsigned int)*(unsigned __int16 *)(v12 + 66))); *(_QWORD *)(a2 + 48) = v14; if ( !v14 ) return -1LL; if ( (unsigned int)a4 >= 0xFFFFFFF7 ) ++*(_DWORD *)a3; *(_QWORD *)(a2 + 32) = a3; *(_QWORD *)(a2 + 40) = a4; if ( (unsigned int)a6 >= 0xFFFFFFF7 ) ++*a5; *(_QWORD *)a2 = a5; *(_QWORD *)(a2 + 8) = a6; *(_DWORD *)(a2 + 16) = a7; *(_DWORD *)(a2 + 88) = v13 | *(_DWORD *)(a2 + 88) & 0x80000000; v15 = 16LL * (unsigned int)v13 + v14; *(_QWORD *)(a2 + 56) = v15; *(_QWORD *)(a2 + 96) = v15 + 16 * (unsigned int)*(unsigned __int16 *)(v12 + 66); v16 = 0LL; v17 = 0LL; if ( a7 > 0 ) v17 = (unsigned int)a7; v18 = 16 * v17; while ( v18 != v16 ) { v19 = *(_QWORD *)(a2 + 48); v20 = *(_DWORD **)(a8 + v16); v21 = *(_QWORD *)(a8 + v16 + 8); if ( (unsigned int)v21 >= 0xFFFFFFF7 ) ++*v20; *(_QWORD *)(v19 + v16) = v20; *(_QWORD *)(v19 + v16 + 8) = v21; v16 += 16LL; } v22 = (unsigned int)*(unsigned __int16 *)(v12 + 66) + v13; v23 = a7; v24 = (16LL * a7) | 8; while ( v23 < v22 ) { v25 = *(_QWORD *)(a2 + 48); *(_DWORD *)(v25 + v24 - 8) = 0; *(_QWORD *)(v25 + v24) = 3LL; ++v23; v24 += 16LL; } return 0LL; }
async_func_init: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV R14,R9 MOV qword ptr [RSP],R8 MOV R12,RCX MOV R13,RDX MOV RBX,RSI MOV EDX,dword ptr [RSP + 0x40] LEA RAX,[RSI + 0x40] MOV qword ptr [RSI + 0x40],RAX MOV qword ptr [RSI + 0x48],RAX MOV R15,qword ptr [R13 + 0x30] MOV EAX,dword ptr [R15 + 0x18] SHL EAX,0x1f MOV ECX,0x7fffffff AND ECX,dword ptr [RSI + 0x58] OR ECX,EAX MOV dword ptr [RSI + 0x58],ECX MOV RAX,qword ptr [R15 + 0x20] MOV qword ptr [RSI + 0x50],RAX MOVZX EBP,word ptr [R15 + 0x40] CMP EBP,EDX CMOVLE EBP,EDX MOVZX ESI,word ptr [R15 + 0x42] ADD ESI,EBP MOVZX EAX,word ptr [R15 + 0x46] LEA ECX,[RSI + RAX*0x1] CMP ECX,0x1 ADC ESI,EAX SHL RSI,0x4 CALL 0x00117214 MOV qword ptr [RBX + 0x30],RAX TEST RAX,RAX JZ 0x0013adb5 CMP R12D,-0x9 JC 0x0013acf0 INC dword ptr [R13] LAB_0013acf0: MOV qword ptr [RBX + 0x20],R13 MOV qword ptr [RBX + 0x28],R12 CMP R14D,-0x9 MOV R9D,dword ptr [RSP + 0x40] MOV RDX,qword ptr [RSP] JC 0x0013ad09 INC dword ptr [RDX] LAB_0013ad09: MOV RCX,qword ptr [RSP + 0x48] MOV qword ptr [RBX],RDX MOV qword ptr [RBX + 0x8],R14 MOV dword ptr [RBX + 0x10],R9D MOV EDX,0x80000000 AND EDX,dword ptr [RBX + 0x58] OR EDX,EBP MOV dword ptr [RBX + 0x58],EDX MOV EDX,EBP SHL RDX,0x4 ADD RAX,RDX MOV qword ptr [RBX + 0x38],RAX MOVZX EDX,word ptr [R15 + 0x42] SHL EDX,0x4 ADD RDX,RAX MOV qword ptr [RBX + 0x60],RDX XOR EAX,EAX TEST R9D,R9D MOV EDX,0x0 CMOVG EDX,R9D SHL RDX,0x4 LAB_0013ad54: CMP RDX,RAX JZ 0x0013ad7d MOV RSI,qword ptr [RBX + 0x30] MOV RDI,qword ptr [RCX + RAX*0x1] MOV R8,qword ptr [RCX + RAX*0x1 + 0x8] CMP R8D,-0x9 JC 0x0013ad6e INC dword ptr [RDI] LAB_0013ad6e: MOV qword ptr [RSI + RAX*0x1],RDI MOV qword ptr [RSI + RAX*0x1 + 0x8],R8 ADD RAX,0x10 JMP 0x0013ad54 LAB_0013ad7d: MOVZX EAX,word ptr [R15 + 0x42] ADD EBP,EAX MOVSXD RAX,R9D MOV RCX,RAX SHL RCX,0x4 OR RCX,0x8 LAB_0013ad92: CMP RAX,RBP JGE 0x0013adb1 MOV RDX,qword ptr [RBX + 0x30] AND dword ptr [RDX + RCX*0x1 + -0x8],0x0 MOV qword ptr [RDX + RCX*0x1],0x3 INC RAX ADD RCX,0x10 JMP 0x0013ad92 LAB_0013adb1: XOR EAX,EAX JMP 0x0013adb8 LAB_0013adb5: PUSH -0x1 POP RAX LAB_0013adb8: ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
int8 async_func_init(int8 param_1,int8 *param_2,int *param_3,int8 param_4,int *param_5, int8 param_6,uint param_7,long param_8) { ushort uVar1; long lVar2; int *piVar3; long lVar4; long lVar5; int8 uVar6; ulong uVar7; uint uVar8; int iVar9; param_2[8] = param_2 + 8; param_2[9] = param_2 + 8; lVar5 = *(long *)(param_3 + 0xc); *(uint *)(param_2 + 0xb) = *(uint *)(param_2 + 0xb) & 0x7fffffff | *(int *)(lVar5 + 0x18) << 0x1f; param_2[10] = *(int8 *)(lVar5 + 0x20); uVar8 = (uint)*(ushort *)(lVar5 + 0x40); if ((int)(uint)*(ushort *)(lVar5 + 0x40) <= (int)param_7) { uVar8 = param_7; } iVar9 = *(ushort *)(lVar5 + 0x42) + uVar8; lVar4 = js_malloc(param_1,(ulong)(iVar9 + (uint)*(ushort *)(lVar5 + 0x46) + (uint)(iVar9 + (uint)*(ushort *)(lVar5 + 0x46) == 0)) << 4); param_2[6] = lVar4; if (lVar4 == 0) { uVar6 = 0xffffffffffffffff; } else { if (0xfffffff6 < (uint)param_4) { *param_3 = *param_3 + 1; } param_2[4] = param_3; param_2[5] = param_4; if (0xfffffff6 < (uint)param_6) { *param_5 = *param_5 + 1; } *param_2 = param_5; param_2[1] = param_6; *(uint *)(param_2 + 2) = param_7; *(uint *)(param_2 + 0xb) = *(uint *)(param_2 + 0xb) & 0x80000000 | uVar8; lVar4 = lVar4 + (ulong)uVar8 * 0x10; param_2[7] = lVar4; param_2[0xc] = (ulong)*(ushort *)(lVar5 + 0x42) * 0x10 + lVar4; lVar4 = 0; uVar7 = 0; if (0 < (int)param_7) { uVar7 = (ulong)param_7; } for (; uVar7 * 0x10 != lVar4; lVar4 = lVar4 + 0x10) { lVar2 = param_2[6]; piVar3 = *(int **)(param_8 + lVar4); uVar6 = *(int8 *)(param_8 + 8 + lVar4); if (0xfffffff6 < (uint)uVar6) { *piVar3 = *piVar3 + 1; } *(int **)(lVar2 + lVar4) = piVar3; *(int8 *)(lVar2 + 8 + lVar4) = uVar6; } uVar1 = *(ushort *)(lVar5 + 0x42); lVar5 = (long)(int)param_7; uVar7 = lVar5 << 4 | 8; for (; lVar5 < (long)(ulong)(uVar8 + uVar1); lVar5 = lVar5 + 1) { lVar4 = param_2[6]; *(int4 *)(lVar4 + -8 + uVar7) = 0; *(int8 *)(lVar4 + uVar7) = 3; uVar7 = uVar7 + 0x10; } uVar6 = 0; } return uVar6; }
2,954
do_mul
fabiosvm[P]rak/src/vm.c
static void do_mul(RakVM *vm, RakChunk *chunk, uint32_t *ip, RakValue *slots, RakError *err) { rak_vm_mul(vm, err); if (!rak_is_ok(err)) return; dispatch(vm, chunk, ip + 1, slots, err); }
O3
c
do_mul: pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x10, %rsp movq %r8, %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r13 movq 0x8(%rdi), %rax movq -0x10(%rax), %rdi cmpl $0x2, %edi jne 0x971f movl (%rax), %ecx cmpl $0x2, %ecx jne 0x971f movq -0x8(%rax), %rsi movq %rsi, %xmm0 mulsd 0x8(%rax), %xmm0 movsd %xmm0, 0x8(%rsp) callq 0x8235 movq 0x8(%r13), %rax movq $0x2, -0x10(%rax) movsd 0x8(%rsp), %xmm0 movsd %xmm0, -0x8(%rax) movq 0x8(%r13), %rax movq (%rax), %rdi movq 0x8(%rax), %rsi addq $-0x10, %rax movq %rax, 0x8(%r13) callq 0x8235 jmp 0x9730 leaq 0x1418(%rip), %rsi # 0xab3e movq %rbx, %rdi xorl %eax, %eax callq 0x666c cmpb $0x1, (%rbx) jne 0x9765 movzbl 0x4(%r15), %eax addq $0x4, %r15 leaq 0x55ab(%rip), %r9 # 0xecf0 movq %r13, %rdi movq %r12, %rsi movq %r15, %rdx movq %r14, %rcx movq %rbx, %r8 addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 jmpq *(%r9,%rax,8) addq $0x10, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq
do_mul: push r15 push r14 push r13 push r12 push rbx sub rsp, 10h mov rbx, r8 mov r14, rcx mov r15, rdx mov r12, rsi mov r13, rdi mov rax, [rdi+8] mov rdi, [rax-10h] cmp edi, 2 jnz short loc_971F mov ecx, [rax] cmp ecx, 2 jnz short loc_971F mov rsi, [rax-8] movq xmm0, rsi mulsd xmm0, qword ptr [rax+8] movsd [rsp+38h+var_30], xmm0 call rak_value_release mov rax, [r13+8] mov qword ptr [rax-10h], 2 movsd xmm0, [rsp+38h+var_30] movsd qword ptr [rax-8], xmm0 mov rax, [r13+8] mov rdi, [rax] mov rsi, [rax+8] add rax, 0FFFFFFFFFFFFFFF0h mov [r13+8], rax call rak_value_release jmp short loc_9730 loc_971F: lea rsi, aCannotMultiply; "cannot multiply non-number values" mov rdi, rbx xor eax, eax call rak_error_set loc_9730: cmp byte ptr [rbx], 1 jnz short loc_9765 movzx eax, byte ptr [r15+4] add r15, 4 lea r9, dispatchTable mov rdi, r13 mov rsi, r12 mov rdx, r15 mov rcx, r14 mov r8, rbx add rsp, 10h pop rbx pop r12 pop r13 pop r14 pop r15 jmp ds:(dispatchTable - 0ECF0h)[r9+rax*8] loc_9765: add rsp, 10h pop rbx pop r12 pop r13 pop r14 pop r15 retn
long long do_mul(long long a1, long long a2, long long a3, long long a4, _BYTE *a5) { long long v9; // rax double v10; // rsi long long v11; // rax long long *v12; // rax long long v13; // rdi _DWORD *v14; // rsi long long result; // rax double v16; // [rsp+8h] [rbp-30h] v9 = *(_QWORD *)(a1 + 8); if ( (unsigned int)*(_QWORD *)(v9 - 16) == 2 && *(_DWORD *)v9 == 2 ) { v10 = *(double *)(v9 - 8); v16 = v10 * *(double *)(v9 + 8); rak_value_release(2, *(_DWORD **)&v10); v11 = *(_QWORD *)(a1 + 8); *(_QWORD *)(v11 - 16) = 2LL; *(double *)(v11 - 8) = v16; v12 = *(long long **)(a1 + 8); v13 = *v12; v14 = (_DWORD *)v12[1]; *(_QWORD *)(a1 + 8) = v12 - 2; result = rak_value_release(v13, v14); } else { result = rak_error_set(a5, (long long)"cannot multiply non-number values"); } if ( *a5 == 1 ) ((void ( __noreturn *)(long long, long long, long long))*(&dispatchTable + *(unsigned __int8 *)(a3 + 4)))( a1, a2, a3 + 4); return result; }
do_mul: PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x10 MOV RBX,R8 MOV R14,RCX MOV R15,RDX MOV R12,RSI MOV R13,RDI MOV RAX,qword ptr [RDI + 0x8] MOV RDI,qword ptr [RAX + -0x10] CMP EDI,0x2 JNZ 0x0010971f MOV ECX,dword ptr [RAX] CMP ECX,0x2 JNZ 0x0010971f MOV RSI,qword ptr [RAX + -0x8] MOVQ XMM0,RSI MULSD XMM0,qword ptr [RAX + 0x8] MOVSD qword ptr [RSP + 0x8],XMM0 CALL 0x00108235 MOV RAX,qword ptr [R13 + 0x8] MOV qword ptr [RAX + -0x10],0x2 MOVSD XMM0,qword ptr [RSP + 0x8] MOVSD qword ptr [RAX + -0x8],XMM0 MOV RAX,qword ptr [R13 + 0x8] MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RAX + 0x8] ADD RAX,-0x10 MOV qword ptr [R13 + 0x8],RAX CALL 0x00108235 JMP 0x00109730 LAB_0010971f: LEA RSI,[0x10ab3e] MOV RDI,RBX XOR EAX,EAX CALL 0x0010666c LAB_00109730: CMP byte ptr [RBX],0x1 JNZ 0x00109765 MOVZX EAX,byte ptr [R15 + 0x4] ADD R15,0x4 LEA R9,[0x10ecf0] MOV RDI,R13 MOV RSI,R12 MOV RDX,R15 MOV RCX,R14 MOV R8,RBX ADD RSP,0x10 POP RBX POP R12 POP R13 POP R14 POP R15 JMP qword ptr [R9 + RAX*0x8] LAB_00109765: ADD RSP,0x10 POP RBX POP R12 POP R13 POP R14 POP R15 RET
void do_mul(long param_1,int8 param_2,long param_3,int8 param_4,char *param_5) { double dVar1; int *piVar2; double dVar3; long lVar4; int8 *puVar5; int8 uVar6; int8 uVar7; piVar2 = *(int **)(param_1 + 8); if (((int)*(int8 *)(piVar2 + -4) == 2) && (*piVar2 == 2)) { dVar3 = *(double *)(piVar2 + -2); dVar1 = *(double *)(piVar2 + 2); rak_value_release(); lVar4 = *(long *)(param_1 + 8); *(int8 *)(lVar4 + -0x10) = 2; *(double *)(lVar4 + -8) = dVar3 * dVar1; puVar5 = *(int8 **)(param_1 + 8); uVar6 = *puVar5; uVar7 = puVar5[1]; *(int8 **)(param_1 + 8) = puVar5 + -2; rak_value_release(uVar6,uVar7); } else { rak_error_set(param_5,"cannot multiply non-number values"); } if (*param_5 == '\x01') { /* WARNING: Could not recover jumptable at 0x00109761. Too many branches */ /* WARNING: Treating indirect jump as call */ (**(code **)(dispatchTable + (ulong)*(byte *)(param_3 + 4) * 8)) (param_1,param_2,param_3 + 4,param_4,param_5); return; } return; }
2,955
js_new_std_file
bluesky950520[P]quickjs/quickjs-libc.c
static JSValue js_new_std_file(JSContext *ctx, FILE *f, BOOL is_popen) { JSRuntime *rt = JS_GetRuntime(ctx); JSThreadState *ts = js_get_thread_state(rt); JSSTDFile *s; JSValue obj; obj = JS_NewObjectClass(ctx, ts->std_file_class_id); if (JS_IsException(obj)) return obj; s = js_mallocz(ctx, sizeof(*s)); if (!s) { JS_FreeValue(ctx, obj); return JS_EXCEPTION; } s->is_popen = is_popen; s->f = f; JS_SetOpaque(obj, s); return obj; }
O2
c
js_new_std_file: pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %edx, %ebp movq %rsi, %r15 movq %rdi, %r12 callq 0x1dd35 movq %rax, %rdi callq 0x13e3a movl 0x78(%rax), %esi movq %r12, %rdi callq 0x1ee47 movq %rax, %r14 movq %rdx, %rbx cmpl $0x6, %ebx je 0x14831 pushq $0x10 popq %rsi movq %r12, %rdi callq 0x1adf1 testq %rax, %rax je 0x14853 movl %ebp, 0x8(%rax) movq %r15, (%rax) movq %r14, %rdi movq %rbx, %rsi movq %rax, %rdx callq 0x24d8c movabsq $-0x100000000, %rax # imm = 0xFFFFFFFF00000000 movq %r14, %rcx andq %rax, %rcx movl %r14d, %eax orq %rcx, %rax movq %rbx, %rdx popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq movq %r12, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x1bbce pushq $0x6 popq %rbx xorl %r14d, %r14d xorl %ecx, %ecx jmp 0x14841
js_new_std_file: push rbp push r15 push r14 push r12 push rbx mov ebp, edx mov r15, rsi mov r12, rdi call JS_GetRuntime mov rdi, rax call js_get_thread_state mov esi, [rax+78h] mov rdi, r12 call JS_NewObjectClass mov r14, rax mov rbx, rdx cmp ebx, 6 jz short loc_14831 push 10h pop rsi mov rdi, r12 call js_mallocz test rax, rax jz short loc_14853 mov [rax+8], ebp mov [rax], r15 mov rdi, r14 mov rsi, rbx mov rdx, rax call JS_SetOpaque loc_14831: mov rax, 0FFFFFFFF00000000h mov rcx, r14 and rcx, rax loc_14841: mov eax, r14d or rax, rcx mov rdx, rbx pop rbx pop r12 pop r14 pop r15 pop rbp retn loc_14853: mov rdi, r12 mov rsi, r14 mov rdx, rbx call JS_FreeValue push 6 pop rbx xor r14d, r14d xor ecx, ecx jmp short loc_14841
unsigned long long js_new_std_file(long long a1, long long a2, int a3) { int Runtime; // eax int v5; // edx int v6; // ecx int v7; // r8d int v8; // r9d long long thread_state; // rax long long v10; // r14 long long v11; // rdx long long v12; // rbx long long v13; // rax unsigned long long v14; // rcx char v16; // [rsp+0h] [rbp-28h] Runtime = JS_GetRuntime(a1); thread_state = js_get_thread_state(Runtime, a2, v5, v6, v7, v8, v16); v10 = JS_NewObjectClass(a1, *(unsigned int *)(thread_state + 120)); v12 = v11; if ( (_DWORD)v11 != 6 ) { v13 = js_mallocz(a1, 16LL); if ( !v13 ) { JS_FreeValue(a1, v10); LODWORD(v10) = 0; v14 = 0LL; return v14 | (unsigned int)v10; } *(_DWORD *)(v13 + 8) = a3; *(_QWORD *)v13 = a2; JS_SetOpaque(v10, v12, v13); } v14 = v10 & 0xFFFFFFFF00000000LL; return v14 | (unsigned int)v10; }
js_new_std_file: PUSH RBP PUSH R15 PUSH R14 PUSH R12 PUSH RBX MOV EBP,EDX MOV R15,RSI MOV R12,RDI CALL 0x0011dd35 MOV RDI,RAX CALL 0x00113e3a MOV ESI,dword ptr [RAX + 0x78] MOV RDI,R12 CALL 0x0011ee47 MOV R14,RAX MOV RBX,RDX CMP EBX,0x6 JZ 0x00114831 PUSH 0x10 POP RSI MOV RDI,R12 CALL 0x0011adf1 TEST RAX,RAX JZ 0x00114853 MOV dword ptr [RAX + 0x8],EBP MOV qword ptr [RAX],R15 MOV RDI,R14 MOV RSI,RBX MOV RDX,RAX CALL 0x00124d8c LAB_00114831: MOV RAX,-0x100000000 MOV RCX,R14 AND RCX,RAX LAB_00114841: MOV EAX,R14D OR RAX,RCX MOV RDX,RBX POP RBX POP R12 POP R14 POP R15 POP RBP RET LAB_00114853: MOV RDI,R12 MOV RSI,R14 MOV RDX,RBX CALL 0x0011bbce PUSH 0x6 POP RBX XOR R14D,R14D XOR ECX,ECX JMP 0x00114841
int1 [16] js_new_std_file(int8 param_1,int8 param_2,int4 param_3) { int8 uVar1; long lVar2; int8 *puVar3; ulong uVar4; int1 auVar5 [16]; int1 auVar6 [16]; uVar1 = JS_GetRuntime(); lVar2 = js_get_thread_state(uVar1); auVar5 = JS_NewObjectClass(param_1,*(int4 *)(lVar2 + 0x78)); uVar4 = auVar5._0_8_; if (auVar5._8_4_ != 6) { puVar3 = (int8 *)js_mallocz(param_1,0x10); if (puVar3 == (int8 *)0x0) { JS_FreeValue(param_1,uVar4,auVar5._8_8_); auVar5 = ZEXT816(6) << 0x40; uVar4 = 0; goto LAB_00114841; } *(int4 *)(puVar3 + 1) = param_3; *puVar3 = param_2; JS_SetOpaque(uVar4,auVar5._8_8_,puVar3); } uVar4 = uVar4 & 0xffffffff00000000; LAB_00114841: auVar6._0_8_ = auVar5._0_8_ & 0xffffffff | uVar4; auVar6._8_8_ = auVar5._8_8_; return auVar6; }
2,956
ft_stroke_border_arcto
dmazzella[P]pylunasvg/lunasvg/plutovg/source/plutovg-ft-stroker.c
static PVG_FT_Error ft_stroke_border_arcto( PVG_FT_StrokeBorder border, PVG_FT_Vector* center, PVG_FT_Fixed radius, PVG_FT_Angle angle_start, PVG_FT_Angle angle_diff ) { PVG_FT_Fixed coef; PVG_FT_Vector a0, a1, a2, a3; PVG_FT_Int i, arcs = 1; PVG_FT_Error error = 0; /* number of cubic arcs to draw */ while ( angle_diff > PVG_FT_ARC_CUBIC_ANGLE * arcs || -angle_diff > PVG_FT_ARC_CUBIC_ANGLE * arcs ) arcs++; /* control tangents */ coef = PVG_FT_Tan( angle_diff / ( 4 * arcs ) ); coef += coef / 3; /* compute start and first control point */ PVG_FT_Vector_From_Polar( &a0, radius, angle_start ); a1.x = PVG_FT_MulFix( -a0.y, coef ); a1.y = PVG_FT_MulFix( a0.x, coef ); a0.x += center->x; a0.y += center->y; a1.x += a0.x; a1.y += a0.y; for ( i = 1; i <= arcs; i++ ) { /* compute end and second control point */ PVG_FT_Vector_From_Polar( &a3, radius, angle_start + i * angle_diff / arcs ); a2.x = PVG_FT_MulFix( a3.y, coef ); a2.y = PVG_FT_MulFix( -a3.x, coef ); a3.x += center->x; a3.y += center->y; a2.x += a3.x; a2.y += a3.y; /* add cubic arc */ error = ft_stroke_border_cubicto( border, &a1, &a2, &a3 ); if ( error ) break; /* a0 = a3; */ a1.x = a3.x - a2.x + a3.x; a1.y = a3.y - a2.y + a3.y; } return error; }
O0
c
ft_stroke_border_arcto: pushq %rbp movq %rsp, %rbp subq $0x90, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) movq %r8, -0x28(%rbp) movl $0x1, -0x78(%rbp) movl $0x0, -0x7c(%rbp) movq -0x28(%rbp), %rcx movslq -0x78(%rbp), %rax imulq $0x5a0000, %rax, %rdx # imm = 0x5A0000 movb $0x1, %al cmpq %rdx, %rcx movb %al, -0x7d(%rbp) jg 0x35f30 xorl %eax, %eax subq -0x28(%rbp), %rax movslq -0x78(%rbp), %rcx imulq $0x5a0000, %rcx, %rcx # imm = 0x5A0000 cmpq %rcx, %rax setg %al movb %al, -0x7d(%rbp) movb -0x7d(%rbp), %al testb $0x1, %al jne 0x35f39 jmp 0x35f44 movl -0x78(%rbp), %eax addl $0x1, %eax movl %eax, -0x78(%rbp) jmp 0x35efd movq -0x28(%rbp), %rax movl -0x78(%rbp), %ecx shll $0x2, %ecx movslq %ecx, %rcx cqto idivq %rcx movq %rax, %rdi callq 0x3a090 movq %rax, -0x30(%rbp) movq -0x30(%rbp), %rax movl $0x3, %ecx cqto idivq %rcx addq -0x30(%rbp), %rax movq %rax, -0x30(%rbp) movq -0x18(%rbp), %rsi movq -0x20(%rbp), %rdx leaq -0x40(%rbp), %rdi callq 0x3a7d0 xorl %eax, %eax movl %eax, %edi subq -0x38(%rbp), %rdi movq -0x30(%rbp), %rsi callq 0x39c90 movq %rax, -0x50(%rbp) movq -0x40(%rbp), %rdi movq -0x30(%rbp), %rsi callq 0x39c90 movq %rax, -0x48(%rbp) movq -0x10(%rbp), %rax movq (%rax), %rax addq -0x40(%rbp), %rax movq %rax, -0x40(%rbp) movq -0x10(%rbp), %rax movq 0x8(%rax), %rax addq -0x38(%rbp), %rax movq %rax, -0x38(%rbp) movq -0x40(%rbp), %rax addq -0x50(%rbp), %rax movq %rax, -0x50(%rbp) movq -0x38(%rbp), %rax addq -0x48(%rbp), %rax movq %rax, -0x48(%rbp) movl $0x1, -0x74(%rbp) movl -0x74(%rbp), %eax cmpl -0x78(%rbp), %eax jg 0x360d8 movq -0x18(%rbp), %rsi movq -0x20(%rbp), %rax movq %rax, -0x88(%rbp) movslq -0x74(%rbp), %rax imulq -0x28(%rbp), %rax movslq -0x78(%rbp), %rcx cqto idivq %rcx movq -0x88(%rbp), %rdx addq %rax, %rdx leaq -0x70(%rbp), %rdi callq 0x3a7d0 movq -0x68(%rbp), %rdi movq -0x30(%rbp), %rsi callq 0x39c90 movq %rax, -0x60(%rbp) xorl %eax, %eax movl %eax, %edi subq -0x70(%rbp), %rdi movq -0x30(%rbp), %rsi callq 0x39c90 movq %rax, -0x58(%rbp) movq -0x10(%rbp), %rax movq (%rax), %rax addq -0x70(%rbp), %rax movq %rax, -0x70(%rbp) movq -0x10(%rbp), %rax movq 0x8(%rax), %rax addq -0x68(%rbp), %rax movq %rax, -0x68(%rbp) movq -0x70(%rbp), %rax addq -0x60(%rbp), %rax movq %rax, -0x60(%rbp) movq -0x68(%rbp), %rax addq -0x58(%rbp), %rax movq %rax, -0x58(%rbp) movq -0x8(%rbp), %rdi leaq -0x50(%rbp), %rsi leaq -0x60(%rbp), %rdx leaq -0x70(%rbp), %rcx callq 0x34430 movl %eax, -0x7c(%rbp) cmpl $0x0, -0x7c(%rbp) je 0x360aa jmp 0x360d8 movq -0x70(%rbp), %rax subq -0x60(%rbp), %rax addq -0x70(%rbp), %rax movq %rax, -0x50(%rbp) movq -0x68(%rbp), %rax subq -0x58(%rbp), %rax addq -0x68(%rbp), %rax movq %rax, -0x48(%rbp) movl -0x74(%rbp), %eax addl $0x1, %eax movl %eax, -0x74(%rbp) jmp 0x35fed movl -0x7c(%rbp), %eax addq $0x90, %rsp popq %rbp retq nopw %cs:(%rax,%rax) nop
ft_stroke_border_arcto: push rbp mov rbp, rsp sub rsp, 90h mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov [rbp+var_18], rdx mov [rbp+var_20], rcx mov [rbp+var_28], r8 mov [rbp+var_78], 1 mov [rbp+var_7C], 0 loc_35EFD: mov rcx, [rbp+var_28] movsxd rax, [rbp+var_78] imul rdx, rax, 5A0000h mov al, 1 cmp rcx, rdx mov [rbp+var_7D], al jg short loc_35F30 xor eax, eax sub rax, [rbp+var_28] movsxd rcx, [rbp+var_78] imul rcx, 5A0000h cmp rax, rcx setnle al mov [rbp+var_7D], al loc_35F30: mov al, [rbp+var_7D] test al, 1 jnz short loc_35F39 jmp short loc_35F44 loc_35F39: mov eax, [rbp+var_78] add eax, 1 mov [rbp+var_78], eax jmp short loc_35EFD loc_35F44: mov rax, [rbp+var_28] mov ecx, [rbp+var_78] shl ecx, 2 movsxd rcx, ecx cqo idiv rcx mov rdi, rax call PVG_FT_Tan mov [rbp+var_30], rax mov rax, [rbp+var_30] mov ecx, 3 cqo idiv rcx add rax, [rbp+var_30] mov [rbp+var_30], rax mov rsi, [rbp+var_18] mov rdx, [rbp+var_20] lea rdi, [rbp+var_40] call PVG_FT_Vector_From_Polar xor eax, eax mov edi, eax sub rdi, [rbp+var_38] mov rsi, [rbp+var_30] call PVG_FT_MulFix mov [rbp+var_50], rax mov rdi, [rbp+var_40] mov rsi, [rbp+var_30] call PVG_FT_MulFix mov [rbp+var_48], rax mov rax, [rbp+var_10] mov rax, [rax] add rax, [rbp+var_40] mov [rbp+var_40], rax mov rax, [rbp+var_10] mov rax, [rax+8] add rax, [rbp+var_38] mov [rbp+var_38], rax mov rax, [rbp+var_40] add rax, [rbp+var_50] mov [rbp+var_50], rax mov rax, [rbp+var_38] add rax, [rbp+var_48] mov [rbp+var_48], rax mov [rbp+var_74], 1 loc_35FED: mov eax, [rbp+var_74] cmp eax, [rbp+var_78] jg loc_360D8 mov rsi, [rbp+var_18] mov rax, [rbp+var_20] mov [rbp+var_88], rax movsxd rax, [rbp+var_74] imul rax, [rbp+var_28] movsxd rcx, [rbp+var_78] cqo idiv rcx mov rdx, [rbp+var_88] add rdx, rax lea rdi, [rbp+var_70] call PVG_FT_Vector_From_Polar mov rdi, [rbp+var_68] mov rsi, [rbp+var_30] call PVG_FT_MulFix mov [rbp+var_60], rax xor eax, eax mov edi, eax sub rdi, [rbp+var_70] mov rsi, [rbp+var_30] call PVG_FT_MulFix mov [rbp+var_58], rax mov rax, [rbp+var_10] mov rax, [rax] add rax, [rbp+var_70] mov [rbp+var_70], rax mov rax, [rbp+var_10] mov rax, [rax+8] add rax, [rbp+var_68] mov [rbp+var_68], rax mov rax, [rbp+var_70] add rax, [rbp+var_60] mov [rbp+var_60], rax mov rax, [rbp+var_68] add rax, [rbp+var_58] mov [rbp+var_58], rax mov rdi, [rbp+var_8] lea rsi, [rbp+var_50] lea rdx, [rbp+var_60] lea rcx, [rbp+var_70] call ft_stroke_border_cubicto mov [rbp+var_7C], eax cmp [rbp+var_7C], 0 jz short loc_360AA jmp short loc_360D8 loc_360AA: mov rax, [rbp+var_70] sub rax, [rbp+var_60] add rax, [rbp+var_70] mov [rbp+var_50], rax mov rax, [rbp+var_68] sub rax, [rbp+var_58] add rax, [rbp+var_68] mov [rbp+var_48], rax mov eax, [rbp+var_74] add eax, 1 mov [rbp+var_74], eax jmp loc_35FED loc_360D8: mov eax, [rbp+var_7C] add rsp, 90h pop rbp retn
long long ft_stroke_border_arcto(unsigned int *a1, _QWORD *a2, long long a3, long long a4, long long a5) { long long v5; // rax bool v7; // [rsp+13h] [rbp-7Dh] unsigned int v8; // [rsp+14h] [rbp-7Ch] int v9; // [rsp+18h] [rbp-78h] int i; // [rsp+1Ch] [rbp-74h] long long v11; // [rsp+20h] [rbp-70h] BYREF long long v12; // [rsp+28h] [rbp-68h] long long v13; // [rsp+30h] [rbp-60h] BYREF long long v14; // [rsp+38h] [rbp-58h] long long v15; // [rsp+40h] [rbp-50h] BYREF long long v16; // [rsp+48h] [rbp-48h] long long v17; // [rsp+50h] [rbp-40h] BYREF long long v18; // [rsp+58h] [rbp-38h] long long v19; // [rsp+60h] [rbp-30h] long long v20; // [rsp+68h] [rbp-28h] long long v21; // [rsp+70h] [rbp-20h] long long v22; // [rsp+78h] [rbp-18h] _QWORD *v23; // [rsp+80h] [rbp-10h] unsigned int *v24; // [rsp+88h] [rbp-8h] v24 = a1; v23 = a2; v22 = a3; v21 = a4; v20 = a5; v9 = 1; v8 = 0; while ( 1 ) { v7 = 1; if ( v20 <= 5898240LL * v9 ) v7 = -v20 > 5898240LL * v9; if ( !v7 ) break; ++v9; } v5 = PVG_FT_Tan(v20 / (4 * v9), a2, v20 % (4 * v9)); v19 = v5 + v5 / 3; PVG_FT_Vector_From_Polar(&v17, v22, v21); v15 = PVG_FT_MulFix(-v18, v19); v16 = PVG_FT_MulFix(v17, v19); v17 += *v23; v18 += v23[1]; v15 += v17; v16 += v18; for ( i = 1; i <= v9; ++i ) { PVG_FT_Vector_From_Polar(&v11, v22, v20 * i / v9 + v21); v13 = PVG_FT_MulFix(v12, v19); v14 = PVG_FT_MulFix(-v11, v19); v11 += *v23; v12 += v23[1]; v13 += v11; v14 += v12; v8 = ft_stroke_border_cubicto(v24, &v15, &v13, &v11); if ( v8 ) break; v15 = v11 + v11 - v13; v16 = v12 + v12 - v14; } return v8; }
ft_stroke_border_arcto: PUSH RBP MOV RBP,RSP SUB RSP,0x90 MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV qword ptr [RBP + -0x18],RDX MOV qword ptr [RBP + -0x20],RCX MOV qword ptr [RBP + -0x28],R8 MOV dword ptr [RBP + -0x78],0x1 MOV dword ptr [RBP + -0x7c],0x0 LAB_00135efd: MOV RCX,qword ptr [RBP + -0x28] MOVSXD RAX,dword ptr [RBP + -0x78] IMUL RDX,RAX,0x5a0000 MOV AL,0x1 CMP RCX,RDX MOV byte ptr [RBP + -0x7d],AL JG 0x00135f30 XOR EAX,EAX SUB RAX,qword ptr [RBP + -0x28] MOVSXD RCX,dword ptr [RBP + -0x78] IMUL RCX,RCX,0x5a0000 CMP RAX,RCX SETG AL MOV byte ptr [RBP + -0x7d],AL LAB_00135f30: MOV AL,byte ptr [RBP + -0x7d] TEST AL,0x1 JNZ 0x00135f39 JMP 0x00135f44 LAB_00135f39: MOV EAX,dword ptr [RBP + -0x78] ADD EAX,0x1 MOV dword ptr [RBP + -0x78],EAX JMP 0x00135efd LAB_00135f44: MOV RAX,qword ptr [RBP + -0x28] MOV ECX,dword ptr [RBP + -0x78] SHL ECX,0x2 MOVSXD RCX,ECX CQO IDIV RCX MOV RDI,RAX CALL 0x0013a090 MOV qword ptr [RBP + -0x30],RAX MOV RAX,qword ptr [RBP + -0x30] MOV ECX,0x3 CQO IDIV RCX ADD RAX,qword ptr [RBP + -0x30] MOV qword ptr [RBP + -0x30],RAX MOV RSI,qword ptr [RBP + -0x18] MOV RDX,qword ptr [RBP + -0x20] LEA RDI,[RBP + -0x40] CALL 0x0013a7d0 XOR EAX,EAX MOV EDI,EAX SUB RDI,qword ptr [RBP + -0x38] MOV RSI,qword ptr [RBP + -0x30] CALL 0x00139c90 MOV qword ptr [RBP + -0x50],RAX MOV RDI,qword ptr [RBP + -0x40] MOV RSI,qword ptr [RBP + -0x30] CALL 0x00139c90 MOV qword ptr [RBP + -0x48],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX] ADD RAX,qword ptr [RBP + -0x40] MOV qword ptr [RBP + -0x40],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX + 0x8] ADD RAX,qword ptr [RBP + -0x38] MOV qword ptr [RBP + -0x38],RAX MOV RAX,qword ptr [RBP + -0x40] ADD RAX,qword ptr [RBP + -0x50] MOV qword ptr [RBP + -0x50],RAX MOV RAX,qword ptr [RBP + -0x38] ADD RAX,qword ptr [RBP + -0x48] MOV qword ptr [RBP + -0x48],RAX MOV dword ptr [RBP + -0x74],0x1 LAB_00135fed: MOV EAX,dword ptr [RBP + -0x74] CMP EAX,dword ptr [RBP + -0x78] JG 0x001360d8 MOV RSI,qword ptr [RBP + -0x18] MOV RAX,qword ptr [RBP + -0x20] MOV qword ptr [RBP + -0x88],RAX MOVSXD RAX,dword ptr [RBP + -0x74] IMUL RAX,qword ptr [RBP + -0x28] MOVSXD RCX,dword ptr [RBP + -0x78] CQO IDIV RCX MOV RDX,qword ptr [RBP + -0x88] ADD RDX,RAX LEA RDI,[RBP + -0x70] CALL 0x0013a7d0 MOV RDI,qword ptr [RBP + -0x68] MOV RSI,qword ptr [RBP + -0x30] CALL 0x00139c90 MOV qword ptr [RBP + -0x60],RAX XOR EAX,EAX MOV EDI,EAX SUB RDI,qword ptr [RBP + -0x70] MOV RSI,qword ptr [RBP + -0x30] CALL 0x00139c90 MOV qword ptr [RBP + -0x58],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX] ADD RAX,qword ptr [RBP + -0x70] MOV qword ptr [RBP + -0x70],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX + 0x8] ADD RAX,qword ptr [RBP + -0x68] MOV qword ptr [RBP + -0x68],RAX MOV RAX,qword ptr [RBP + -0x70] ADD RAX,qword ptr [RBP + -0x60] MOV qword ptr [RBP + -0x60],RAX MOV RAX,qword ptr [RBP + -0x68] ADD RAX,qword ptr [RBP + -0x58] MOV qword ptr [RBP + -0x58],RAX MOV RDI,qword ptr [RBP + -0x8] LEA RSI,[RBP + -0x50] LEA RDX,[RBP + -0x60] LEA RCX,[RBP + -0x70] CALL 0x00134430 MOV dword ptr [RBP + -0x7c],EAX CMP dword ptr [RBP + -0x7c],0x0 JZ 0x001360aa JMP 0x001360d8 LAB_001360aa: MOV RAX,qword ptr [RBP + -0x70] SUB RAX,qword ptr [RBP + -0x60] ADD RAX,qword ptr [RBP + -0x70] MOV qword ptr [RBP + -0x50],RAX MOV RAX,qword ptr [RBP + -0x68] SUB RAX,qword ptr [RBP + -0x58] ADD RAX,qword ptr [RBP + -0x68] MOV qword ptr [RBP + -0x48],RAX MOV EAX,dword ptr [RBP + -0x74] ADD EAX,0x1 MOV dword ptr [RBP + -0x74],EAX JMP 0x00135fed LAB_001360d8: MOV EAX,dword ptr [RBP + -0x7c] ADD RSP,0x90 POP RBP RET
int ft_stroke_border_arcto (int8 param_1,long *param_2,int8 param_3,long param_4,long param_5) { bool bVar1; int iVar2; long lVar3; long lVar4; int local_80; int local_7c; long local_78; long local_70; long local_68; long local_60; long local_58; long local_50; long local_48; long local_40; long local_38; long local_30; long local_28; int8 local_20; long *local_18; int8 local_10; local_80 = 1; while( true ) { lVar4 = (long)local_80 * 0x5a0000; bVar1 = true; if (param_5 == lVar4 || SBORROW8(param_5,lVar4) != param_5 + (long)local_80 * -0x5a0000 < 0) { lVar4 = -param_5; lVar3 = (long)local_80 * 0x5a0000; bVar1 = lVar4 != lVar3 && SBORROW8(lVar4,lVar3) == lVar4 + (long)local_80 * -0x5a0000 < 0; } if (!bVar1) break; local_80 = local_80 + 1; } local_30 = param_5; local_28 = param_4; local_20 = param_3; local_18 = param_2; local_10 = param_1; local_38 = PVG_FT_Tan(param_5 / (long)(local_80 << 2),param_2,param_5 % (long)(local_80 << 2)); local_38 = local_38 / 3 + local_38; PVG_FT_Vector_From_Polar(&local_48,local_20,local_28); local_58 = PVG_FT_MulFix(-local_40,local_38); local_50 = PVG_FT_MulFix(local_48,local_38); local_48 = *local_18 + local_48; local_40 = local_18[1] + local_40; local_58 = local_48 + local_58; local_50 = local_40 + local_50; local_7c = 1; while( true ) { if (local_80 < local_7c) { return 0; } PVG_FT_Vector_From_Polar(&local_78,local_20,local_28 + (local_7c * local_30) / (long)local_80); local_68 = PVG_FT_MulFix(local_70,local_38); local_60 = PVG_FT_MulFix(-local_78,local_38); local_78 = *local_18 + local_78; local_70 = local_18[1] + local_70; local_68 = local_78 + local_68; local_60 = local_70 + local_60; iVar2 = ft_stroke_border_cubicto(local_10,&local_58,&local_68,&local_78); if (iVar2 != 0) break; local_58 = local_78 * 2 - local_68; local_50 = local_70 * 2 - local_60; local_7c = local_7c + 1; } return iVar2; }
2,957
common_arg::common_arg(std::initializer_list<char const*> const&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, void (*)(common_params&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))
llama.cpp/common/arg.h
common_arg( const std::initializer_list<const char *> & args, const char * value_hint, const std::string & help, void (*handler)(common_params & params, const std::string &) ) : args(args), value_hint(value_hint), help(help), handler_string(handler) {}
O3
c
common_arg::common_arg(std::initializer_list<char const*> const&, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, void (*)(common_params&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %rbp movq %rdi, %rbx leaq 0x4(%rsp), %rsi movl $0x0, (%rsi) leaq 0x3(%rsp), %rcx leaq 0x2(%rsp), %r8 movl $0x1, %edx callq 0x875f0 leaq 0x38(%rbx), %rax xorl %ecx, %ecx movq %rcx, 0x40(%rbx) xorps %xmm0, %xmm0 movups %xmm0, 0x30(%rbx) movq %rax, 0x48(%rbx) movq %rax, 0x50(%rbx) movq %rcx, 0x58(%rbx) leaq 0x60(%rbx), %r13 movq (%rbp), %rsi movq 0x8(%rbp), %rdx leaq 0x1(%rsp), %rcx movq %r13, %rdi callq 0x87672 movq %r12, 0x78(%rbx) leaq 0x90(%rbx), %rdi leaq 0xa0(%rbx), %rax xorps %xmm0, %xmm0 movups %xmm0, 0x80(%rbx) movq %rax, 0x90(%rbx) movq (%r15), %rsi movq 0x8(%r15), %rdx addq %rsi, %rdx callq 0x2c6a6 movb $0x0, 0xb0(%rbx) movq $0x0, 0xb8(%rbx) movq %r14, 0xc0(%rbx) xorps %xmm0, %xmm0 movups %xmm0, 0xc8(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rax, %r14 movq (%r13), %rdi testq %rdi, %rdi je 0x68578 movq 0x70(%rbx), %rsi subq %rdi, %rsi callq 0x211a0 jmp 0x68578 movq %rax, %r14 leaq 0x30(%rbx), %rdi callq 0x876b8 movq %rbx, %rdi callq 0x876b8 movq %r14, %rdi callq 0x21c10 nop
_ZN10common_argC2ERKSt16initializer_listIPKcES2_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPFvR13common_paramsSD_E: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov r14, r8 mov r15, rcx mov r12, rdx mov rbp, rsi mov rbx, rdi lea rsi, [rsp+38h+var_34] mov dword ptr [rsi], 0 lea rcx, [rsp+38h+var_35] lea r8, [rsp+38h+var_36] mov edx, 1 call _ZNSt3setI13llama_exampleSt4lessIS0_ESaIS0_EEC2ESt16initializer_listIS0_ERKS2_RKS3_; std::set<llama_example>::set(std::initializer_list<llama_example>,std::less<llama_example> const&,std::allocator<llama_example> const&) lea rax, [rbx+38h] xor ecx, ecx mov [rbx+40h], rcx xorps xmm0, xmm0 movups xmmword ptr [rbx+30h], xmm0 mov [rbx+48h], rax mov [rbx+50h], rax mov [rbx+58h], rcx lea r13, [rbx+60h] mov rsi, [rbp+0] mov rdx, [rbp+8] lea rcx, [rsp+38h+var_37] mov rdi, r13 call _ZNSt6vectorIPKcSaIS1_EEC2ESt16initializer_listIS1_ERKS2_; std::vector<char const*>::vector(std::initializer_list<char const*>,std::allocator<char const*> const&) mov [rbx+78h], r12 lea rdi, [rbx+90h] lea rax, [rbx+0A0h] xorps xmm0, xmm0 movups xmmword ptr [rbx+80h], xmm0 mov [rbx+90h], rax mov rsi, [r15] mov rdx, [r15+8] add rdx, rsi call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag; std::string::_M_construct<char *>(char *,char *,std::forward_iterator_tag) mov byte ptr [rbx+0B0h], 0 mov qword ptr [rbx+0B8h], 0 mov [rbx+0C0h], r14 xorps xmm0, xmm0 movups xmmword ptr [rbx+0C8h], xmm0 add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn mov r14, rax mov rdi, [r13+0]; void * test rdi, rdi jz short loc_68578 mov rsi, [rbx+70h] sub rsi, rdi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) jmp short loc_68578 mov r14, rax loc_68578: lea rdi, [rbx+30h] call _ZNSt8_Rb_treeI13llama_exampleS0_St9_IdentityIS0_ESt4lessIS0_ESaIS0_EED2Ev; std::_Rb_tree<llama_example,llama_example,std::_Identity<llama_example>,std::less<llama_example>,std::allocator<llama_example>>::~_Rb_tree() mov rdi, rbx call _ZNSt8_Rb_treeI13llama_exampleS0_St9_IdentityIS0_ESt4lessIS0_ESaIS0_EED2Ev; std::_Rb_tree<llama_example,llama_example,std::_Identity<llama_example>,std::less<llama_example>,std::allocator<llama_example>>::~_Rb_tree() mov rdi, r14 call __Unwind_Resume
long long common_arg::common_arg(long long a1, _QWORD *a2, long long a3, long long a4, long long a5) { int v5; // eax long long result; // rax int v10; // [rsp+0h] [rbp-38h] BYREF _DWORD v11[13]; // [rsp+4h] [rbp-34h] BYREF v10 = v5; v11[0] = 0; std::set<llama_example>::set(a1, v11, 1LL, (char *)&v10 + 3, (char *)&v10 + 2); *(_QWORD *)(a1 + 64) = 0LL; *(_OWORD *)(a1 + 48) = 0LL; *(_QWORD *)(a1 + 72) = a1 + 56; *(_QWORD *)(a1 + 80) = a1 + 56; *(_QWORD *)(a1 + 88) = 0LL; std::vector<char const*>::vector(a1 + 96, *a2, a2[1], (char *)&v10 + 1); *(_QWORD *)(a1 + 120) = a3; *(_OWORD *)(a1 + 128) = 0LL; *(_QWORD *)(a1 + 144) = a1 + 160; result = std::string::_M_construct<char *>(a1 + 144, *(_BYTE **)a4, *(_QWORD *)a4 + *(_QWORD *)(a4 + 8)); *(_BYTE *)(a1 + 176) = 0; *(_QWORD *)(a1 + 184) = 0LL; *(_QWORD *)(a1 + 192) = a5; *(_OWORD *)(a1 + 200) = 0LL; return result; }
common_arg: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV R14,R8 MOV R15,RCX MOV R12,RDX MOV RBP,RSI MOV RBX,RDI LEA RSI,[RSP + 0x4] MOV dword ptr [RSI],0x0 LEA RCX,[RSP + 0x3] LEA R8,[RSP + 0x2] MOV EDX,0x1 CALL 0x001875f0 LEA RAX,[RBX + 0x38] XOR ECX,ECX MOV qword ptr [RBX + 0x40],RCX XORPS XMM0,XMM0 MOVUPS xmmword ptr [RBX + 0x30],XMM0 MOV qword ptr [RBX + 0x48],RAX MOV qword ptr [RBX + 0x50],RAX MOV qword ptr [RBX + 0x58],RCX LEA R13,[RBX + 0x60] MOV RSI,qword ptr [RBP] MOV RDX,qword ptr [RBP + 0x8] LAB_001684ea: LEA RCX,[RSP + 0x1] MOV RDI,R13 CALL 0x00187672 MOV qword ptr [RBX + 0x78],R12 LEA RDI,[RBX + 0x90] LEA RAX,[RBX + 0xa0] XORPS XMM0,XMM0 MOVUPS xmmword ptr [RBX + 0x80],XMM0 MOV qword ptr [RBX + 0x90],RAX MOV RSI,qword ptr [R15] MOV RDX,qword ptr [R15 + 0x8] ADD RDX,RSI LAB_00168524: CALL 0x0012c6a6 LAB_00168529: MOV byte ptr [RBX + 0xb0],0x0 MOV qword ptr [RBX + 0xb8],0x0 MOV qword ptr [RBX + 0xc0],R14 XORPS XMM0,XMM0 MOVUPS xmmword ptr [RBX + 0xc8],XMM0 ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* common_arg::common_arg(std::initializer_list<char const*> const&, char const*, std::__cxx11::string const&, void (*)(common_params&, std::__cxx11::string const&)) */ void __thiscall common_arg::common_arg (common_arg *this,initializer_list *param_1,char *param_2,string *param_3, _func_void_common_params_ptr_string_ptr *param_4) { int4 in_EAX; int8 in_R9; std::set<llama_example,std::less<llama_example>,std::allocator<llama_example>>::set (this,&stack0xffffffffffffffcc,1,&stack0xffffffffffffffcb,&stack0xffffffffffffffca,in_R9 ,in_EAX); *(int8 *)(this + 0x40) = 0; *(int8 *)(this + 0x30) = 0; *(int8 *)(this + 0x38) = 0; *(common_arg **)(this + 0x48) = this + 0x38; *(common_arg **)(this + 0x50) = this + 0x38; *(int8 *)(this + 0x58) = 0; /* try { // try from 001684ea to 001684f6 has its CatchHandler @ 00168575 */ std::vector<char_const*,std::allocator<char_const*>>::vector ((vector<char_const*,std::allocator<char_const*>> *)(this + 0x60),*(int8 *)param_1 ,*(int8 *)(param_1 + 8),&stack0xffffffffffffffc9); *(char **)(this + 0x78) = param_2; *(int8 *)(this + 0x80) = 0; *(int8 *)(this + 0x88) = 0; *(common_arg **)(this + 0x90) = this + 0xa0; /* try { // try from 00168524 to 00168528 has its CatchHandler @ 0016855b */ std::__cxx11::string::_M_construct<char*> (this + 0x90,*(long *)param_3,*(long *)(param_3 + 8) + *(long *)param_3); this[0xb0] = (common_arg)0x0; *(int8 *)(this + 0xb8) = 0; *(_func_void_common_params_ptr_string_ptr **)(this + 0xc0) = param_4; *(int8 *)(this + 200) = 0; *(int8 *)(this + 0xd0) = 0; return; }
2,958
uf_space_prespace_selected
eloqsql/storage/maria/ma_packrec.c
static void uf_space_prespace_selected(MARIA_COLUMNDEF *rec, MARIA_BIT_BUFF *bit_buff, uchar *to, uchar *end) { uint spaces; if (get_bit(bit_buff)) bfill(to, (end-to), ' '); else { if (get_bit(bit_buff)) { if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end) { bit_buff->error=1; return; } bfill(to, spaces, ' '); if (to+spaces != end) decode_bytes(rec,bit_buff,to+spaces,end); } else decode_bytes(rec,bit_buff,to,end); } }
O3
c
uf_space_prespace_selected: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdx, %r12 movq %rsi, %r14 movq %rdi, %r13 movl 0x4(%rsi), %eax testl %eax, %eax je 0x65f90 movl (%r14), %r15d decl %eax movl %eax, 0x4(%r14) btl %eax, %r15d jb 0x66005 testl %eax, %eax jne 0x65fad movq %r14, %rdi callq 0x656a4 movl $0x1f, 0x4(%r14) movl (%r14), %r15d testl %r15d, %r15d jns 0x66026 movl $0x1f, %eax jmp 0x65fb9 movq %r14, %rdi callq 0x656a4 movl $0x1f, 0x4(%r14) movl (%r14), %r15d movl $0x1f, %eax testl %r15d, %r15d js 0x66005 decl %eax movl %eax, 0x4(%r14) btl %eax, %r15d jae 0x66026 movq %r13, %rdx movl 0x24(%r13), %r13d movl %eax, %ecx subl %r13d, %ecx movq %rdx, -0x30(%rbp) jae 0x66031 subl %eax, %r13d movl %eax, %eax leaq 0x9f629(%rip), %rcx # 0x105600 andl (%rcx,%rax,4), %r15d movl %r13d, %ecx shll %cl, %r15d movq %r14, %rdi callq 0x656a4 movl $0x20, %eax subl %r13d, %eax movl %eax, 0x4(%r14) movl (%r14), %eax negl %r13d movl %r13d, %ecx shrl %cl, %eax addl %eax, %r15d jmp 0x66046 subq %r12, %rbx movq %r12, %rdi movl $0x20, %esi movq %rbx, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x2a2e0 movq %r13, %rdi movq %r14, %rsi movq %r12, %rdx jmp 0x66078 movl %ecx, 0x4(%r14) shrl %cl, %r15d movl 0x24(%rdx), %eax leaq 0x9f5be(%rip), %rcx # 0x105600 andl (%rcx,%rax,4), %r15d movl %r15d, %edx leaq (%r12,%rdx), %r13 cmpq %rbx, %r13 jbe 0x6605c movl $0x1, 0x28(%r14) jmp 0x6608e movq %r12, %rdi movl $0x20, %esi callq 0x2a2e0 cmpq %rbx, %r13 je 0x6608e movq -0x30(%rbp), %rdi movq %r14, %rsi movq %r13, %rdx movq %rbx, %rcx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x65861 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
uf_space_prespace_selected: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx push rax mov rbx, rcx mov r12, rdx mov r14, rsi mov r13, rdi mov eax, [rsi+4] test eax, eax jz short loc_65F90 mov r15d, [r14] dec eax mov [r14+4], eax bt r15d, eax jb loc_66005 test eax, eax jnz short loc_65FAD mov rdi, r14 call fill_buffer mov dword ptr [r14+4], 1Fh mov r15d, [r14] test r15d, r15d jns loc_66026 mov eax, 1Fh jmp short loc_65FB9 loc_65F90: mov rdi, r14 call fill_buffer mov dword ptr [r14+4], 1Fh mov r15d, [r14] mov eax, 1Fh test r15d, r15d js short loc_66005 loc_65FAD: dec eax mov [r14+4], eax bt r15d, eax jnb short loc_66026 loc_65FB9: mov rdx, r13 mov r13d, [r13+24h] mov ecx, eax sub ecx, r13d mov [rbp+var_30], rdx jnb short loc_66031 sub r13d, eax mov eax, eax lea rcx, mask and r15d, [rcx+rax*4] mov ecx, r13d shl r15d, cl mov rdi, r14 call fill_buffer mov eax, 20h ; ' ' sub eax, r13d mov [r14+4], eax mov eax, [r14] neg r13d mov ecx, r13d shr eax, cl add r15d, eax jmp short loc_66046 loc_66005: sub rbx, r12 mov rdi, r12 mov esi, 20h ; ' ' mov rdx, rbx add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp jmp _memset loc_66026: mov rdi, r13 mov rsi, r14 mov rdx, r12 jmp short loc_66078 loc_66031: mov [r14+4], ecx shr r15d, cl mov eax, [rdx+24h] lea rcx, mask and r15d, [rcx+rax*4] loc_66046: mov edx, r15d lea r13, [r12+rdx] cmp r13, rbx jbe short loc_6605C mov dword ptr [r14+28h], 1 jmp short loc_6608E loc_6605C: mov rdi, r12 mov esi, 20h ; ' ' call _memset cmp r13, rbx jz short loc_6608E mov rdi, [rbp+var_30] mov rsi, r14 mov rdx, r13 loc_66078: mov rcx, rbx add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp jmp decode_bytes loc_6608E: add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long uf_space_prespace_selected(long long a1, unsigned int *a2, _BYTE *a3, _BYTE *a4) { unsigned int v6; // eax unsigned int v7; // r15d unsigned int v8; // eax unsigned int v9; // eax unsigned int v10; // r13d unsigned int v11; // ecx int v12; // r13d int v13; // r15d long long result; // rax unsigned int v15; // r15d _BYTE *v16; // rdx _BYTE *v17; // r13 v6 = a2[1]; if ( !v6 ) { fill_buffer((long long)a2); a2[1] = 31; v7 = *a2; v8 = 31; if ( (*a2 & 0x80000000) == 0 ) goto LABEL_7; return memset(a3, 32LL, a4 - a3); } v7 = *a2; v8 = v6 - 1; a2[1] = v8; if ( _bittest((const int *)&v7, v8) ) return memset(a3, 32LL, a4 - a3); if ( !v8 ) { fill_buffer((long long)a2); a2[1] = 31; v7 = *a2; if ( (*a2 & 0x80000000) != 0 ) { v9 = 31; goto LABEL_8; } LABEL_11: v16 = a3; return (long long)decode_bytes(a1, (long long)a2, v16, a4); } LABEL_7: v9 = v8 - 1; a2[1] = v9; if ( !_bittest((const int *)&v7, v9) ) goto LABEL_11; LABEL_8: v10 = *(_DWORD *)(a1 + 36); v11 = v9 - v10; if ( v9 >= v10 ) { a2[1] = v11; result = *(unsigned int *)(a1 + 36); v15 = mask[result] & (v7 >> v11); } else { v12 = v10 - v9; v13 = (mask[v9] & v7) << v12; fill_buffer((long long)a2); a2[1] = 32 - v12; result = *a2 >> -(char)v12; v15 = result + v13; } v17 = &a3[v15]; if ( v17 > a4 ) { a2[10] = 1; return result; } result = memset(a3, 32LL, v15); if ( v17 != a4 ) { v16 = &a3[v15]; return (long long)decode_bytes(a1, (long long)a2, v16, a4); } return result; }
uf_space_prespace_selected: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV RBX,RCX MOV R12,RDX MOV R14,RSI MOV R13,RDI MOV EAX,dword ptr [RSI + 0x4] TEST EAX,EAX JZ 0x00165f90 MOV R15D,dword ptr [R14] DEC EAX MOV dword ptr [R14 + 0x4],EAX BT R15D,EAX JC 0x00166005 TEST EAX,EAX JNZ 0x00165fad MOV RDI,R14 CALL 0x001656a4 MOV dword ptr [R14 + 0x4],0x1f MOV R15D,dword ptr [R14] TEST R15D,R15D JNS 0x00166026 MOV EAX,0x1f JMP 0x00165fb9 LAB_00165f90: MOV RDI,R14 CALL 0x001656a4 MOV dword ptr [R14 + 0x4],0x1f MOV R15D,dword ptr [R14] MOV EAX,0x1f TEST R15D,R15D JS 0x00166005 LAB_00165fad: DEC EAX MOV dword ptr [R14 + 0x4],EAX BT R15D,EAX JNC 0x00166026 LAB_00165fb9: MOV RDX,R13 MOV R13D,dword ptr [R13 + 0x24] MOV ECX,EAX SUB ECX,R13D MOV qword ptr [RBP + -0x30],RDX JNC 0x00166031 SUB R13D,EAX MOV EAX,EAX LEA RCX,[0x205600] AND R15D,dword ptr [RCX + RAX*0x4] MOV ECX,R13D SHL R15D,CL MOV RDI,R14 CALL 0x001656a4 MOV EAX,0x20 SUB EAX,R13D MOV dword ptr [R14 + 0x4],EAX MOV EAX,dword ptr [R14] NEG R13D MOV ECX,R13D SHR EAX,CL ADD R15D,EAX JMP 0x00166046 LAB_00166005: SUB RBX,R12 MOV RDI,R12 MOV ESI,0x20 MOV RDX,RBX ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP JMP 0x0012a2e0 LAB_00166026: MOV RDI,R13 MOV RSI,R14 MOV RDX,R12 JMP 0x00166078 LAB_00166031: MOV dword ptr [R14 + 0x4],ECX SHR R15D,CL MOV EAX,dword ptr [RDX + 0x24] LEA RCX,[0x205600] AND R15D,dword ptr [RCX + RAX*0x4] LAB_00166046: MOV EDX,R15D LEA R13,[R12 + RDX*0x1] CMP R13,RBX JBE 0x0016605c MOV dword ptr [R14 + 0x28],0x1 JMP 0x0016608e LAB_0016605c: MOV RDI,R12 MOV ESI,0x20 CALL 0x0012a2e0 CMP R13,RBX JZ 0x0016608e MOV RDI,qword ptr [RBP + -0x30] MOV RSI,R14 MOV RDX,R13 LAB_00166078: MOV RCX,RBX ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP JMP 0x00165861 LAB_0016608e: ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
void uf_space_prespace_selected(long param_1,uint *param_2,void *param_3,void *param_4) { uint uVar1; uint uVar2; uint uVar3; byte bVar4; void *pvVar5; uint uVar6; pvVar5 = param_3; if (param_2[1] == 0) { fill_buffer(param_2); param_2[1] = 0x1f; uVar6 = *param_2; uVar3 = 0x1f; if ((int)uVar6 < 0) goto LAB_00166005; LAB_00165fad: uVar3 = uVar3 - 1; param_2[1] = uVar3; if ((uVar6 >> (uVar3 & 0x1f) & 1) == 0) goto LAB_00166078; } else { uVar6 = *param_2; uVar3 = param_2[1] - 1; param_2[1] = uVar3; if ((uVar6 >> (uVar3 & 0x1f) & 1) != 0) { LAB_00166005: memset(param_3,0x20,(long)param_4 - (long)param_3); return; } if (uVar3 != 0) goto LAB_00165fad; fill_buffer(param_2); param_2[1] = 0x1f; uVar6 = *param_2; if (-1 < (int)uVar6) goto LAB_00166078; uVar3 = 0x1f; } uVar1 = *(uint *)(param_1 + 0x24); if (uVar3 < uVar1) { uVar2 = (&mask)[uVar3]; bVar4 = (byte)(uVar1 - uVar3); fill_buffer(param_2); param_2[1] = 0x20 - (uVar1 - uVar3); uVar6 = ((uVar6 & uVar2) << (bVar4 & 0x1f)) + (*param_2 >> (-bVar4 & 0x1f)); } else { param_2[1] = uVar3 - uVar1; uVar6 = uVar6 >> ((byte)(uVar3 - uVar1) & 0x1f) & (&mask)[*(uint *)(param_1 + 0x24)]; } pvVar5 = (void *)((long)param_3 + (ulong)uVar6); if (param_4 < pvVar5) { param_2[10] = 1; } else { memset(param_3,0x20,(ulong)uVar6); if (pvVar5 != param_4) { LAB_00166078: decode_bytes(param_1,param_2,pvVar5,param_4); return; } } return; }
2,959
my_strxfrm_desc_and_reverse
eloqsql/strings/ctype-simple.c
void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend, uint flags, uint level) { if (flags & (MY_STRXFRM_DESC_LEVEL1 << level)) { if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level)) { for (strend--; str <= strend;) { uchar tmp= *str; *str++= ~*strend; *strend--= ~tmp; } } else { for (; str < strend; str++) *str= ~*str; } } else if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level)) { for (strend--; str < strend;) { uchar tmp= *str; *str++= *strend; *strend--= tmp; } } }
O0
c
my_strxfrm_desc_and_reverse: pushq %rbp movq %rsp, %rbp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movl %ecx, -0x18(%rbp) movl -0x14(%rbp), %eax movl -0x18(%rbp), %ecx movl $0x100, %edx # imm = 0x100 shll %cl, %edx movl %edx, %ecx andl %ecx, %eax cmpl $0x0, %eax je 0x4bf2c movl -0x14(%rbp), %eax movl -0x18(%rbp), %ecx movl $0x10000, %edx # imm = 0x10000 shll %cl, %edx movl %edx, %ecx andl %ecx, %eax cmpl $0x0, %eax je 0x4befc movq -0x10(%rbp), %rax addq $-0x1, %rax movq %rax, -0x10(%rbp) movq -0x8(%rbp), %rax cmpq -0x10(%rbp), %rax ja 0x4befa movq -0x8(%rbp), %rax movb (%rax), %al movb %al, -0x19(%rbp) movq -0x10(%rbp), %rax movzbl (%rax), %eax xorl $-0x1, %eax movb %al, %cl movq -0x8(%rbp), %rax movq %rax, %rdx addq $0x1, %rdx movq %rdx, -0x8(%rbp) movb %cl, (%rax) movzbl -0x19(%rbp), %eax xorl $-0x1, %eax movb %al, %cl movq -0x10(%rbp), %rax movq %rax, %rdx addq $-0x1, %rdx movq %rdx, -0x10(%rbp) movb %cl, (%rax) jmp 0x4beae jmp 0x4bf2a jmp 0x4befe movq -0x8(%rbp), %rax cmpq -0x10(%rbp), %rax jae 0x4bf28 movq -0x8(%rbp), %rax movzbl (%rax), %eax xorl $-0x1, %eax movb %al, %cl movq -0x8(%rbp), %rax movb %cl, (%rax) movq -0x8(%rbp), %rax addq $0x1, %rax movq %rax, -0x8(%rbp) jmp 0x4befe jmp 0x4bf2a jmp 0x4bf92 movl -0x14(%rbp), %eax movl -0x18(%rbp), %ecx movl $0x10000, %edx # imm = 0x10000 shll %cl, %edx movl %edx, %ecx andl %ecx, %eax cmpl $0x0, %eax je 0x4bf90 movq -0x10(%rbp), %rax addq $-0x1, %rax movq %rax, -0x10(%rbp) movq -0x8(%rbp), %rax cmpq -0x10(%rbp), %rax jae 0x4bf8e movq -0x8(%rbp), %rax movb (%rax), %al movb %al, -0x1a(%rbp) movq -0x10(%rbp), %rax movb (%rax), %cl movq -0x8(%rbp), %rax movq %rax, %rdx addq $0x1, %rdx movq %rdx, -0x8(%rbp) movb %cl, (%rax) movb -0x1a(%rbp), %cl movq -0x10(%rbp), %rax movq %rax, %rdx addq $-0x1, %rdx movq %rdx, -0x10(%rbp) movb %cl, (%rax) jmp 0x4bf4e jmp 0x4bf90 jmp 0x4bf92 popq %rbp retq nopw %cs:(%rax,%rax)
my_strxfrm_desc_and_reverse: push rbp mov rbp, rsp mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov [rbp+var_14], edx mov [rbp+var_18], ecx mov eax, [rbp+var_14] mov ecx, [rbp+var_18] mov edx, 100h shl edx, cl mov ecx, edx and eax, ecx cmp eax, 0 jz loc_4BF2C mov eax, [rbp+var_14] mov ecx, [rbp+var_18] mov edx, offset stru_10000 shl edx, cl mov ecx, edx and eax, ecx cmp eax, 0 jz short loc_4BEFC mov rax, [rbp+var_10] add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_10], rax loc_4BEAE: mov rax, [rbp+var_8] cmp rax, [rbp+var_10] ja short loc_4BEFA mov rax, [rbp+var_8] mov al, [rax] mov [rbp+var_19], al mov rax, [rbp+var_10] movzx eax, byte ptr [rax] xor eax, 0FFFFFFFFh mov cl, al mov rax, [rbp+var_8] mov rdx, rax add rdx, 1 mov [rbp+var_8], rdx mov [rax], cl movzx eax, [rbp+var_19] xor eax, 0FFFFFFFFh mov cl, al mov rax, [rbp+var_10] mov rdx, rax add rdx, 0FFFFFFFFFFFFFFFFh mov [rbp+var_10], rdx mov [rax], cl jmp short loc_4BEAE loc_4BEFA: jmp short loc_4BF2A loc_4BEFC: jmp short $+2 loc_4BEFE: mov rax, [rbp+var_8] cmp rax, [rbp+var_10] jnb short loc_4BF28 mov rax, [rbp+var_8] movzx eax, byte ptr [rax] xor eax, 0FFFFFFFFh mov cl, al mov rax, [rbp+var_8] mov [rax], cl mov rax, [rbp+var_8] add rax, 1 mov [rbp+var_8], rax jmp short loc_4BEFE loc_4BF28: jmp short $+2 loc_4BF2A: jmp short loc_4BF92 loc_4BF2C: mov eax, [rbp+var_14] mov ecx, [rbp+var_18] mov edx, offset stru_10000 shl edx, cl mov ecx, edx and eax, ecx cmp eax, 0 jz short loc_4BF90 mov rax, [rbp+var_10] add rax, 0FFFFFFFFFFFFFFFFh mov [rbp+var_10], rax loc_4BF4E: mov rax, [rbp+var_8] cmp rax, [rbp+var_10] jnb short loc_4BF8E mov rax, [rbp+var_8] mov al, [rax] mov [rbp+var_1A], al mov rax, [rbp+var_10] mov cl, [rax] mov rax, [rbp+var_8] mov rdx, rax add rdx, 1 mov [rbp+var_8], rdx mov [rax], cl mov cl, [rbp+var_1A] mov rax, [rbp+var_10] mov rdx, rax add rdx, 0FFFFFFFFFFFFFFFFh mov [rbp+var_10], rdx mov [rax], cl jmp short loc_4BF4E loc_4BF8E: jmp short $+2 loc_4BF90: jmp short $+2 loc_4BF92: pop rbp retn
unsigned long long my_strxfrm_desc_and_reverse(char *a1, unsigned long long a2, unsigned int a3, char a4) { unsigned long long result; // rax char *v5; // rax char *v6; // rax char *v7; // rax char *v8; // rax char v9; // [rsp+0h] [rbp-1Ah] char v10; // [rsp+1h] [rbp-19h] char *i; // [rsp+Ah] [rbp-10h] char *j; // [rsp+Ah] [rbp-10h] if ( ((256 << a4) & a3) != 0 ) { if ( (((_DWORD)&stru_10000 << a4) & a3) != 0 ) { for ( i = (char *)(a2 - 1); ; --i ) { result = (unsigned long long)a1; if ( a1 > i ) break; v10 = *a1; v5 = a1++; *v5 = ~*i; v6 = i; *v6 = ~v10; } } else { while ( 1 ) { result = (unsigned long long)a1; if ( (unsigned long long)a1 >= a2 ) break; *a1 = ~*a1; ++a1; } } } else { result = ((_DWORD)&stru_10000 << a4) & a3; if ( (_DWORD)result ) { for ( j = (char *)(a2 - 1); ; --j ) { result = (unsigned long long)a1; if ( a1 >= j ) break; v9 = *a1; v7 = a1++; *v7 = *j; v8 = j; *v8 = v9; } } } return result; }
my_strxfrm_desc_and_reverse: PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV dword ptr [RBP + -0x14],EDX MOV dword ptr [RBP + -0x18],ECX MOV EAX,dword ptr [RBP + -0x14] MOV ECX,dword ptr [RBP + -0x18] MOV EDX,0x100 SHL EDX,CL MOV ECX,EDX AND EAX,ECX CMP EAX,0x0 JZ 0x0014bf2c MOV EAX,dword ptr [RBP + -0x14] MOV ECX,dword ptr [RBP + -0x18] MOV EDX,0x10000 SHL EDX,CL MOV ECX,EDX AND EAX,ECX CMP EAX,0x0 JZ 0x0014befc MOV RAX,qword ptr [RBP + -0x10] ADD RAX,-0x1 MOV qword ptr [RBP + -0x10],RAX LAB_0014beae: MOV RAX,qword ptr [RBP + -0x8] CMP RAX,qword ptr [RBP + -0x10] JA 0x0014befa MOV RAX,qword ptr [RBP + -0x8] MOV AL,byte ptr [RAX] MOV byte ptr [RBP + -0x19],AL MOV RAX,qword ptr [RBP + -0x10] MOVZX EAX,byte ptr [RAX] XOR EAX,0xffffffff MOV CL,AL MOV RAX,qword ptr [RBP + -0x8] MOV RDX,RAX ADD RDX,0x1 MOV qword ptr [RBP + -0x8],RDX MOV byte ptr [RAX],CL MOVZX EAX,byte ptr [RBP + -0x19] XOR EAX,0xffffffff MOV CL,AL MOV RAX,qword ptr [RBP + -0x10] MOV RDX,RAX ADD RDX,-0x1 MOV qword ptr [RBP + -0x10],RDX MOV byte ptr [RAX],CL JMP 0x0014beae LAB_0014befa: JMP 0x0014bf2a LAB_0014befc: JMP 0x0014befe LAB_0014befe: MOV RAX,qword ptr [RBP + -0x8] CMP RAX,qword ptr [RBP + -0x10] JNC 0x0014bf28 MOV RAX,qword ptr [RBP + -0x8] MOVZX EAX,byte ptr [RAX] XOR EAX,0xffffffff MOV CL,AL MOV RAX,qword ptr [RBP + -0x8] MOV byte ptr [RAX],CL MOV RAX,qword ptr [RBP + -0x8] ADD RAX,0x1 MOV qword ptr [RBP + -0x8],RAX JMP 0x0014befe LAB_0014bf28: JMP 0x0014bf2a LAB_0014bf2a: JMP 0x0014bf92 LAB_0014bf2c: MOV EAX,dword ptr [RBP + -0x14] MOV ECX,dword ptr [RBP + -0x18] MOV EDX,0x10000 SHL EDX,CL MOV ECX,EDX AND EAX,ECX CMP EAX,0x0 JZ 0x0014bf90 MOV RAX,qword ptr [RBP + -0x10] ADD RAX,-0x1 MOV qword ptr [RBP + -0x10],RAX LAB_0014bf4e: MOV RAX,qword ptr [RBP + -0x8] CMP RAX,qword ptr [RBP + -0x10] JNC 0x0014bf8e MOV RAX,qword ptr [RBP + -0x8] MOV AL,byte ptr [RAX] MOV byte ptr [RBP + -0x1a],AL MOV RAX,qword ptr [RBP + -0x10] MOV CL,byte ptr [RAX] MOV RAX,qword ptr [RBP + -0x8] MOV RDX,RAX ADD RDX,0x1 MOV qword ptr [RBP + -0x8],RDX MOV byte ptr [RAX],CL MOV CL,byte ptr [RBP + -0x1a] MOV RAX,qword ptr [RBP + -0x10] MOV RDX,RAX ADD RDX,-0x1 MOV qword ptr [RBP + -0x10],RDX MOV byte ptr [RAX],CL JMP 0x0014bf4e LAB_0014bf8e: JMP 0x0014bf90 LAB_0014bf90: JMP 0x0014bf92 LAB_0014bf92: POP RBP RET
void my_strxfrm_desc_and_reverse(byte *param_1,byte *param_2,uint param_3,byte param_4) { byte bVar1; byte *local_18; byte *local_10; if ((param_3 & 0x100 << (param_4 & 0x1f)) == 0) { if ((param_3 & 0x10000 << (param_4 & 0x1f)) != 0) { local_18 = param_2 + -1; local_10 = param_1; while (local_10 < local_18) { bVar1 = *local_10; *local_10 = *local_18; *local_18 = bVar1; local_18 = local_18 + -1; local_10 = local_10 + 1; } } } else { local_10 = param_1; if ((param_3 & 0x10000 << (param_4 & 0x1f)) == 0) { for (; local_10 < param_2; local_10 = local_10 + 1) { *local_10 = *local_10 ^ 0xff; } } else { local_18 = param_2 + -1; local_10 = param_1; while (local_10 <= local_18) { bVar1 = *local_10; *local_10 = *local_18 ^ 0xff; *local_18 = bVar1 ^ 0xff; local_18 = local_18 + -1; local_10 = local_10 + 1; } } } return; }
2,960
httplib::Server::Server()
monkey531[P]llama/examples/server/httplib.h
inline Server::Server() : new_task_queue( [] { return new ThreadPool(CPPHTTPLIB_THREAD_POOL_COUNT); }) { #ifndef _WIN32 signal(SIGPIPE, SIG_IGN); #endif }
O3
c
httplib::Server::Server(): pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx leaq 0x161cfc(%rip), %rax # 0x1a20e0 movq %rax, (%rdi) leaq 0x8(%rdi), %r14 xorps %xmm0, %xmm0 movups %xmm0, 0x8(%rdi) leaq 0x4a15(%rip), %rax # 0x44e0e movq %rax, 0x20(%rdi) leaq 0x4a10(%rip), %rax # 0x44e14 movq %rax, 0x18(%rdi) movl $0xffffffff, 0x28(%rdi) # imm = 0xFFFFFFFF movq $0x64, 0x30(%rdi) movl $0x5, %eax movq %rax, 0x38(%rdi) movq %rax, 0x40(%rdi) xorl %ecx, %ecx movq %rcx, 0x48(%rdi) movq %rax, 0x50(%rdi) movups %xmm0, 0x58(%rdi) movq %rcx, 0x68(%rdi) movq $-0x1, 0x70(%rdi) movw $0x0, 0x78(%rdi) leaq 0x80(%rdi), %r15 movups %xmm0, 0x80(%rdi) movq %rcx, 0x90(%rdi) leaq 0xa0(%rdi), %rax movl $0x0, 0xa0(%rdi) movq %rcx, 0xa8(%rdi) movq %rax, 0xb0(%rdi) movq %rax, 0xb8(%rdi) movq %rcx, 0xc0(%rdi) addq $0xc8, %rdi leaq 0xd8(%rbx), %rax movq %rax, 0xc8(%rbx) leaq 0x105a3c(%rip), %rsi # 0x145ede leaq 0x105a4d(%rip), %rdx # 0x145ef6 callq 0x4b514 leaq 0xe8(%rbx), %rdi xorl %r14d, %r14d movq %r14, 0x2c8(%rbx) movl $0x1d6, %edx # imm = 0x1D6 xorl %esi, %esi callq 0x1f610 leaq 0x4806(%rip), %rax # 0x44cd8 movq %rax, 0x2c0(%rbx) leaq 0x51b2(%rip), %rax # 0x45692 movq %rax, 0x2d8(%rbx) leaq 0x51ac(%rip), %rax # 0x4569a movq %rax, 0x2d0(%rbx) leaq 0x310(%rbx), %rax movq %rax, 0x2e0(%rbx) movq $0x1, 0x2e8(%rbx) xorps %xmm0, %xmm0 movups %xmm0, 0x2f0(%rbx) movl $0x3f800000, 0x300(%rbx) # imm = 0x3F800000 movups %xmm0, 0x308(%rbx) movq %r14, 0x320(%rbx) leaq 0x47c4(%rip), %rax # 0x44cfb movq %rax, 0x318(%rbx) leaq 0x5177(%rip), %rax # 0x456bc movq %rax, 0x330(%rbx) leaq 0x5175(%rip), %rax # 0x456c8 movq %rax, 0x328(%rbx) movl $0x1, %esi movl $0xd, %edi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x1fcb0 movq %rax, %r12 leaq 0x98(%rbx), %rdi callq 0x42bee movq %r15, %rdi callq 0x3f000 movq 0x18(%rbx), %rax testq %rax, %rax je 0x405a1 movq %r14, %rdi movq %r14, %rsi movl $0x3, %edx callq *%rax movq %r12, %rdi callq 0x20380 movq %rax, %rdi callq 0x3f24b nop
_ZN7httplib6ServerC2Ev: push r15 push r14 push r12 push rbx push rax mov rbx, rdi lea rax, off_1A20E0 mov [rdi], rax lea r14, [rdi+8] xorps xmm0, xmm0 movups xmmword ptr [rdi+8], xmm0 lea rax, _ZNSt17_Function_handlerIFPN7httplib9TaskQueueEvEZNS0_6ServerC1EvEUlvE_E9_M_invokeERKSt9_Any_data; std::_Function_handler<httplib::TaskQueue * ()(void),httplib::Server::Server(void)::{lambda(void)#1}>::_M_invoke(std::_Any_data const&) mov [rdi+20h], rax lea rax, _ZNSt17_Function_handlerIFPN7httplib9TaskQueueEvEZNS0_6ServerC1EvEUlvE_E10_M_managerERSt9_Any_dataRKS7_St18_Manager_operation; std::_Function_handler<httplib::TaskQueue * ()(void),httplib::Server::Server(void)::{lambda(void)#1}>::_M_manager(std::_Any_data &,std::_Any_data const&,std::_Manager_operation) mov [rdi+18h], rax mov dword ptr [rdi+28h], 0FFFFFFFFh mov qword ptr [rdi+30h], 64h ; 'd' mov eax, 5 mov [rdi+38h], rax mov [rdi+40h], rax xor ecx, ecx mov [rdi+48h], rcx mov [rdi+50h], rax movups xmmword ptr [rdi+58h], xmm0 mov [rdi+68h], rcx mov qword ptr [rdi+70h], 0FFFFFFFFFFFFFFFFh mov word ptr [rdi+78h], 0 lea r15, [rdi+80h] movups xmmword ptr [rdi+80h], xmm0 mov [rdi+90h], rcx lea rax, [rdi+0A0h] mov dword ptr [rdi+0A0h], 0 mov [rdi+0A8h], rcx mov [rdi+0B0h], rax mov [rdi+0B8h], rax mov [rdi+0C0h], rcx add rdi, 0C8h lea rax, [rbx+0D8h] mov [rbx+0C8h], rax lea rsi, aApplicationOct; "application/octet-stream" lea rdx, aApplicationOct+18h; "" call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag; std::string::_M_construct<char const*>(char const*,char const*,std::forward_iterator_tag) lea rdi, [rbx+0E8h] xor r14d, r14d mov [rbx+2C8h], r14 mov edx, 1D6h xor esi, esi call _memset lea rax, _ZN7httplib22default_socket_optionsEi; httplib::default_socket_options(int) mov [rbx+2C0h], rax lea rax, _ZNSt17_Function_handlerIFviEPS0_E9_M_invokeERKSt9_Any_dataOi; std::_Function_handler<void ()(int),void (*)(int)>::_M_invoke(std::_Any_data const&,int &&) mov [rbx+2D8h], rax lea rax, _ZNSt17_Function_handlerIFviEPS0_E10_M_managerERSt9_Any_dataRKS3_St18_Manager_operation; std::_Function_handler<void ()(int),void (*)(int)>::_M_manager(std::_Any_data &,std::_Any_data const&,std::_Manager_operation) mov [rbx+2D0h], rax lea rax, [rbx+310h] mov [rbx+2E0h], rax mov qword ptr [rbx+2E8h], 1 xorps xmm0, xmm0 movups xmmword ptr [rbx+2F0h], xmm0 mov dword ptr [rbx+300h], 3F800000h movups xmmword ptr [rbx+308h], xmm0 mov [rbx+320h], r14 lea rax, _ZN7httplib6detail13write_headersERNS_6StreamERKSt18unordered_multimapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_NS0_11case_ignore4hashENSA_8equal_toESaISt4pairIKS9_S9_EEE; httplib::detail::write_headers(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> const&) mov [rbx+318h], rax lea rax, _ZNSt17_Function_handlerIFlRN7httplib6StreamERSt18unordered_multimapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_NS0_6detail11case_ignore4hashENSB_8equal_toESaISt4pairIKS9_S9_EEEEPFlS2_RKSI_EE9_M_invokeERKSt9_Any_dataS2_SJ_; std::_Function_handler<long ()(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> &),long (*)(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> const&)>::_M_invoke(std::_Any_data const&,httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> &) mov [rbx+330h], rax lea rax, _ZNSt17_Function_handlerIFlRN7httplib6StreamERSt18unordered_multimapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_NS0_6detail11case_ignore4hashENSB_8equal_toESaISt4pairIKS9_S9_EEEEPFlS2_RKSI_EE10_M_managerERSt9_Any_dataRKSQ_St18_Manager_operation; std::_Function_handler<long ()(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> &),long (*)(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> const&)>::_M_manager(std::_Any_data &,std::_Any_data const&,std::_Manager_operation) mov [rbx+328h], rax mov esi, 1 mov edi, 0Dh add rsp, 8 pop rbx pop r12 pop r14 pop r15 jmp _signal mov r12, rax lea rdi, [rbx+98h] call _ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESt10_Select1stIS8_ESt4lessIS5_ESaIS8_EED2Ev; std::_Rb_tree<std::string,std::pair<std::string const,std::string>,std::_Select1st<std::pair<std::string const,std::string>>,std::less<std::string>,std::allocator<std::pair<std::string const,std::string>>>::~_Rb_tree() mov rdi, r15 call _ZNSt6vectorIN7httplib6Server15MountPointEntryESaIS2_EED2Ev; std::vector<httplib::Server::MountPointEntry>::~vector() mov rax, [rbx+18h] test rax, rax jz short loc_405A1 mov rdi, r14 mov rsi, r14 mov edx, 3 call rax loc_405A1: mov rdi, r12 call __Unwind_Resume mov rdi, rax call __clang_call_terminate
long long httplib::Server::Server(httplib::Server *this) { *(_QWORD *)this = off_1A20E0; *(_OWORD *)((char *)this + 8) = 0LL; *((_QWORD *)this + 4) = std::_Function_handler<httplib::TaskQueue * ()(void),httplib::Server::Server(void)::{lambda(void)#1}>::_M_invoke; *((_QWORD *)this + 3) = std::_Function_handler<httplib::TaskQueue * ()(void),httplib::Server::Server(void)::{lambda(void)#1}>::_M_manager; *((_DWORD *)this + 10) = -1; *((_QWORD *)this + 6) = 100LL; *((_QWORD *)this + 7) = 5LL; *((_QWORD *)this + 8) = 5LL; *((_QWORD *)this + 9) = 0LL; *((_QWORD *)this + 10) = 5LL; *(_OWORD *)((char *)this + 88) = 0LL; *((_QWORD *)this + 13) = 0LL; *((_QWORD *)this + 14) = -1LL; *((_WORD *)this + 60) = 0; *((_OWORD *)this + 8) = 0LL; *((_QWORD *)this + 18) = 0LL; *((_DWORD *)this + 40) = 0; *((_QWORD *)this + 21) = 0LL; *((_QWORD *)this + 22) = (char *)this + 160; *((_QWORD *)this + 23) = (char *)this + 160; *((_QWORD *)this + 24) = 0LL; *((_QWORD *)this + 25) = (char *)this + 216; std::string::_M_construct<char const*>((char *)this + 200, "application/octet-stream", ""); *((_QWORD *)this + 89) = 0LL; memset((char *)this + 232, 0LL, 470LL); *((_QWORD *)this + 88) = httplib::default_socket_options; *((_QWORD *)this + 91) = std::_Function_handler<void ()(int),void (*)(int)>::_M_invoke; *((_QWORD *)this + 90) = std::_Function_handler<void ()(int),void (*)(int)>::_M_manager; *((_QWORD *)this + 92) = (char *)this + 784; *((_QWORD *)this + 93) = 1LL; *((_OWORD *)this + 47) = 0LL; *((_DWORD *)this + 192) = 1065353216; *(_OWORD *)((char *)this + 776) = 0LL; *((_QWORD *)this + 100) = 0LL; *((_QWORD *)this + 99) = httplib::detail::write_headers; *((_QWORD *)this + 102) = std::_Function_handler<long ()(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> &),long (*)(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> const&)>::_M_invoke; *((_QWORD *)this + 101) = std::_Function_handler<long ()(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> &),long (*)(httplib::Stream &,std::unordered_multimap<std::string,std::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::string const,std::string>>> const&)>::_M_manager; return signal(13LL, 1LL); }
Server: PUSH R15 PUSH R14 PUSH R12 PUSH RBX PUSH RAX MOV RBX,RDI LEA RAX,[0x2a20e0] MOV qword ptr [RDI],RAX LEA R14,[RDI + 0x8] XORPS XMM0,XMM0 MOVUPS xmmword ptr [RDI + 0x8],XMM0 LEA RAX,[0x144e0e] MOV qword ptr [RDI + 0x20],RAX LEA RAX,[0x144e14] MOV qword ptr [RDI + 0x18],RAX MOV dword ptr [RDI + 0x28],0xffffffff MOV qword ptr [RDI + 0x30],0x64 MOV EAX,0x5 MOV qword ptr [RDI + 0x38],RAX MOV qword ptr [RDI + 0x40],RAX XOR ECX,ECX MOV qword ptr [RDI + 0x48],RCX MOV qword ptr [RDI + 0x50],RAX MOVUPS xmmword ptr [RDI + 0x58],XMM0 MOV qword ptr [RDI + 0x68],RCX MOV qword ptr [RDI + 0x70],-0x1 MOV word ptr [RDI + 0x78],0x0 LEA R15,[RDI + 0x80] MOVUPS xmmword ptr [RDI + 0x80],XMM0 MOV qword ptr [RDI + 0x90],RCX LEA RAX,[RDI + 0xa0] MOV dword ptr [RDI + 0xa0],0x0 MOV qword ptr [RDI + 0xa8],RCX MOV qword ptr [RDI + 0xb0],RAX MOV qword ptr [RDI + 0xb8],RAX MOV qword ptr [RDI + 0xc0],RCX ADD RDI,0xc8 LEA RAX,[RBX + 0xd8] MOV qword ptr [RBX + 0xc8],RAX LAB_0014049b: LEA RSI,[0x245ede] LEA RDX,[0x245ef6] CALL 0x0014b514 LAB_001404ae: LEA RDI,[RBX + 0xe8] XOR R14D,R14D MOV qword ptr [RBX + 0x2c8],R14 MOV EDX,0x1d6 XOR ESI,ESI CALL 0x0011f610 LEA RAX,[0x144cd8] MOV qword ptr [RBX + 0x2c0],RAX LEA RAX,[0x145692] MOV qword ptr [RBX + 0x2d8],RAX LEA RAX,[0x14569a] MOV qword ptr [RBX + 0x2d0],RAX LEA RAX,[RBX + 0x310] MOV qword ptr [RBX + 0x2e0],RAX MOV qword ptr [RBX + 0x2e8],0x1 XORPS XMM0,XMM0 MOVUPS xmmword ptr [RBX + 0x2f0],XMM0 MOV dword ptr [RBX + 0x300],0x3f800000 MOVUPS xmmword ptr [RBX + 0x308],XMM0 MOV qword ptr [RBX + 0x320],R14 LEA RAX,[0x144cfb] MOV qword ptr [RBX + 0x318],RAX LEA RAX,[0x1456bc] MOV qword ptr [RBX + 0x330],RAX LEA RAX,[0x1456c8] MOV qword ptr [RBX + 0x328],RAX MOV ESI,0x1 MOV EDI,0xd ADD RSP,0x8 POP RBX POP R12 POP R14 POP R15 JMP 0x0011fcb0
/* httplib::Server::Server() */ void __thiscall httplib::Server::Server(Server *this) { *(int ***)this = &PTR__Server_002a20e0; *(int8 *)(this + 8) = 0; *(int8 *)(this + 0x10) = 0; *(code **)(this + 0x20) = std::_Function_handler<httplib::TaskQueue*(),httplib::Server::Server()::{lambda()#1}>:: _M_invoke; *(code **)(this + 0x18) = std::_Function_handler<httplib::TaskQueue*(),httplib::Server::Server()::{lambda()#1}>:: _M_manager; *(int4 *)(this + 0x28) = 0xffffffff; *(int8 *)(this + 0x30) = 100; *(int8 *)(this + 0x38) = 5; *(int8 *)(this + 0x40) = 5; *(int8 *)(this + 0x48) = 0; *(int8 *)(this + 0x50) = 5; *(int8 *)(this + 0x58) = 0; *(int8 *)(this + 0x60) = 0; *(int8 *)(this + 0x68) = 0; *(int8 *)(this + 0x70) = 0xffffffffffffffff; *(int2 *)(this + 0x78) = 0; *(int8 *)(this + 0x80) = 0; *(int8 *)(this + 0x88) = 0; *(int8 *)(this + 0x90) = 0; *(int4 *)(this + 0xa0) = 0; *(int8 *)(this + 0xa8) = 0; *(Server **)(this + 0xb0) = this + 0xa0; *(Server **)(this + 0xb8) = this + 0xa0; *(int8 *)(this + 0xc0) = 0; *(Server **)(this + 200) = this + 0xd8; /* try { // try from 0014049b to 001404ad has its CatchHandler @ 00140574 */ std::__cxx11::string::_M_construct<char_const*>(this + 200,"application/octet-stream",""); *(int8 *)(this + 0x2c8) = 0; memset(this + 0xe8,0,0x1d6); *(code **)(this + 0x2c0) = default_socket_options; *(code **)(this + 0x2d8) = std::_Function_handler<void(int),void(*)(int)>::_M_invoke; *(code **)(this + 0x2d0) = std::_Function_handler<void(int),void(*)(int)>::_M_manager; *(Server **)(this + 0x2e0) = this + 0x310; *(int8 *)(this + 0x2e8) = 1; *(int8 *)(this + 0x2f0) = 0; *(int8 *)(this + 0x2f8) = 0; *(int4 *)(this + 0x300) = 0x3f800000; *(int8 *)(this + 0x308) = 0; *(int8 *)(this + 0x310) = 0; *(int8 *)(this + 800) = 0; *(code **)(this + 0x318) = detail::write_headers; *(code **)(this + 0x330) = std:: _Function_handler<long(httplib::Stream&,std::unordered_multimap<std::__cxx11::string,std::__cxx11::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::__cxx11::string_const,std::__cxx11::string>>>&),long(*)(httplib::Stream&,std::unordered_multimap<std::__cxx11::string,std::__cxx11::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::__cxx11::string_const,std::__cxx11::string>>>const&)> ::_M_invoke; *(code **)(this + 0x328) = std:: _Function_handler<long(httplib::Stream&,std::unordered_multimap<std::__cxx11::string,std::__cxx11::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::__cxx11::string_const,std::__cxx11::string>>>&),long(*)(httplib::Stream&,std::unordered_multimap<std::__cxx11::string,std::__cxx11::string,httplib::detail::case_ignore::hash,httplib::detail::case_ignore::equal_to,std::allocator<std::pair<std::__cxx11::string_const,std::__cxx11::string>>>const&)> ::_M_manager; signal(0xd,(__sighandler_t)0x1); return; }
2,961
namelist_add
bluesky950520[P]quickjs/qjsc.c
void namelist_add(namelist_t *lp, const char *name, const char *short_name, int flags) { namelist_entry_t *e; if (lp->count == lp->size) { size_t newsize = lp->size + (lp->size >> 1) + 4; namelist_entry_t *a = realloc(lp->array, sizeof(lp->array[0]) * newsize); /* XXX: check for realloc failure */ lp->array = a; lp->size = newsize; } e = &lp->array[lp->count++]; e->name = strdup(name); if (short_name) e->short_name = strdup(short_name); else e->short_name = NULL; e->flags = flags; }
O0
c
namelist_add: subq $0x38, %rsp movq %rdi, 0x30(%rsp) movq %rsi, 0x28(%rsp) movq %rdx, 0x20(%rsp) movl %ecx, 0x1c(%rsp) movq 0x30(%rsp), %rax movl 0x8(%rax), %eax movq 0x30(%rsp), %rcx cmpl 0xc(%rcx), %eax jne 0xeb39 movq 0x30(%rsp), %rax movl 0xc(%rax), %eax movq 0x30(%rsp), %rcx movl 0xc(%rcx), %ecx sarl %ecx addl %ecx, %eax addl $0x4, %eax cltq movq %rax, 0x8(%rsp) movq 0x30(%rsp), %rax movq (%rax), %rdi imulq $0x18, 0x8(%rsp), %rsi callq 0xe6d0 movq %rax, (%rsp) movq (%rsp), %rcx movq 0x30(%rsp), %rax movq %rcx, (%rax) movq 0x8(%rsp), %rax movl %eax, %ecx movq 0x30(%rsp), %rax movl %ecx, 0xc(%rax) movq 0x30(%rsp), %rax movq (%rax), %rax movq 0x30(%rsp), %rdx movl 0x8(%rdx), %ecx movl %ecx, %esi addl $0x1, %esi movl %esi, 0x8(%rdx) movslq %ecx, %rcx imulq $0x18, %rcx, %rcx addq %rcx, %rax movq %rax, 0x10(%rsp) movq 0x28(%rsp), %rdi callq 0xe900 movq %rax, %rcx movq 0x10(%rsp), %rax movq %rcx, (%rax) cmpq $0x0, 0x20(%rsp) je 0xeb95 movq 0x20(%rsp), %rdi callq 0xe900 movq %rax, %rcx movq 0x10(%rsp), %rax movq %rcx, 0x8(%rax) jmp 0xeba2 movq 0x10(%rsp), %rax movq $0x0, 0x8(%rax) movl 0x1c(%rsp), %ecx movq 0x10(%rsp), %rax movl %ecx, 0x10(%rax) addq $0x38, %rsp retq nopw %cs:(%rax,%rax)
namelist_add: sub rsp, 38h mov [rsp+38h+var_8], rdi mov [rsp+38h+var_10], rsi mov [rsp+38h+var_18], rdx mov [rsp+38h+var_1C], ecx mov rax, [rsp+38h+var_8] mov eax, [rax+8] mov rcx, [rsp+38h+var_8] cmp eax, [rcx+0Ch] jnz short loc_EB39 mov rax, [rsp+38h+var_8] mov eax, [rax+0Ch] mov rcx, [rsp+38h+var_8] mov ecx, [rcx+0Ch] sar ecx, 1 add eax, ecx add eax, 4 cdqe mov [rsp+38h+var_30], rax mov rax, [rsp+38h+var_8] mov rdi, [rax] imul rsi, [rsp+38h+var_30], 18h call _realloc mov [rsp+38h+var_38], rax mov rcx, [rsp+38h+var_38] mov rax, [rsp+38h+var_8] mov [rax], rcx mov rax, [rsp+38h+var_30] mov ecx, eax mov rax, [rsp+38h+var_8] mov [rax+0Ch], ecx loc_EB39: mov rax, [rsp+38h+var_8] mov rax, [rax] mov rdx, [rsp+38h+var_8] mov ecx, [rdx+8] mov esi, ecx add esi, 1 mov [rdx+8], esi movsxd rcx, ecx imul rcx, 18h add rax, rcx mov [rsp+38h+var_28], rax mov rdi, [rsp+38h+var_10] call _strdup mov rcx, rax mov rax, [rsp+38h+var_28] mov [rax], rcx cmp [rsp+38h+var_18], 0 jz short loc_EB95 mov rdi, [rsp+38h+var_18] call _strdup mov rcx, rax mov rax, [rsp+38h+var_28] mov [rax+8], rcx jmp short loc_EBA2 loc_EB95: mov rax, [rsp+38h+var_28] mov qword ptr [rax+8], 0 loc_EBA2: mov ecx, [rsp+38h+var_1C] mov rax, [rsp+38h+var_28] mov [rax+10h], ecx add rsp, 38h retn
long long namelist_add(int *a1, long long a2, long long a3, int a4) { long long v4; // rax int v5; // ecx long long result; // rax long long v7; // [rsp+8h] [rbp-30h] long long v8; // [rsp+10h] [rbp-28h] if ( a1[2] == a1[3] ) { v7 = (a1[3] >> 1) + a1[3] + 4; *(_QWORD *)a1 = realloc(*(_QWORD *)a1, 24 * v7); a1[3] = v7; } v4 = *(_QWORD *)a1; v5 = a1[2]; a1[2] = v5 + 1; v8 = 24LL * v5 + v4; *(_QWORD *)v8 = strdup(a2); if ( a3 ) *(_QWORD *)(v8 + 8) = strdup(a3); else *(_QWORD *)(v8 + 8) = 0LL; result = v8; *(_DWORD *)(v8 + 16) = a4; return result; }
namelist_add: SUB RSP,0x38 MOV qword ptr [RSP + 0x30],RDI MOV qword ptr [RSP + 0x28],RSI MOV qword ptr [RSP + 0x20],RDX MOV dword ptr [RSP + 0x1c],ECX MOV RAX,qword ptr [RSP + 0x30] MOV EAX,dword ptr [RAX + 0x8] MOV RCX,qword ptr [RSP + 0x30] CMP EAX,dword ptr [RCX + 0xc] JNZ 0x0010eb39 MOV RAX,qword ptr [RSP + 0x30] MOV EAX,dword ptr [RAX + 0xc] MOV RCX,qword ptr [RSP + 0x30] MOV ECX,dword ptr [RCX + 0xc] SAR ECX,0x1 ADD EAX,ECX ADD EAX,0x4 CDQE MOV qword ptr [RSP + 0x8],RAX MOV RAX,qword ptr [RSP + 0x30] MOV RDI,qword ptr [RAX] IMUL RSI,qword ptr [RSP + 0x8],0x18 CALL 0x0010e6d0 MOV qword ptr [RSP],RAX MOV RCX,qword ptr [RSP] MOV RAX,qword ptr [RSP + 0x30] MOV qword ptr [RAX],RCX MOV RAX,qword ptr [RSP + 0x8] MOV ECX,EAX MOV RAX,qword ptr [RSP + 0x30] MOV dword ptr [RAX + 0xc],ECX LAB_0010eb39: MOV RAX,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RAX] MOV RDX,qword ptr [RSP + 0x30] MOV ECX,dword ptr [RDX + 0x8] MOV ESI,ECX ADD ESI,0x1 MOV dword ptr [RDX + 0x8],ESI MOVSXD RCX,ECX IMUL RCX,RCX,0x18 ADD RAX,RCX MOV qword ptr [RSP + 0x10],RAX MOV RDI,qword ptr [RSP + 0x28] CALL 0x0010e900 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x10] MOV qword ptr [RAX],RCX CMP qword ptr [RSP + 0x20],0x0 JZ 0x0010eb95 MOV RDI,qword ptr [RSP + 0x20] CALL 0x0010e900 MOV RCX,RAX MOV RAX,qword ptr [RSP + 0x10] MOV qword ptr [RAX + 0x8],RCX JMP 0x0010eba2 LAB_0010eb95: MOV RAX,qword ptr [RSP + 0x10] MOV qword ptr [RAX + 0x8],0x0 LAB_0010eba2: MOV ECX,dword ptr [RSP + 0x1c] MOV RAX,qword ptr [RSP + 0x10] MOV dword ptr [RAX + 0x10],ECX ADD RSP,0x38 RET
void namelist_add(long *param_1,char *param_2,char *param_3,int4 param_4) { long lVar1; int iVar2; void *pvVar3; int8 *puVar4; char *pcVar5; if ((int)param_1[1] == *(int *)((long)param_1 + 0xc)) { iVar2 = *(int *)((long)param_1 + 0xc) + (*(int *)((long)param_1 + 0xc) >> 1) + 4; pvVar3 = realloc((void *)*param_1,(long)iVar2 * 0x18); *param_1 = (long)pvVar3; *(int *)((long)param_1 + 0xc) = iVar2; } lVar1 = param_1[1]; *(int *)(param_1 + 1) = (int)lVar1 + 1; puVar4 = (int8 *)(*param_1 + (long)(int)lVar1 * 0x18); pcVar5 = strdup(param_2); *puVar4 = pcVar5; if (param_3 == (char *)0x0) { puVar4[1] = 0; } else { pcVar5 = strdup(param_3); puVar4[1] = pcVar5; } *(int4 *)(puVar4 + 2) = param_4; return; }
2,962
namelist_add
bluesky950520[P]quickjs/qjsc.c
void namelist_add(namelist_t *lp, const char *name, const char *short_name, int flags) { namelist_entry_t *e; if (lp->count == lp->size) { size_t newsize = lp->size + (lp->size >> 1) + 4; namelist_entry_t *a = realloc(lp->array, sizeof(lp->array[0]) * newsize); /* XXX: check for realloc failure */ lp->array = a; lp->size = newsize; } e = &lp->array[lp->count++]; e->name = strdup(name); if (short_name) e->short_name = strdup(short_name); else e->short_name = NULL; e->flags = flags; }
O1
c
namelist_add: pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movl %ecx, %ebx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 movl 0xc(%rdi), %eax cmpl %eax, 0x8(%rdi) jne 0x13b22 movl %eax, %ecx sarl %ecx addl %ecx, %eax addl $0x4, %eax movslq %eax, %r13 movq (%r12), %rdi leaq (,%r13,8), %rax leaq (%rax,%rax,2), %rsi callq 0xe6e0 movq %rax, (%r12) movl %r13d, 0xc(%r12) movq (%r12), %rax movslq 0x8(%r12), %rcx leal 0x1(%rcx), %edx movl %edx, 0x8(%r12) leaq (%rcx,%rcx,2), %rcx leaq (%rax,%rcx,8), %r12 movq %r15, %rdi callq 0xe910 movq %rax, (%r12) testq %r14, %r14 je 0x13b56 movq %r14, %rdi callq 0xe910 jmp 0x13b58 xorl %eax, %eax movq %rax, 0x8(%r12) movl %ebx, 0x10(%r12) popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq
namelist_add: push r15 push r14 push r13 push r12 push rbx mov ebx, ecx mov r14, rdx mov r15, rsi mov r12, rdi mov eax, [rdi+0Ch] cmp [rdi+8], eax jnz short loc_13B22 mov ecx, eax sar ecx, 1 add eax, ecx add eax, 4 movsxd r13, eax mov rdi, [r12] lea rax, ds:0[r13*8] lea rsi, [rax+rax*2] call _realloc mov [r12], rax mov [r12+0Ch], r13d loc_13B22: mov rax, [r12] movsxd rcx, dword ptr [r12+8] lea edx, [rcx+1] mov [r12+8], edx lea rcx, [rcx+rcx*2] lea r12, [rax+rcx*8] mov rdi, r15 call _strdup mov [r12], rax test r14, r14 jz short loc_13B56 mov rdi, r14 call _strdup jmp short loc_13B58 loc_13B56: xor eax, eax loc_13B58: mov [r12+8], rax mov [r12+10h], ebx pop rbx pop r12 pop r13 pop r14 pop r15 retn
long long namelist_add(long long *a1, long long a2, long long a3, int a4) { int v6; // eax long long v7; // r13 long long v8; // rax long long v9; // rcx long long v10; // r12 long long result; // rax v6 = *((_DWORD *)a1 + 3); if ( *((_DWORD *)a1 + 2) == v6 ) { v7 = (v6 >> 1) + v6 + 4; *a1 = realloc(*a1, 24 * v7); *((_DWORD *)a1 + 3) = v7; } v8 = *a1; v9 = *((int *)a1 + 2); *((_DWORD *)a1 + 2) = v9 + 1; v10 = v8 + 24 * v9; *(_QWORD *)v10 = strdup(a2); if ( a3 ) result = strdup(a3); else result = 0LL; *(_QWORD *)(v10 + 8) = result; *(_DWORD *)(v10 + 16) = a4; return result; }
namelist_add: PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX MOV EBX,ECX MOV R14,RDX MOV R15,RSI MOV R12,RDI MOV EAX,dword ptr [RDI + 0xc] CMP dword ptr [RDI + 0x8],EAX JNZ 0x00113b22 MOV ECX,EAX SAR ECX,0x1 ADD EAX,ECX ADD EAX,0x4 MOVSXD R13,EAX MOV RDI,qword ptr [R12] LEA RAX,[R13*0x8] LEA RSI,[RAX + RAX*0x2] CALL 0x0010e6e0 MOV qword ptr [R12],RAX MOV dword ptr [R12 + 0xc],R13D LAB_00113b22: MOV RAX,qword ptr [R12] MOVSXD RCX,dword ptr [R12 + 0x8] LEA EDX,[RCX + 0x1] MOV dword ptr [R12 + 0x8],EDX LEA RCX,[RCX + RCX*0x2] LEA R12,[RAX + RCX*0x8] MOV RDI,R15 CALL 0x0010e910 MOV qword ptr [R12],RAX TEST R14,R14 JZ 0x00113b56 MOV RDI,R14 CALL 0x0010e910 JMP 0x00113b58 LAB_00113b56: XOR EAX,EAX LAB_00113b58: MOV qword ptr [R12 + 0x8],RAX MOV dword ptr [R12 + 0x10],EBX POP RBX POP R12 POP R13 POP R14 POP R15 RET
void namelist_add(long *param_1,char *param_2,char *param_3,int4 param_4) { int8 *puVar1; long lVar2; int iVar3; void *pvVar4; char *pcVar5; iVar3 = *(int *)((long)param_1 + 0xc); if ((int)param_1[1] == iVar3) { iVar3 = iVar3 + (iVar3 >> 1) + 4; pvVar4 = realloc((void *)*param_1,(long)iVar3 * 0x18); *param_1 = (long)pvVar4; *(int *)((long)param_1 + 0xc) = iVar3; } lVar2 = param_1[1]; *(int *)(param_1 + 1) = (int)lVar2 + 1; puVar1 = (int8 *)(*param_1 + (long)(int)lVar2 * 0x18); pcVar5 = strdup(param_2); *puVar1 = pcVar5; if (param_3 == (char *)0x0) { pcVar5 = (char *)0x0; } else { pcVar5 = strdup(param_3); } puVar1[1] = pcVar5; *(int4 *)(puVar1 + 2) = param_4; return; }
2,963
namelist_add
bluesky950520[P]quickjs/qjsc.c
void namelist_add(namelist_t *lp, const char *name, const char *short_name, int flags) { namelist_entry_t *e; if (lp->count == lp->size) { size_t newsize = lp->size + (lp->size >> 1) + 4; namelist_entry_t *a = realloc(lp->array, sizeof(lp->array[0]) * newsize); /* XXX: check for realloc failure */ lp->array = a; lp->size = newsize; } e = &lp->array[lp->count++]; e->name = strdup(name); if (short_name) e->short_name = strdup(short_name); else e->short_name = NULL; e->flags = flags; }
O2
c
namelist_add: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, %ebx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r13 movl 0x8(%rdi), %eax movq (%rdi), %r12 cmpl 0xc(%rdi), %eax jne 0xeb34 movl %eax, %ecx sarl %ecx addl %ecx, %eax addl $0x4, %eax movslq %eax, %rbp imulq $0x18, %rbp, %rsi movq %r12, %rdi callq 0xe700 movq %rax, %r12 movq %rax, (%r13) movl %ebp, 0xc(%r13) movl 0x8(%r13), %eax leal 0x1(%rax), %ecx movl %ecx, 0x8(%r13) cltq imulq $0x18, %rax, %rbp leaq (%r12,%rbp), %r13 movq %r15, %rdi callq 0xe930 movq %rax, (%r12,%rbp) testq %r14, %r14 je 0xeb60 movq %r14, %rdi callq 0xe930 jmp 0xeb62 xorl %eax, %eax movq %rax, 0x8(%r13) movl %ebx, 0x10(%r13) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
namelist_add: push rbp push r15 push r14 push r13 push r12 push rbx push rax mov ebx, ecx mov r14, rdx mov r15, rsi mov r13, rdi mov eax, [rdi+8] mov r12, [rdi] cmp eax, [rdi+0Ch] jnz short loc_EB34 mov ecx, eax sar ecx, 1 add eax, ecx add eax, 4 movsxd rbp, eax imul rsi, rbp, 18h mov rdi, r12 call _realloc mov r12, rax mov [r13+0], rax mov [r13+0Ch], ebp mov eax, [r13+8] loc_EB34: lea ecx, [rax+1] mov [r13+8], ecx cdqe imul rbp, rax, 18h lea r13, [r12+rbp] mov rdi, r15 call _strdup mov [r12+rbp], rax test r14, r14 jz short loc_EB60 mov rdi, r14 call _strdup jmp short loc_EB62 loc_EB60: xor eax, eax loc_EB62: mov [r13+8], rax mov [r13+10h], ebx add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long namelist_add(long long *a1, long long a2, long long a3, int a4) { int v6; // eax long long v7; // r12 long long v8; // rbp long long v9; // r13 long long result; // rax v6 = *((_DWORD *)a1 + 2); v7 = *a1; if ( v6 == *((_DWORD *)a1 + 3) ) { v8 = (v6 >> 1) + v6 + 4; v7 = realloc(*a1, 24 * v8); *a1 = v7; *((_DWORD *)a1 + 3) = v8; v6 = *((_DWORD *)a1 + 2); } *((_DWORD *)a1 + 2) = v6 + 1; v9 = v7 + 24LL * v6; *(_QWORD *)v9 = strdup(a2); if ( a3 ) result = strdup(a3); else result = 0LL; *(_QWORD *)(v9 + 8) = result; *(_DWORD *)(v9 + 16) = a4; return result; }
namelist_add: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV EBX,ECX MOV R14,RDX MOV R15,RSI MOV R13,RDI MOV EAX,dword ptr [RDI + 0x8] MOV R12,qword ptr [RDI] CMP EAX,dword ptr [RDI + 0xc] JNZ 0x0010eb34 MOV ECX,EAX SAR ECX,0x1 ADD EAX,ECX ADD EAX,0x4 MOVSXD RBP,EAX IMUL RSI,RBP,0x18 MOV RDI,R12 CALL 0x0010e700 MOV R12,RAX MOV qword ptr [R13],RAX MOV dword ptr [R13 + 0xc],EBP MOV EAX,dword ptr [R13 + 0x8] LAB_0010eb34: LEA ECX,[RAX + 0x1] MOV dword ptr [R13 + 0x8],ECX CDQE IMUL RBP,RAX,0x18 LEA R13,[R12 + RBP*0x1] MOV RDI,R15 CALL 0x0010e930 MOV qword ptr [R12 + RBP*0x1],RAX TEST R14,R14 JZ 0x0010eb60 MOV RDI,R14 CALL 0x0010e930 JMP 0x0010eb62 LAB_0010eb60: XOR EAX,EAX LAB_0010eb62: MOV qword ptr [R13 + 0x8],RAX MOV dword ptr [R13 + 0x10],EBX ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
void namelist_add(int8 *param_1,char *param_2,char *param_3,int4 param_4) { int iVar1; void *__ptr; char *pcVar2; long lVar3; iVar1 = *(int *)(param_1 + 1); __ptr = (void *)*param_1; if (iVar1 == *(int *)((long)param_1 + 0xc)) { iVar1 = iVar1 + (iVar1 >> 1) + 4; __ptr = realloc(__ptr,(long)iVar1 * 0x18); *param_1 = __ptr; *(int *)((long)param_1 + 0xc) = iVar1; iVar1 = *(int *)(param_1 + 1); } *(int *)(param_1 + 1) = iVar1 + 1; lVar3 = (long)iVar1 * 0x18; pcVar2 = strdup(param_2); *(char **)((long)__ptr + lVar3) = pcVar2; if (param_3 == (char *)0x0) { pcVar2 = (char *)0x0; } else { pcVar2 = strdup(param_3); } *(char **)((long)__ptr + lVar3 + 8) = pcVar2; *(int4 *)((long)__ptr + lVar3 + 0x10) = param_4; return; }
2,964
my_create
eloqsql/mysys/my_create.c
File my_create(const char *FileName, int CreateFlags, int access_flags, myf MyFlags) { int fd; DBUG_ENTER("my_create"); DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %lu", FileName, CreateFlags, access_flags, MyFlags)); #if defined(_WIN32) fd= my_win_open(FileName, access_flags | O_CREAT); #else fd= open((char *) FileName, access_flags | O_CREAT | O_CLOEXEC, CreateFlags ? CreateFlags : my_umask); #endif if ((MyFlags & MY_SYNC_DIR) && (fd >=0) && my_sync_dir_by_file(FileName, MyFlags)) { my_close(fd, MyFlags); fd= -1; } fd= my_register_filename(fd, FileName, FILE_BY_CREATE, EE_CANTCREATEFILE, MyFlags); DBUG_RETURN(fd); }
O0
c
my_create: pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq %rcx, -0x18(%rbp) jmp 0xf0a48 movq -0x8(%rbp), %rax movq %rax, -0x28(%rbp) movl -0x10(%rbp), %eax orl $0x40, %eax orl $0x80000, %eax # imm = 0x80000 movl %eax, -0x20(%rbp) cmpl $0x0, -0xc(%rbp) je 0xf0a6c movl -0xc(%rbp), %eax movl %eax, -0x2c(%rbp) jmp 0xf0a78 leaq 0x1d01d5(%rip), %rax # 0x2c0c48 movl (%rax), %eax movl %eax, -0x2c(%rbp) movl -0x20(%rbp), %esi movq -0x28(%rbp), %rdi movl -0x2c(%rbp), %edx movb $0x0, %al callq 0x2a950 movl %eax, -0x1c(%rbp) movq -0x18(%rbp), %rax andq $0x8000, %rax # imm = 0x8000 cmpq $0x0, %rax je 0xf0ac7 cmpl $0x0, -0x1c(%rbp) jl 0xf0ac7 movq -0x8(%rbp), %rdi movq -0x18(%rbp), %rsi callq 0xf70e0 cmpl $0x0, %eax je 0xf0ac7 movl -0x1c(%rbp), %edi movq -0x18(%rbp), %rsi callq 0xf5880 movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF movl -0x1c(%rbp), %edi movq -0x8(%rbp), %rsi movq -0x18(%rbp), %r8 movl $0x2, %edx movl $0x1, %ecx callq 0xf5720 movl %eax, -0x1c(%rbp) movl -0x1c(%rbp), %eax movl %eax, -0x30(%rbp) movl -0x30(%rbp), %eax addq $0x30, %rsp popq %rbp retq nopw %cs:(%rax,%rax) nopl (%rax)
my_create: push rbp mov rbp, rsp sub rsp, 30h mov [rbp+var_8], rdi mov [rbp+var_C], esi mov [rbp+var_10], edx mov [rbp+var_18], rcx jmp short $+2 loc_F0A48: mov rax, [rbp+var_8] mov [rbp+var_28], rax mov eax, [rbp+var_10] or eax, 40h or eax, 80000h mov [rbp+var_20], eax cmp [rbp+var_C], 0 jz short loc_F0A6C mov eax, [rbp+var_C] mov [rbp+var_2C], eax jmp short loc_F0A78 loc_F0A6C: lea rax, my_umask mov eax, [rax] mov [rbp+var_2C], eax loc_F0A78: mov esi, [rbp+var_20] mov rdi, [rbp+var_28] mov edx, [rbp+var_2C] mov al, 0 call _open64 mov [rbp+var_1C], eax mov rax, [rbp+var_18] and rax, 8000h cmp rax, 0 jz short loc_F0AC7 cmp [rbp+var_1C], 0 jl short loc_F0AC7 mov rdi, [rbp+var_8] mov rsi, [rbp+var_18] call my_sync_dir_by_file cmp eax, 0 jz short loc_F0AC7 mov edi, [rbp+var_1C] mov rsi, [rbp+var_18] call my_close mov [rbp+var_1C], 0FFFFFFFFh loc_F0AC7: mov edi, [rbp+var_1C] mov rsi, [rbp+var_8] mov r8, [rbp+var_18] mov edx, 2 mov ecx, 1 call my_register_filename mov [rbp+var_1C], eax mov eax, [rbp+var_1C] mov [rbp+var_30], eax mov eax, [rbp+var_30] add rsp, 30h pop rbp retn
long long my_create(long long a1, unsigned int a2, int a3, long long a4) { unsigned int v5; // [rsp+4h] [rbp-2Ch] int v6; // [rsp+14h] [rbp-1Ch] if ( a2 ) v5 = a2; else v5 = my_umask; v6 = open64(a1, a3 | 0x80040u, v5); if ( (a4 & 0x8000) != 0 && v6 >= 0 && (unsigned int)my_sync_dir_by_file(a1, a4) ) { my_close((unsigned int)v6, a4); v6 = -1; } return (unsigned int)my_register_filename((unsigned int)v6, a1, 2LL, 1LL, a4); }
my_create: PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + -0x8],RDI MOV dword ptr [RBP + -0xc],ESI MOV dword ptr [RBP + -0x10],EDX MOV qword ptr [RBP + -0x18],RCX JMP 0x001f0a48 LAB_001f0a48: MOV RAX,qword ptr [RBP + -0x8] MOV qword ptr [RBP + -0x28],RAX MOV EAX,dword ptr [RBP + -0x10] OR EAX,0x40 OR EAX,0x80000 MOV dword ptr [RBP + -0x20],EAX CMP dword ptr [RBP + -0xc],0x0 JZ 0x001f0a6c MOV EAX,dword ptr [RBP + -0xc] MOV dword ptr [RBP + -0x2c],EAX JMP 0x001f0a78 LAB_001f0a6c: LEA RAX,[0x3c0c48] MOV EAX,dword ptr [RAX] MOV dword ptr [RBP + -0x2c],EAX LAB_001f0a78: MOV ESI,dword ptr [RBP + -0x20] MOV RDI,qword ptr [RBP + -0x28] MOV EDX,dword ptr [RBP + -0x2c] MOV AL,0x0 CALL 0x0012a950 MOV dword ptr [RBP + -0x1c],EAX MOV RAX,qword ptr [RBP + -0x18] AND RAX,0x8000 CMP RAX,0x0 JZ 0x001f0ac7 CMP dword ptr [RBP + -0x1c],0x0 JL 0x001f0ac7 MOV RDI,qword ptr [RBP + -0x8] MOV RSI,qword ptr [RBP + -0x18] CALL 0x001f70e0 CMP EAX,0x0 JZ 0x001f0ac7 MOV EDI,dword ptr [RBP + -0x1c] MOV RSI,qword ptr [RBP + -0x18] CALL 0x001f5880 MOV dword ptr [RBP + -0x1c],0xffffffff LAB_001f0ac7: MOV EDI,dword ptr [RBP + -0x1c] MOV RSI,qword ptr [RBP + -0x8] MOV R8,qword ptr [RBP + -0x18] MOV EDX,0x2 MOV ECX,0x1 CALL 0x001f5720 MOV dword ptr [RBP + -0x1c],EAX MOV EAX,dword ptr [RBP + -0x1c] MOV dword ptr [RBP + -0x30],EAX MOV EAX,dword ptr [RBP + -0x30] ADD RSP,0x30 POP RBP RET
int4 my_create(char *param_1,uint param_2,uint param_3,ulong param_4) { int iVar1; int4 uVar2; uint local_34; int local_24; local_34 = param_2; if (param_2 == 0) { local_34 = my_umask; } local_24 = open64(param_1,param_3 | 0x80040,(ulong)local_34); if ((((param_4 & 0x8000) != 0) && (-1 < local_24)) && (iVar1 = my_sync_dir_by_file(param_1,param_4), iVar1 != 0)) { my_close(local_24,param_4); local_24 = -1; } uVar2 = my_register_filename(local_24,param_1,2,1,param_4); return uVar2; }
2,965
JS_FreeCString
bluesky950520[P]quickjs/quickjs.c
void JS_FreeCString(JSContext *ctx, const char *ptr) { JSString *p; if (!ptr) return; /* purposely removing constness */ p = container_of(ptr, JSString, u); JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p)); }
O1
c
JS_FreeCString: testq %rsi, %rsi je 0x202f0 movq 0x18(%rdi), %rdi movl -0x18(%rsi), %eax leal -0x1(%rax), %ecx movl %ecx, -0x18(%rsi) cmpl $0x1, %eax jg 0x202f0 addq $-0x18, %rsi movq $-0x7, %rdx jmp 0x20652 retq
JS_FreeCString: test rsi, rsi jz short locret_202F0 mov rdi, [rdi+18h] mov eax, [rsi-18h] lea ecx, [rax-1] mov [rsi-18h], ecx cmp eax, 1 jg short locret_202F0 add rsi, 0FFFFFFFFFFFFFFE8h mov rdx, 0FFFFFFFFFFFFFFF9h jmp js_free_value_rt locret_202F0: retn
long long JS_FreeCString(long long a1, long long a2) { long long v2; // rdi long long result; // rax if ( a2 ) { v2 = *(_QWORD *)(a1 + 24); result = *(unsigned int *)(a2 - 24); *(_DWORD *)(a2 - 24) = result - 1; if ( (int)result <= 1 ) return js_free_value_rt(v2, a2 - 24, -7LL); } return result; }
JS_FreeCString: TEST RSI,RSI JZ 0x001202f0 MOV RDI,qword ptr [RDI + 0x18] MOV EAX,dword ptr [RSI + -0x18] LEA ECX,[RAX + -0x1] MOV dword ptr [RSI + -0x18],ECX CMP EAX,0x1 JG 0x001202f0 ADD RSI,-0x18 MOV RDX,-0x7 JMP 0x00120652 LAB_001202f0: RET
void JS_FreeCString(long param_1,long param_2) { int iVar1; int8 uVar2; if (param_2 != 0) { uVar2 = *(int8 *)(param_1 + 0x18); iVar1 = *(int *)(param_2 + -0x18); *(int *)(param_2 + -0x18) = iVar1 + -1; if (iVar1 < 2) { js_free_value_rt(uVar2,param_2 + -0x18,0xfffffffffffffff9); return; } } return; }
2,966
JS_FreeCString
bluesky950520[P]quickjs/quickjs.c
void JS_FreeCString(JSContext *ctx, const char *ptr) { JSString *p; if (!ptr) return; /* purposely removing constness */ p = container_of(ptr, JSString, u); JS_FreeValue(ctx, JS_MKPTR(JS_TAG_STRING, p)); }
O3
c
JS_FreeCString: testq %rsi, %rsi je 0x20a14 movq 0x18(%rdi), %rdi movl -0x18(%rsi), %eax leal -0x1(%rax), %ecx movl %ecx, -0x18(%rsi) cmpl $0x1, %eax jg 0x20a14 addq $-0x18, %rsi movq $-0x7, %rdx jmp 0x20d90 retq
JS_FreeCString: test rsi, rsi jz short locret_20A14 mov rdi, [rdi+18h] mov eax, [rsi-18h] lea ecx, [rax-1] mov [rsi-18h], ecx cmp eax, 1 jg short locret_20A14 add rsi, 0FFFFFFFFFFFFFFE8h mov rdx, 0FFFFFFFFFFFFFFF9h jmp js_free_value_rt locret_20A14: retn
long long JS_FreeCString(long long a1, long long a2) { long long v2; // rdi long long result; // rax if ( a2 ) { v2 = *(_QWORD *)(a1 + 24); result = *(unsigned int *)(a2 - 24); *(_DWORD *)(a2 - 24) = result - 1; if ( (int)result <= 1 ) return js_free_value_rt(v2, a2 - 24); } return result; }
JS_FreeCString: TEST RSI,RSI JZ 0x00120a14 MOV RDI,qword ptr [RDI + 0x18] MOV EAX,dword ptr [RSI + -0x18] LEA ECX,[RAX + -0x1] MOV dword ptr [RSI + -0x18],ECX CMP EAX,0x1 JG 0x00120a14 ADD RSI,-0x18 MOV RDX,-0x7 JMP 0x00120d90 LAB_00120a14: RET
void JS_FreeCString(long param_1,long param_2) { int iVar1; int8 uVar2; if (param_2 != 0) { uVar2 = *(int8 *)(param_1 + 0x18); iVar1 = *(int *)(param_2 + -0x18); *(int *)(param_2 + -0x18) = iVar1 + -1; if (iVar1 < 2) { js_free_value_rt(uVar2,param_2 + -0x18,0xfffffffffffffff9); return; } } return; }
2,967
MNN::CreateUnaryOp(flatbuffers::FlatBufferBuilder&, MNN::UnaryOpT const*, std::__1::function<unsigned long (void*)> const*)
mnn-tts/MNN/schema/current/TensorflowOp_generated.h
inline flatbuffers::Offset<UnaryOp> CreateUnaryOp(flatbuffers::FlatBufferBuilder &_fbb, const UnaryOpT *_o, const flatbuffers::rehasher_function_t *_rehasher) { (void)_rehasher; (void)_o; struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const UnaryOpT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; auto _opType = _o->opType; auto _T = _o->T; auto _tableInt8 = _o->tableInt8.size() ? _fbb.CreateVector(_o->tableInt8) : 0; return MNN::CreateUnaryOp( _fbb, _opType, _T, _tableInt8); }
O0
c
MNN::CreateUnaryOp(flatbuffers::FlatBufferBuilder&, MNN::UnaryOpT const*, std::__1::function<unsigned long (void*)> const*): subq $0x48, %rsp movq %rdi, 0x38(%rsp) movq %rsi, 0x30(%rsp) movq %rdx, 0x28(%rsp) movq 0x38(%rsp), %rax movq %rax, 0x10(%rsp) movq 0x30(%rsp), %rax movq %rax, 0x18(%rsp) movq 0x28(%rsp), %rax movq %rax, 0x20(%rsp) movq 0x30(%rsp), %rax movl (%rax), %eax movl %eax, 0xc(%rsp) movq 0x30(%rsp), %rax movl 0x4(%rax), %eax movl %eax, 0x8(%rsp) movq 0x30(%rsp), %rdi addq $0x8, %rdi callq 0x6690 cmpq $0x0, %rax je 0xfd85 movq 0x38(%rsp), %rdi movq 0x30(%rsp), %rsi addq $0x8, %rsi callq 0x147d0 movl %eax, 0x4(%rsp) jmp 0xfd91 leaq 0x4(%rsp), %rdi xorl %esi, %esi callq 0x14820 movq 0x38(%rsp), %rdi movl 0xc(%rsp), %esi movl 0x8(%rsp), %edx movl 0x4(%rsp), %eax movl %eax, (%rsp) movl (%rsp), %ecx callq 0x20a30 movl %eax, 0x44(%rsp) movl 0x44(%rsp), %eax addq $0x48, %rsp retq nopw (%rax,%rax)
_ZN3MNN13CreateUnaryOpERN11flatbuffers17FlatBufferBuilderEPKNS_8UnaryOpTEPKNSt3__18functionIFmPvEEE: sub rsp, 48h mov [rsp+48h+var_10], rdi mov [rsp+48h+var_18], rsi mov [rsp+48h+var_20], rdx mov rax, [rsp+48h+var_10] mov [rsp+48h+var_38], rax mov rax, [rsp+48h+var_18] mov [rsp+48h+var_30], rax mov rax, [rsp+48h+var_20] mov [rsp+48h+var_28], rax mov rax, [rsp+48h+var_18] mov eax, [rax] mov [rsp+48h+var_3C], eax mov rax, [rsp+48h+var_18] mov eax, [rax+4] mov [rsp+48h+var_40], eax mov rdi, [rsp+48h+var_18] add rdi, 8 call _ZNKSt3__16vectorIaNS_9allocatorIaEEE4sizeB8nn200100Ev; std::vector<signed char>::size(void) cmp rax, 0 jz short loc_FD85 mov rdi, [rsp+48h+var_10] mov rsi, [rsp+48h+var_18] add rsi, 8 call _ZN11flatbuffers17FlatBufferBuilder12CreateVectorIaEENS_6OffsetINS_6VectorIT_EEEERKNSt3__16vectorIS4_NS7_9allocatorIS4_EEEE; flatbuffers::FlatBufferBuilder::CreateVector<signed char>(std::vector<signed char> const&) mov [rsp+48h+var_44], eax jmp short loc_FD91 loc_FD85: lea rdi, [rsp+48h+var_44] xor esi, esi call _ZN11flatbuffers6OffsetINS_6VectorIaEEEC2Ej; flatbuffers::Offset<flatbuffers::Vector<signed char>>::Offset(uint) loc_FD91: mov rdi, [rsp+48h+var_10] mov esi, [rsp+48h+var_3C] mov edx, [rsp+48h+var_40] mov eax, [rsp+48h+var_44] mov [rsp+48h+var_48], eax mov ecx, [rsp+48h+var_48] call _ZN3MNN13CreateUnaryOpERN11flatbuffers17FlatBufferBuilderENS_16UnaryOpOperationENS_8DataTypeENS0_6OffsetINS0_6VectorIaEEEE; MNN::CreateUnaryOp(flatbuffers::FlatBufferBuilder &,MNN::UnaryOpOperation,MNN::DataType,flatbuffers::Offset<flatbuffers::Vector<signed char>>) mov [rsp+48h+var_4], eax mov eax, [rsp+48h+var_4] add rsp, 48h retn
long long MNN::CreateUnaryOp(long long a1, unsigned int *a2, long long a3) { unsigned int v4; // [rsp+4h] [rbp-44h] BYREF unsigned int v5; // [rsp+8h] [rbp-40h] unsigned int v6; // [rsp+Ch] [rbp-3Ch] long long v7; // [rsp+10h] [rbp-38h] unsigned int *v8; // [rsp+18h] [rbp-30h] long long v9; // [rsp+20h] [rbp-28h] long long v10; // [rsp+28h] [rbp-20h] unsigned int *v11; // [rsp+30h] [rbp-18h] long long v12; // [rsp+38h] [rbp-10h] v12 = a1; v11 = a2; v10 = a3; v7 = a1; v8 = a2; v9 = a3; v6 = *a2; v5 = a2[1]; if ( std::vector<signed char>::size[abi:nn200100]((_QWORD *)a2 + 1) ) v4 = flatbuffers::FlatBufferBuilder::CreateVector<signed char>(v12, v11 + 2); else flatbuffers::Offset<flatbuffers::Vector<signed char>>::Offset(&v4, 0LL); return (unsigned int)MNN::CreateUnaryOp(v12, v6, v5, v4); }
CreateUnaryOp: SUB RSP,0x48 MOV qword ptr [RSP + 0x38],RDI MOV qword ptr [RSP + 0x30],RSI MOV qword ptr [RSP + 0x28],RDX MOV RAX,qword ptr [RSP + 0x38] MOV qword ptr [RSP + 0x10],RAX MOV RAX,qword ptr [RSP + 0x30] MOV qword ptr [RSP + 0x18],RAX MOV RAX,qword ptr [RSP + 0x28] MOV qword ptr [RSP + 0x20],RAX MOV RAX,qword ptr [RSP + 0x30] MOV EAX,dword ptr [RAX] MOV dword ptr [RSP + 0xc],EAX MOV RAX,qword ptr [RSP + 0x30] MOV EAX,dword ptr [RAX + 0x4] MOV dword ptr [RSP + 0x8],EAX MOV RDI,qword ptr [RSP + 0x30] ADD RDI,0x8 CALL 0x00106690 CMP RAX,0x0 JZ 0x0010fd85 MOV RDI,qword ptr [RSP + 0x38] MOV RSI,qword ptr [RSP + 0x30] ADD RSI,0x8 CALL 0x001147d0 MOV dword ptr [RSP + 0x4],EAX JMP 0x0010fd91 LAB_0010fd85: LEA RDI,[RSP + 0x4] XOR ESI,ESI CALL 0x00114820 LAB_0010fd91: MOV RDI,qword ptr [RSP + 0x38] MOV ESI,dword ptr [RSP + 0xc] MOV EDX,dword ptr [RSP + 0x8] MOV EAX,dword ptr [RSP + 0x4] MOV dword ptr [RSP],EAX MOV ECX,dword ptr [RSP] CALL 0x00120a30 MOV dword ptr [RSP + 0x44],EAX MOV EAX,dword ptr [RSP + 0x44] ADD RSP,0x48 RET
/* MNN::CreateUnaryOp(flatbuffers::FlatBufferBuilder&, MNN::UnaryOpT const*, std::function<unsigned long (void*)> const*) */ int4 MNN::CreateUnaryOp(FlatBufferBuilder *param_1,UnaryOpT *param_2,function *param_3) { int4 uVar1; long lVar2; int4 local_44; int4 local_40; int4 local_3c; FlatBufferBuilder *local_38; UnaryOpT *local_30; function *local_28; function *local_20; UnaryOpT *local_18; FlatBufferBuilder *local_10; local_3c = *(int4 *)param_2; local_40 = *(int4 *)(param_2 + 4); local_38 = param_1; local_30 = param_2; local_28 = param_3; local_20 = param_3; local_18 = param_2; local_10 = param_1; lVar2 = std::vector<signed_char,std::allocator<signed_char>>::size_abi_nn200100_ ((vector<signed_char,std::allocator<signed_char>> *)(param_2 + 8)); if (lVar2 == 0) { flatbuffers::Offset<flatbuffers::Vector<signed_char>>::Offset ((Offset<flatbuffers::Vector<signed_char>> *)&local_44,0); } else { local_44 = flatbuffers::FlatBufferBuilder::CreateVector<signed_char> (local_10,(vector *)(local_18 + 8)); } uVar1 = CreateUnaryOp(local_10,local_3c,local_40,local_44); return uVar1; }
2,968
nglog::LogDestination::LogToSinks(nglog::LogSeverity, char const*, char const*, int, nglog::LogMessageTime const&, char const*, unsigned long)
ng-log[P]ng-log/src/logging.cc
inline void LogDestination::LogToSinks(LogSeverity severity, const char* full_filename, const char* base_filename, int line, const LogMessageTime& time, const char* message, size_t message_len) { std::shared_lock<SinkMutex> l{sink_mutex_}; if (sinks_) { for (size_t i = sinks_->size(); i-- > 0;) { (*sinks_)[i]->send(severity, full_filename, base_filename, line, time, message, message_len); } } }
O0
cpp
nglog::LogDestination::LogToSinks(nglog::LogSeverity, char const*, char const*, int, nglog::LogMessageTime const&, char const*, unsigned long): pushq %rbp movq %rsp, %rbp pushq %rbx subq $0x68, %rsp movq 0x10(%rbp), %rax movl %edi, -0xc(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movl %ecx, -0x24(%rbp) movq %r8, -0x30(%rbp) movq %r9, -0x38(%rbp) leaq -0x48(%rbp), %rdi leaq 0x5a32a(%rip), %rsi # 0x77e68 callq 0x21200 leaq 0x5a316(%rip), %rdi # 0x77e60 callq 0x21230 testb $0x1, %al jne 0x1db58 jmp 0x1dbeb leaq 0x5a301(%rip), %rdi # 0x77e60 callq 0x21260 movq %rax, %rdi callq 0x21280 movq %rax, -0x50(%rbp) movq -0x50(%rbp), %rax movq %rax, %rcx addq $-0x1, %rcx movq %rcx, -0x50(%rbp) cmpq $0x0, %rax jbe 0x1dbe9 leaq 0x5a2d4(%rip), %rdi # 0x77e60 callq 0x212a0 movq %rax, %rdi movq -0x50(%rbp), %rsi callq 0x212d0 movq (%rax), %rdi movl -0xc(%rbp), %esi movq -0x18(%rbp), %rdx movq -0x20(%rbp), %rcx movl -0x24(%rbp), %r8d movq -0x30(%rbp), %r9 movq -0x38(%rbp), %r11 movq 0x10(%rbp), %rbx movq (%rdi), %rax movq 0x10(%rax), %rax movq %rsp, %r10 movq %rbx, 0x8(%r10) movq %r11, (%r10) callq *%rax jmp 0x1dbd0 jmp 0x1db70 movq %rax, %rcx movl %edx, %eax movq %rcx, -0x58(%rbp) movl %eax, -0x5c(%rbp) leaq -0x48(%rbp), %rdi callq 0x212f0 jmp 0x1dbfb jmp 0x1dbeb leaq -0x48(%rbp), %rdi callq 0x212f0 addq $0x68, %rsp popq %rbx popq %rbp retq movq -0x58(%rbp), %rdi callq 0x9d40 nopw %cs:(%rax,%rax) nop
_ZN5nglog14LogDestination10LogToSinksENS_11LogSeverityEPKcS3_iRKNS_14LogMessageTimeES3_m: push rbp mov rbp, rsp push rbx sub rsp, 68h mov rax, [rbp+arg_0] mov [rbp+var_C], edi mov [rbp+var_18], rsi mov [rbp+var_20], rdx mov [rbp+var_24], ecx mov [rbp+var_30], r8 mov [rbp+var_38], r9 lea rdi, [rbp+var_48] lea rsi, _ZN5nglog14LogDestination11sink_mutex_E; nglog::LogDestination::sink_mutex_ call _ZNSt11shared_lockISt12shared_mutexEC2ERS0_; std::shared_lock<std::shared_mutex>::shared_lock(std::shared_mutex&) lea rdi, _ZN5nglog14LogDestination6sinks_E; nglog::LogDestination::sinks_ call _ZNKSt10unique_ptrISt6vectorIPN5nglog7LogSinkESaIS3_EESt14default_deleteIS5_EEcvbEv; std::unique_ptr<std::vector<nglog::LogSink *>>::operator bool(void) test al, 1 jnz short loc_1DB58 jmp loc_1DBEB loc_1DB58: lea rdi, _ZN5nglog14LogDestination6sinks_E; nglog::LogDestination::sinks_ call _ZNKSt10unique_ptrISt6vectorIPN5nglog7LogSinkESaIS3_EESt14default_deleteIS5_EEptEv; std::unique_ptr<std::vector<nglog::LogSink *>>::operator->(void) mov rdi, rax call _ZNKSt6vectorIPN5nglog7LogSinkESaIS2_EE4sizeEv; std::vector<nglog::LogSink *>::size(void) mov [rbp+var_50], rax loc_1DB70: mov rax, [rbp+var_50] mov rcx, rax add rcx, 0FFFFFFFFFFFFFFFFh mov [rbp+var_50], rcx cmp rax, 0 jbe short loc_1DBE9 lea rdi, _ZN5nglog14LogDestination6sinks_E; nglog::LogDestination::sinks_ call _ZNKSt10unique_ptrISt6vectorIPN5nglog7LogSinkESaIS3_EESt14default_deleteIS5_EEdeEv; std::unique_ptr<std::vector<nglog::LogSink *>>::operator*(void) mov rdi, rax mov rsi, [rbp+var_50] call _ZNSt6vectorIPN5nglog7LogSinkESaIS2_EEixEm; std::vector<nglog::LogSink *>::operator[](ulong) mov rdi, [rax] mov esi, [rbp+var_C] mov rdx, [rbp+var_18] mov rcx, [rbp+var_20] mov r8d, [rbp+var_24] mov r9, [rbp+var_30] mov r11, [rbp+var_38] mov rbx, [rbp+arg_0] mov rax, [rdi] mov rax, [rax+10h] mov r10, rsp mov [r10+8], rbx mov [r10], r11 call rax jmp short $+2 loc_1DBD0: jmp short loc_1DB70 mov rcx, rax mov eax, edx mov [rbp+var_58], rcx mov [rbp+var_5C], eax lea rdi, [rbp+var_48] call _ZNSt11shared_lockISt12shared_mutexED2Ev; std::shared_lock<std::shared_mutex>::~shared_lock() jmp short loc_1DBFB loc_1DBE9: jmp short $+2 loc_1DBEB: lea rdi, [rbp+var_48] call _ZNSt11shared_lockISt12shared_mutexED2Ev; std::shared_lock<std::shared_mutex>::~shared_lock() add rsp, 68h pop rbx pop rbp retn loc_1DBFB: mov rdi, [rbp+var_58] call __Unwind_Resume
long long nglog::LogDestination::LogToSinks( unsigned int a1, long long a2, long long a3, unsigned int a4, long long a5, long long a6, long long a7) { long long v7; // rax long long v9; // rax _QWORD *v10; // rax long long v12; // [rsp+20h] [rbp-50h] _BYTE v13[16]; // [rsp+28h] [rbp-48h] BYREF long long v14; // [rsp+38h] [rbp-38h] long long v15; // [rsp+40h] [rbp-30h] unsigned int v16; // [rsp+4Ch] [rbp-24h] long long v17; // [rsp+50h] [rbp-20h] long long v18; // [rsp+58h] [rbp-18h] unsigned int v19; // [rsp+64h] [rbp-Ch] v19 = a1; v18 = a2; v17 = a3; v16 = a4; v15 = a5; v14 = a6; std::shared_lock<std::shared_mutex>::shared_lock(v13, &nglog::LogDestination::sink_mutex_); if ( (std::unique_ptr<std::vector<nglog::LogSink *>>::operator bool(&nglog::LogDestination::sinks_) & 1) != 0 ) { v7 = std::unique_ptr<std::vector<nglog::LogSink *>>::operator->(&nglog::LogDestination::sinks_); v12 = std::vector<nglog::LogSink *>::size(v7); while ( v12-- ) { v9 = std::unique_ptr<std::vector<nglog::LogSink *>>::operator*(&nglog::LogDestination::sinks_); v10 = (_QWORD *)std::vector<nglog::LogSink *>::operator[](v9, v12); (*(void ( **)(_QWORD, _QWORD, long long, long long, _QWORD, long long, long long, long long))(*(_QWORD *)*v10 + 16LL))( *v10, v19, v18, v17, v16, v15, v14, a7); } } return std::shared_lock<std::shared_mutex>::~shared_lock(v13); }
LogToSinks: PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x68 MOV RAX,qword ptr [RBP + 0x10] MOV dword ptr [RBP + -0xc],EDI MOV qword ptr [RBP + -0x18],RSI MOV qword ptr [RBP + -0x20],RDX MOV dword ptr [RBP + -0x24],ECX MOV qword ptr [RBP + -0x30],R8 MOV qword ptr [RBP + -0x38],R9 LEA RDI,[RBP + -0x48] LEA RSI,[0x177e68] CALL 0x00121200 LEA RDI,[0x177e60] CALL 0x00121230 TEST AL,0x1 JNZ 0x0011db58 JMP 0x0011dbeb LAB_0011db58: LEA RDI,[0x177e60] CALL 0x00121260 MOV RDI,RAX CALL 0x00121280 MOV qword ptr [RBP + -0x50],RAX LAB_0011db70: MOV RAX,qword ptr [RBP + -0x50] MOV RCX,RAX ADD RCX,-0x1 MOV qword ptr [RBP + -0x50],RCX CMP RAX,0x0 JBE 0x0011dbe9 LEA RDI,[0x177e60] CALL 0x001212a0 MOV RDI,RAX MOV RSI,qword ptr [RBP + -0x50] CALL 0x001212d0 MOV RDI,qword ptr [RAX] MOV ESI,dword ptr [RBP + -0xc] MOV RDX,qword ptr [RBP + -0x18] MOV RCX,qword ptr [RBP + -0x20] MOV R8D,dword ptr [RBP + -0x24] MOV R9,qword ptr [RBP + -0x30] MOV R11,qword ptr [RBP + -0x38] MOV RBX,qword ptr [RBP + 0x10] MOV RAX,qword ptr [RDI] MOV RAX,qword ptr [RAX + 0x10] LAB_0011dbc2: MOV R10,RSP MOV qword ptr [R10 + 0x8],RBX MOV qword ptr [R10],R11 CALL RAX LAB_0011dbce: JMP 0x0011dbd0 LAB_0011dbd0: JMP 0x0011db70 LAB_0011dbe9: JMP 0x0011dbeb LAB_0011dbeb: LEA RDI,[RBP + -0x48] CALL 0x001212f0 ADD RSP,0x68 POP RBX POP RBP RET
/* nglog::LogDestination::LogToSinks(nglog::LogSeverity, char const*, char const*, int, nglog::LogMessageTime const&, char const*, unsigned long) */ void nglog::LogDestination::LogToSinks (int4 param_1,int8 param_2,int8 param_3,int4 param_4, int8 param_5,int8 param_6,int8 param_7) { bool bVar1; vector<nglog::LogSink*,std::allocator<nglog::LogSink*>> *pvVar2; int8 *puVar3; ulong local_58; shared_lock<std::shared_mutex> local_50 [16]; int8 local_40; int8 local_38; int4 local_2c; int8 local_28; int8 local_20; int4 local_14; local_40 = param_6; local_38 = param_5; local_2c = param_4; local_28 = param_3; local_20 = param_2; local_14 = param_1; std::shared_lock<std::shared_mutex>::shared_lock(local_50,(shared_mutex *)sink_mutex_); bVar1 = std::unique_ptr::operator_cast_to_bool((unique_ptr *)&sinks_); if (bVar1) { pvVar2 = (vector<nglog::LogSink*,std::allocator<nglog::LogSink*>> *) std:: unique_ptr<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>,std::default_delete<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>>> ::operator->((unique_ptr<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>,std::default_delete<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>>> *)&sinks_); local_58 = std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>::size(pvVar2); while (local_58 != 0) { pvVar2 = (vector<nglog::LogSink*,std::allocator<nglog::LogSink*>> *) std:: unique_ptr<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>,std::default_delete<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>>> ::operator*((unique_ptr<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>,std::default_delete<std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>>> *)&sinks_); puVar3 = (int8 *) std::vector<nglog::LogSink*,std::allocator<nglog::LogSink*>>::operator[] (pvVar2,local_58 - 1); /* try { // try from 0011dbc2 to 0011dbcd has its CatchHandler @ 0011dbd2 */ (**(code **)(*(long *)*puVar3 + 0x10)) ((long *)*puVar3,local_14,local_20,local_28,local_2c,local_38,local_40,param_7); local_58 = local_58 - 1; } } std::shared_lock<std::shared_mutex>::~shared_lock(local_50); return; }
2,969
thr_downgrade_write_lock
eloqsql/mysys/thr_lock.c
void thr_downgrade_write_lock(THR_LOCK_DATA *in_data, enum thr_lock_type new_lock_type) { THR_LOCK *lock=in_data->lock; #ifdef DBUG_ASSERT_EXISTS enum thr_lock_type old_lock_type= in_data->type; #endif DBUG_ENTER("thr_downgrade_write_only_lock"); mysql_mutex_lock(&lock->mutex); DBUG_ASSERT(old_lock_type == TL_WRITE_ONLY); DBUG_ASSERT(old_lock_type > new_lock_type); in_data->type= new_lock_type; check_locks(lock,"after downgrading lock", old_lock_type, 0); mysql_mutex_unlock(&lock->mutex); DBUG_VOID_RETURN; }
O0
c
thr_downgrade_write_lock: pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq -0x8(%rbp), %rax movq 0x18(%rax), %rax movq %rax, -0x18(%rbp) movq -0x18(%rbp), %rdi addq $0x18, %rdi leaq 0x5fb50(%rip), %rsi # 0x15d64a movl $0x591, %edx # imm = 0x591 callq 0xfc3f0 jmp 0xfdb06 jmp 0xfdb08 jmp 0xfdb0a movl -0xc(%rbp), %ecx movq -0x8(%rbp), %rax movl %ecx, 0x40(%rax) movq -0x18(%rbp), %rdi addq $0x18, %rdi callq 0xfc460 jmp 0xfdb23 addq $0x20, %rsp popq %rbp retq nopl (%rax)
thr_downgrade_write_lock: push rbp mov rbp, rsp sub rsp, 20h mov [rbp+var_8], rdi mov [rbp+var_C], esi mov rax, [rbp+var_8] mov rax, [rax+18h] mov [rbp+var_18], rax mov rdi, [rbp+var_18] add rdi, 18h lea rsi, aWorkspaceLlm4b_39; "/workspace/llm4binary/github2025/eloqsq"... mov edx, 591h call inline_mysql_mutex_lock_27 jmp short $+2 loc_FDB06: jmp short $+2 loc_FDB08: jmp short $+2 loc_FDB0A: mov ecx, [rbp+var_C] mov rax, [rbp+var_8] mov [rax+40h], ecx mov rdi, [rbp+var_18] add rdi, 18h call inline_mysql_mutex_unlock_28 jmp short $+2 loc_FDB23: add rsp, 20h pop rbp retn
long long thr_downgrade_write_lock(long long a1, int a2) { long long v3; // [rsp+8h] [rbp-18h] v3 = *(_QWORD *)(a1 + 24); inline_mysql_mutex_lock_27(v3 + 24, (long long)"/workspace/llm4binary/github2025/eloqsql/mysys/thr_lock.c", 0x591u); *(_DWORD *)(a1 + 64) = a2; return inline_mysql_mutex_unlock_28(v3 + 24); }
thr_downgrade_write_lock: PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + -0x8],RDI MOV dword ptr [RBP + -0xc],ESI MOV RAX,qword ptr [RBP + -0x8] MOV RAX,qword ptr [RAX + 0x18] MOV qword ptr [RBP + -0x18],RAX MOV RDI,qword ptr [RBP + -0x18] ADD RDI,0x18 LEA RSI,[0x25d64a] MOV EDX,0x591 CALL 0x001fc3f0 JMP 0x001fdb06 LAB_001fdb06: JMP 0x001fdb08 LAB_001fdb08: JMP 0x001fdb0a LAB_001fdb0a: MOV ECX,dword ptr [RBP + -0xc] MOV RAX,qword ptr [RBP + -0x8] MOV dword ptr [RAX + 0x40],ECX MOV RDI,qword ptr [RBP + -0x18] ADD RDI,0x18 CALL 0x001fc460 JMP 0x001fdb23 LAB_001fdb23: ADD RSP,0x20 POP RBP RET
void thr_downgrade_write_lock(long param_1,int4 param_2) { long lVar1; lVar1 = *(long *)(param_1 + 0x18); inline_mysql_mutex_lock (lVar1 + 0x18,"/workspace/llm4binary/github2025/eloqsql/mysys/thr_lock.c",0x591); *(int4 *)(param_1 + 0x40) = param_2; inline_mysql_mutex_unlock(lVar1 + 0x18); return; }
2,970
bfdec_print_str
bluesky950520[P]quickjs/libbf.c
void bfdec_print_str(const char *str, const bfdec_t *a) { slimb_t i; printf("%s=", str); if (a->expn == BF_EXP_NAN) { printf("NaN"); } else { if (a->sign) putchar('-'); if (a->expn == BF_EXP_ZERO) { putchar('0'); } else if (a->expn == BF_EXP_INF) { printf("Inf"); } else { printf("0."); for(i = a->len - 1; i >= 0; i--) printf("%0*" PRIu_LIMB, LIMB_DIGITS, a->tab[i]); printf("e%" PRId_LIMB, a->expn); } } printf("\n"); }
O1
c
bfdec_print_str: pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %rsi leaq 0x14e05(%rip), %rdi # 0xa313e xorl %eax, %eax callq 0xe280 movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF cmpq %rax, 0x10(%rbx) jne 0x8e359 leaq 0x12310(%rip), %rdi # 0xa0667 jmp 0x8e394 cmpl $0x0, 0x8(%rbx) je 0x8e369 movl $0x2d, %edi callq 0xe080 movq 0x10(%rbx), %rax movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE cmpq %rcx, %rax je 0x8e38d negq %rax jno 0x8e3aa movl $0x30, %edi callq 0xe080 jmp 0x8e39b leaq 0x14dae(%rip), %rdi # 0xa3142 xorl %eax, %eax callq 0xe280 movl $0xa, %edi popq %rbx popq %r14 popq %r15 jmp 0xe080 leaq 0x14d97(%rip), %rdi # 0xa3148 xorl %eax, %eax callq 0xe280 movq 0x18(%rbx), %r15 movq %r15, %rax decq %rax js 0x8e3eb leaq 0x14d85(%rip), %r14 # 0xa3150 movq 0x20(%rbx), %rax movq -0x8(%rax,%r15,8), %rdx movq %r14, %rdi movl $0x13, %esi xorl %eax, %eax callq 0xe280 decq %r15 testq %r15, %r15 jg 0x8e3cb movq 0x10(%rbx), %rsi leaq 0x14d60(%rip), %rdi # 0xa3156 xorl %eax, %eax callq 0xe280 jmp 0x8e39b
bfdec_print_str: push r15 push r14 push rbx mov rbx, rsi mov rsi, rdi lea rdi, aS_2; "%s=" xor eax, eax call _printf mov rax, 7FFFFFFFFFFFFFFFh cmp [rbx+10h], rax jnz short loc_8E359 lea rdi, aDateValueIsNan+0Eh; "NaN" jmp short loc_8E394 loc_8E359: cmp dword ptr [rbx+8], 0 jz short loc_8E369 mov edi, 2Dh ; '-' call _putchar loc_8E369: mov rax, [rbx+10h] mov rcx, 7FFFFFFFFFFFFFFEh cmp rax, rcx jz short loc_8E38D neg rax jno short loc_8E3AA mov edi, 30h ; '0' call _putchar jmp short loc_8E39B loc_8E38D: lea rdi, aInf; "Inf" loc_8E394: xor eax, eax call _printf loc_8E39B: mov edi, 0Ah pop rbx pop r14 pop r15 jmp _putchar loc_8E3AA: lea rdi, a0x0+2; "0." xor eax, eax call _printf mov r15, [rbx+18h] mov rax, r15 dec rax js short loc_8E3EB lea r14, a0Lu; "%0*lu" loc_8E3CB: mov rax, [rbx+20h] mov rdx, [rax+r15*8-8] mov rdi, r14 mov esi, 13h xor eax, eax call _printf dec r15 test r15, r15 jg short loc_8E3CB loc_8E3EB: mov rsi, [rbx+10h] lea rdi, aELd; "e%ld" xor eax, eax call _printf jmp short loc_8E39B
long long bfdec_print_str(const char *a1, long long a2) { long long v2; // rax long long v4; // r15 printf("%s=", a1); if ( *(_QWORD *)(a2 + 16) == 0x7FFFFFFFFFFFFFFFLL ) { printf("NaN"); } else { if ( *(_DWORD *)(a2 + 8) ) putchar(45LL); v2 = *(_QWORD *)(a2 + 16); if ( v2 == 0x7FFFFFFFFFFFFFFELL ) { printf("Inf"); } else if ( __OFSUB__(-v2, 1LL) ) { putchar(48LL); } else { printf("0."); v4 = *(_QWORD *)(a2 + 24); if ( v4 - 1 >= 0 ) { do printf("%0*lu", 19, *(_QWORD *)(*(_QWORD *)(a2 + 32) + 8 * v4-- - 8)); while ( v4 > 0 ); } printf("e%ld", *(_QWORD *)(a2 + 16)); } } return putchar(10LL); }
2,971
bfdec_print_str
bluesky950520[P]quickjs/libbf.c
void bfdec_print_str(const char *str, const bfdec_t *a) { slimb_t i; printf("%s=", str); if (a->expn == BF_EXP_NAN) { printf("NaN"); } else { if (a->sign) putchar('-'); if (a->expn == BF_EXP_ZERO) { putchar('0'); } else if (a->expn == BF_EXP_INF) { printf("Inf"); } else { printf("0."); for(i = a->len - 1; i >= 0; i--) printf("%0*" PRIu_LIMB, LIMB_DIGITS, a->tab[i]); printf("e%" PRId_LIMB, a->expn); } } printf("\n"); }
O2
c
bfdec_print_str: pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %rsi leaq 0x13476(%rip), %rdi # 0x8a07e xorl %eax, %eax callq 0xe290 movq 0x10(%rbx), %rax movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF cmpq %rcx, %rax jne 0x76c2b leaq 0x10978(%rip), %rdi # 0x875a1 jmp 0x76c62 cmpl $0x0, 0x8(%rbx) je 0x76c3d pushq $0x2d popq %rdi callq 0xe080 movq 0x10(%rbx), %rax movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE cmpq %rcx, %rax je 0x76c5b negq %rax jno 0x76c7b pushq $0x30 popq %rdi callq 0xe080 jmp 0x76c69 leaq 0x13420(%rip), %rdi # 0x8a082 xorl %eax, %eax callq 0xe290 pushq $0xa popq %rdi addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0xe080 leaq 0x13406(%rip), %rdi # 0x8a088 xorl %eax, %eax callq 0xe290 movq 0x18(%rbx), %r15 decq %r15 leaq 0x133f9(%rip), %r14 # 0x8a090 pushq $0x13 popq %rbp testq %r15, %r15 js 0x76cb8 movq 0x20(%rbx), %rax movq (%rax,%r15,8), %rdx movq %r14, %rdi movl %ebp, %esi xorl %eax, %eax callq 0xe290 decq %r15 jmp 0x76c9a movq 0x10(%rbx), %rsi leaq 0x133d3(%rip), %rdi # 0x8a096 xorl %eax, %eax callq 0xe290 jmp 0x76c69
bfdec_print_str: push rbp push r15 push r14 push rbx push rax mov rbx, rsi mov rsi, rdi lea rdi, aS_2; "%s=" xor eax, eax call _printf mov rax, [rbx+10h] mov rcx, 7FFFFFFFFFFFFFFFh cmp rax, rcx jnz short loc_76C2B lea rdi, aDateValueIsNan+0Eh; "NaN" jmp short loc_76C62 loc_76C2B: cmp dword ptr [rbx+8], 0 jz short loc_76C3D push 2Dh ; '-' pop rdi call _putchar mov rax, [rbx+10h] loc_76C3D: mov rcx, 7FFFFFFFFFFFFFFEh cmp rax, rcx jz short loc_76C5B neg rax jno short loc_76C7B push 30h ; '0' pop rdi call _putchar jmp short loc_76C69 loc_76C5B: lea rdi, aInf; "Inf" loc_76C62: xor eax, eax call _printf loc_76C69: push 0Ah pop rdi add rsp, 8 pop rbx pop r14 pop r15 pop rbp jmp _putchar loc_76C7B: lea rdi, a0x0+2; "0." xor eax, eax call _printf mov r15, [rbx+18h] dec r15 lea r14, a0Lu; "%0*lu" push 13h pop rbp loc_76C9A: test r15, r15 js short loc_76CB8 mov rax, [rbx+20h] mov rdx, [rax+r15*8] mov rdi, r14 mov esi, ebp xor eax, eax call _printf dec r15 jmp short loc_76C9A loc_76CB8: mov rsi, [rbx+10h] lea rdi, aELd; "e%ld" xor eax, eax call _printf jmp short loc_76C69
long long bfdec_print_str(const char *a1, long long a2) { long long v2; // rax long long i; // r15 printf("%s=", a1); v2 = *(_QWORD *)(a2 + 16); if ( v2 == 0x7FFFFFFFFFFFFFFFLL ) { printf("NaN"); } else { if ( *(_DWORD *)(a2 + 8) ) { putchar(45LL); v2 = *(_QWORD *)(a2 + 16); } if ( v2 == 0x7FFFFFFFFFFFFFFELL ) { printf("Inf"); } else if ( __OFSUB__(-v2, 1LL) ) { putchar(48LL); } else { printf("0."); for ( i = *(_QWORD *)(a2 + 24) - 1LL; i >= 0; --i ) printf("%0*lu", 19, *(_QWORD *)(*(_QWORD *)(a2 + 32) + 8 * i)); printf("e%ld", *(_QWORD *)(a2 + 16)); } } return putchar(10LL); }
bfdec_print_str: PUSH RBP PUSH R15 PUSH R14 PUSH RBX PUSH RAX MOV RBX,RSI MOV RSI,RDI LEA RDI,[0x18a07e] XOR EAX,EAX CALL 0x0010e290 MOV RAX,qword ptr [RBX + 0x10] MOV RCX,0x7fffffffffffffff CMP RAX,RCX JNZ 0x00176c2b LEA RDI,[0x1875a1] JMP 0x00176c62 LAB_00176c2b: CMP dword ptr [RBX + 0x8],0x0 JZ 0x00176c3d PUSH 0x2d POP RDI CALL 0x0010e080 MOV RAX,qword ptr [RBX + 0x10] LAB_00176c3d: MOV RCX,0x7ffffffffffffffe CMP RAX,RCX JZ 0x00176c5b NEG RAX JNO 0x00176c7b PUSH 0x30 POP RDI CALL 0x0010e080 JMP 0x00176c69 LAB_00176c5b: LEA RDI,[0x18a082] LAB_00176c62: XOR EAX,EAX CALL 0x0010e290 LAB_00176c69: PUSH 0xa POP RDI ADD RSP,0x8 POP RBX POP R14 POP R15 POP RBP JMP 0x0010e080 LAB_00176c7b: LEA RDI,[0x18a088] XOR EAX,EAX CALL 0x0010e290 MOV R15,qword ptr [RBX + 0x18] DEC R15 LEA R14,[0x18a090] PUSH 0x13 POP RBP LAB_00176c9a: TEST R15,R15 JS 0x00176cb8 MOV RAX,qword ptr [RBX + 0x20] MOV RDX,qword ptr [RAX + R15*0x8] MOV RDI,R14 MOV ESI,EBP XOR EAX,EAX CALL 0x0010e290 DEC R15 JMP 0x00176c9a LAB_00176cb8: MOV RSI,qword ptr [RBX + 0x10] LEA RDI,[0x18a096] XOR EAX,EAX CALL 0x0010e290 JMP 0x00176c69
/* WARNING: Removing unreachable block (ram,0x00176c51) */ void bfdec_print_str(int8 param_1,long param_2) { char *__format; long lVar1; printf("%s=",param_1); lVar1 = *(long *)(param_2 + 0x10); if (lVar1 == 0x7fffffffffffffff) { __format = "NaN"; } else { if (*(int *)(param_2 + 8) != 0) { putchar(0x2d); lVar1 = *(long *)(param_2 + 0x10); } if (lVar1 != 0x7ffffffffffffffe) { printf("0."); lVar1 = *(long *)(param_2 + 0x18); while (lVar1 = lVar1 + -1, -1 < lVar1) { printf("%0*lu",0x13,*(int8 *)(*(long *)(param_2 + 0x20) + lVar1 * 8)); } printf("e%ld",*(int8 *)(param_2 + 0x10)); goto LAB_00176c69; } __format = "Inf"; } printf(__format); LAB_00176c69: putchar(10); return; }
2,972
sp_head::propagate_attributes(Query_tables_list*)
eloqsql/sql/sp_head.h
void propagate_attributes(Query_tables_list *prelocking_ctx) { DBUG_ENTER("sp_head::propagate_attributes"); /* If this routine needs row-based binary logging, the entire top statement too (we cannot switch from statement-based to row-based only for this routine, as in statement-based the top-statement may be binlogged and the substatements not). */ DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", prelocking_ctx->get_stmt_unsafe_flags())); DBUG_PRINT("info", ("sp_head(%p=%s)->unsafe_flags: 0x%x", this, name()->str, unsafe_flags)); prelocking_ctx->set_stmt_unsafe_flags(unsafe_flags); DBUG_VOID_RETURN; }
O0
c
sp_head::propagate_attributes(Query_tables_list*): pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) jmp 0x53699a jmp 0x53699c jmp 0x53699e movq -0x18(%rbp), %rax movq -0x10(%rbp), %rdi movl 0x218(%rax), %esi callq 0x5383f0 jmp 0x5369b3 addq $0x20, %rsp popq %rbp retq nopl (%rax)
_ZN7sp_head20propagate_attributesEP17Query_tables_list: push rbp mov rbp, rsp sub rsp, 20h mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov rax, [rbp+var_8] mov [rbp+var_18], rax jmp short $+2 loc_53699A: jmp short $+2 loc_53699C: jmp short $+2 loc_53699E: mov rax, [rbp+var_18] mov rdi, [rbp+var_10]; this mov esi, [rax+218h]; unsigned int call _ZN17Query_tables_list21set_stmt_unsafe_flagsEj; Query_tables_list::set_stmt_unsafe_flags(uint) jmp short $+2 loc_5369B3: add rsp, 20h pop rbp retn
long long sp_head::propagate_attributes(sp_head *this, Query_tables_list *a2) { return Query_tables_list::set_stmt_unsafe_flags(a2, *((_DWORD *)this + 134)); }
__cxx_global_var_init.2: PUSH RBP MOV RBP,RSP LEA RDI,[0x16c13ac] MOV ESI,0x4 CALL 0x005a2df0 POP RBP RET
void __cxx_global_var_init_2(void) { date_conv_mode_t::date_conv_mode_t((date_conv_mode_t *)&TIME_TIME_ONLY,4); return; }
2,973
ModbusClientPort::writeMultipleCoilsAsBoolArray(ModbusObject*, unsigned char, unsigned short, unsigned short, bool const*)
serhmarch[P]ModbusBridge/modbus/src/ModbusClientPort.cpp
Modbus::StatusCode ModbusClientPort::writeMultipleCoilsAsBoolArray(ModbusObject *client, uint8_t unit, uint16_t offset, uint16_t count, const bool *values) { ModbusClientPortPrivate *d = d_ModbusClientPort(d_ptr); if (this->currentClient() == nullptr) { for (int i = 0; i < count; i++) { if (!(i & 7)) d->buff[i / 8] = 0; if (values[i] != 0) d->buff[i / 8] |= (1 << (i % 8)); } return writeMultipleCoils(client, unit, offset, count, d->buff); } else if (this->currentClient() == client) return writeMultipleCoils(client, unit, offset, count, d->buff); return Status_Processing; }
O0
cpp
ModbusClientPort::writeMultipleCoilsAsBoolArray(ModbusObject*, unsigned char, unsigned short, unsigned short, bool const*): pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movw %r8w, %ax movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movb %dl, -0x19(%rbp) movw %cx, -0x1c(%rbp) movw %ax, -0x1e(%rbp) movq %r9, -0x28(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x40(%rbp) movq 0x8(%rax), %rdi callq 0x199f0 movq -0x40(%rbp), %rdi movq %rax, -0x30(%rbp) callq 0x18620 cmpq $0x0, %rax jne 0x185c8 movl $0x0, -0x34(%rbp) movl -0x34(%rbp), %eax movzwl -0x1e(%rbp), %ecx cmpl %ecx, %eax jge 0x18596 movl -0x34(%rbp), %eax andl $0x7, %eax cmpl $0x0, %eax jne 0x18530 movq -0x30(%rbp), %rax movq %rax, -0x48(%rbp) movl -0x34(%rbp), %eax movl $0x8, %ecx cltd idivl %ecx movl %eax, %ecx movq -0x48(%rbp), %rax movslq %ecx, %rcx movb $0x0, 0x84(%rax,%rcx) movq -0x28(%rbp), %rax movslq -0x34(%rbp), %rcx movb (%rax,%rcx), %al andb $0x1, %al movzbl %al, %eax cmpl $0x0, %eax je 0x18586 movl -0x34(%rbp), %eax movl $0x8, %ecx cltd idivl %ecx movl %edx, %ecx movl $0x1, %esi shll %cl, %esi movq -0x30(%rbp), %rax movq %rax, -0x50(%rbp) movl -0x34(%rbp), %eax movl $0x8, %ecx cltd idivl %ecx movl %eax, %ecx movq -0x50(%rbp), %rax movslq %ecx, %rcx movzbl 0x84(%rax,%rcx), %edx orl %esi, %edx movb %dl, 0x84(%rax,%rcx) jmp 0x18588 movl -0x34(%rbp), %eax addl $0x1, %eax movl %eax, -0x34(%rbp) jmp 0x184f2 movq -0x40(%rbp), %rdi movq -0x18(%rbp), %rsi movb -0x19(%rbp), %dl movw -0x1c(%rbp), %cx movw -0x1e(%rbp), %ax movq -0x30(%rbp), %r9 addq $0x84, %r9 movzbl %dl, %edx movzwl %cx, %ecx movzwl %ax, %r8d callq 0x16540 movl %eax, -0x4(%rbp) jmp 0x18612 movq -0x40(%rbp), %rdi callq 0x18620 cmpq -0x18(%rbp), %rax jne 0x18609 movq -0x40(%rbp), %rdi movq -0x18(%rbp), %rsi movb -0x19(%rbp), %dl movw -0x1c(%rbp), %cx movw -0x1e(%rbp), %ax movq -0x30(%rbp), %r9 addq $0x84, %r9 movzbl %dl, %edx movzwl %cx, %ecx movzwl %ax, %r8d callq 0x16540 movl %eax, -0x4(%rbp) jmp 0x18612 jmp 0x1860b movl $0x80000000, -0x4(%rbp) # imm = 0x80000000 movl -0x4(%rbp), %eax addq $0x50, %rsp popq %rbp retq nopl (%rax,%rax)
_ZN16ModbusClientPort29writeMultipleCoilsAsBoolArrayEP12ModbusObjecthttPKb: push rbp mov rbp, rsp sub rsp, 50h mov ax, r8w mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov [rbp+var_19], dl mov [rbp+var_1C], cx mov [rbp+var_1E], ax mov [rbp+var_28], r9 mov rax, [rbp+var_10] mov [rbp+var_40], rax mov rdi, [rax+8] call _Z18d_ModbusClientPortP19ModbusObjectPrivate; d_ModbusClientPort(ModbusObjectPrivate *) mov rdi, [rbp+var_40]; this mov [rbp+var_30], rax call _ZNK16ModbusClientPort13currentClientEv; ModbusClientPort::currentClient(void) cmp rax, 0 jnz loc_185C8 mov [rbp+var_34], 0 loc_184F2: mov eax, [rbp+var_34] movzx ecx, [rbp+var_1E] cmp eax, ecx jge loc_18596 mov eax, [rbp+var_34] and eax, 7 cmp eax, 0 jnz short loc_18530 mov rax, [rbp+var_30] mov [rbp+var_48], rax mov eax, [rbp+var_34] mov ecx, 8 cdq idiv ecx mov ecx, eax mov rax, [rbp+var_48] movsxd rcx, ecx mov byte ptr [rax+rcx+84h], 0 loc_18530: mov rax, [rbp+var_28] movsxd rcx, [rbp+var_34] mov al, [rax+rcx] and al, 1 movzx eax, al cmp eax, 0 jz short loc_18586 mov eax, [rbp+var_34] mov ecx, 8 cdq idiv ecx mov ecx, edx mov esi, 1 shl esi, cl mov rax, [rbp+var_30] mov [rbp+var_50], rax mov eax, [rbp+var_34] mov ecx, 8 cdq idiv ecx mov ecx, eax mov rax, [rbp+var_50] movsxd rcx, ecx movzx edx, byte ptr [rax+rcx+84h] or edx, esi mov [rax+rcx+84h], dl loc_18586: jmp short $+2 loc_18588: mov eax, [rbp+var_34] add eax, 1 mov [rbp+var_34], eax jmp loc_184F2 loc_18596: mov rdi, [rbp+var_40]; this mov rsi, [rbp+var_18]; ModbusObject * mov dl, [rbp+var_19] mov cx, [rbp+var_1C] mov ax, [rbp+var_1E] mov r9, [rbp+var_30] add r9, 84h; void * movzx edx, dl; unsigned __int8 movzx ecx, cx; unsigned __int16 movzx r8d, ax; unsigned __int16 call _ZN16ModbusClientPort18writeMultipleCoilsEP12ModbusObjecthttPKv; ModbusClientPort::writeMultipleCoils(ModbusObject *,uchar,ushort,ushort,void const*) mov [rbp+var_4], eax jmp short loc_18612 loc_185C8: mov rdi, [rbp+var_40]; this call _ZNK16ModbusClientPort13currentClientEv; ModbusClientPort::currentClient(void) cmp rax, [rbp+var_18] jnz short loc_18609 mov rdi, [rbp+var_40]; this mov rsi, [rbp+var_18]; ModbusObject * mov dl, [rbp+var_19] mov cx, [rbp+var_1C] mov ax, [rbp+var_1E] mov r9, [rbp+var_30] add r9, 84h; void * movzx edx, dl; unsigned __int8 movzx ecx, cx; unsigned __int16 movzx r8d, ax; unsigned __int16 call _ZN16ModbusClientPort18writeMultipleCoilsEP12ModbusObjecthttPKv; ModbusClientPort::writeMultipleCoils(ModbusObject *,uchar,ushort,ushort,void const*) mov [rbp+var_4], eax jmp short loc_18612 loc_18609: jmp short $+2 loc_1860B: mov [rbp+var_4], 80000000h loc_18612: mov eax, [rbp+var_4] add rsp, 50h pop rbp retn
long long ModbusClientPort::writeMultipleCoilsAsBoolArray( ModbusObjectPrivate **this, ModbusObject *a2, unsigned __int8 a3, unsigned __int16 a4, unsigned __int16 a5, const bool *a6) { int i; // [rsp+1Ch] [rbp-34h] long long v8; // [rsp+20h] [rbp-30h] v8 = d_ModbusClientPort(this[1]); if ( ModbusClientPort::currentClient((ModbusClientPort *)this) ) { if ( (ModbusObject *)ModbusClientPort::currentClient((ModbusClientPort *)this) != a2 ) return 0x80000000; } else { for ( i = 0; i < a5; ++i ) { if ( (i & 7) == 0 ) *(_BYTE *)(v8 + i / 8 + 132) = 0; if ( a6[i] ) *(_BYTE *)(v8 + i / 8 + 132) |= 1 << (i % 8); } } return (unsigned int)ModbusClientPort::writeMultipleCoils(this, a2, a3, a4, a5, (const void *)(v8 + 132)); }
writeMultipleCoilsAsBoolArray: PUSH RBP MOV RBP,RSP SUB RSP,0x50 MOV AX,R8W MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV byte ptr [RBP + -0x19],DL MOV word ptr [RBP + -0x1c],CX MOV word ptr [RBP + -0x1e],AX MOV qword ptr [RBP + -0x28],R9 MOV RAX,qword ptr [RBP + -0x10] MOV qword ptr [RBP + -0x40],RAX MOV RDI,qword ptr [RAX + 0x8] CALL 0x001199f0 MOV RDI,qword ptr [RBP + -0x40] MOV qword ptr [RBP + -0x30],RAX CALL 0x00118620 CMP RAX,0x0 JNZ 0x001185c8 MOV dword ptr [RBP + -0x34],0x0 LAB_001184f2: MOV EAX,dword ptr [RBP + -0x34] MOVZX ECX,word ptr [RBP + -0x1e] CMP EAX,ECX JGE 0x00118596 MOV EAX,dword ptr [RBP + -0x34] AND EAX,0x7 CMP EAX,0x0 JNZ 0x00118530 MOV RAX,qword ptr [RBP + -0x30] MOV qword ptr [RBP + -0x48],RAX MOV EAX,dword ptr [RBP + -0x34] MOV ECX,0x8 CDQ IDIV ECX MOV ECX,EAX MOV RAX,qword ptr [RBP + -0x48] MOVSXD RCX,ECX MOV byte ptr [RAX + RCX*0x1 + 0x84],0x0 LAB_00118530: MOV RAX,qword ptr [RBP + -0x28] MOVSXD RCX,dword ptr [RBP + -0x34] MOV AL,byte ptr [RAX + RCX*0x1] AND AL,0x1 MOVZX EAX,AL CMP EAX,0x0 JZ 0x00118586 MOV EAX,dword ptr [RBP + -0x34] MOV ECX,0x8 CDQ IDIV ECX MOV ECX,EDX MOV ESI,0x1 SHL ESI,CL MOV RAX,qword ptr [RBP + -0x30] MOV qword ptr [RBP + -0x50],RAX MOV EAX,dword ptr [RBP + -0x34] MOV ECX,0x8 CDQ IDIV ECX MOV ECX,EAX MOV RAX,qword ptr [RBP + -0x50] MOVSXD RCX,ECX MOVZX EDX,byte ptr [RAX + RCX*0x1 + 0x84] OR EDX,ESI MOV byte ptr [RAX + RCX*0x1 + 0x84],DL LAB_00118586: JMP 0x00118588 LAB_00118588: MOV EAX,dword ptr [RBP + -0x34] ADD EAX,0x1 MOV dword ptr [RBP + -0x34],EAX JMP 0x001184f2 LAB_00118596: MOV RDI,qword ptr [RBP + -0x40] MOV RSI,qword ptr [RBP + -0x18] MOV DL,byte ptr [RBP + -0x19] MOV CX,word ptr [RBP + -0x1c] MOV AX,word ptr [RBP + -0x1e] MOV R9,qword ptr [RBP + -0x30] ADD R9,0x84 MOVZX EDX,DL MOVZX ECX,CX MOVZX R8D,AX CALL 0x00116540 MOV dword ptr [RBP + -0x4],EAX JMP 0x00118612 LAB_001185c8: MOV RDI,qword ptr [RBP + -0x40] CALL 0x00118620 CMP RAX,qword ptr [RBP + -0x18] JNZ 0x00118609 MOV RDI,qword ptr [RBP + -0x40] MOV RSI,qword ptr [RBP + -0x18] MOV DL,byte ptr [RBP + -0x19] MOV CX,word ptr [RBP + -0x1c] MOV AX,word ptr [RBP + -0x1e] MOV R9,qword ptr [RBP + -0x30] ADD R9,0x84 MOVZX EDX,DL MOVZX ECX,CX MOVZX R8D,AX CALL 0x00116540 MOV dword ptr [RBP + -0x4],EAX JMP 0x00118612 LAB_00118609: JMP 0x0011860b LAB_0011860b: MOV dword ptr [RBP + -0x4],0x80000000 LAB_00118612: MOV EAX,dword ptr [RBP + -0x4] ADD RSP,0x50 POP RBP RET
/* ModbusClientPort::writeMultipleCoilsAsBoolArray(ModbusObject*, unsigned char, unsigned short, unsigned short, bool const*) */ int4 __thiscall ModbusClientPort::writeMultipleCoilsAsBoolArray (ModbusClientPort *this,ModbusObject *param_1,uchar param_2,ushort param_3,ushort param_4, bool *param_5) { long lVar1; long lVar2; ModbusObject *pMVar3; uint local_3c; int4 local_c; lVar1 = d_ModbusClientPort(*(ModbusObjectPrivate **)(this + 8)); lVar2 = currentClient(this); if (lVar2 == 0) { for (local_3c = 0; (int)local_3c < (int)(uint)param_4; local_3c = local_3c + 1) { if ((local_3c & 7) == 0) { *(int1 *)(lVar1 + 0x84 + (long)((int)local_3c / 8)) = 0; } if ((param_5[(int)local_3c] & 1U) != 0) { *(byte *)(lVar1 + 0x84 + (long)((int)local_3c / 8)) = *(byte *)(lVar1 + 0x84 + (long)((int)local_3c / 8)) | (byte)(1 << ((byte)((long)(int)local_3c % 8) & 0x1f)); } } local_c = writeMultipleCoils(this,param_1,param_2,param_3,param_4,(void *)(lVar1 + 0x84)); } else { pMVar3 = (ModbusObject *)currentClient(this); if (pMVar3 == param_1) { local_c = writeMultipleCoils(this,param_1,param_2,param_3,param_4,(void *)(lVar1 + 0x84)); } else { local_c = 0x80000000; } } return local_c; }
2,974
ma_rec_pos
eloqsql/storage/maria/ma_search.c
MARIA_RECORD_POS _ma_rec_pos(MARIA_SHARE *share, uchar *ptr) { my_off_t pos; switch (share->rec_reflength) { #if SIZEOF_OFF_T > 4 case 8: pos= (my_off_t) mi_uint8korr(ptr); if (pos == HA_OFFSET_ERROR) return HA_OFFSET_ERROR; /* end of list */ break; case 7: pos= (my_off_t) mi_uint7korr(ptr); if (pos == (((my_off_t) 1) << 56) -1) return HA_OFFSET_ERROR; /* end of list */ break; case 6: pos= (my_off_t) mi_uint6korr(ptr); if (pos == (((my_off_t) 1) << 48) -1) return HA_OFFSET_ERROR; /* end of list */ break; case 5: pos= (my_off_t) mi_uint5korr(ptr); if (pos == (((my_off_t) 1) << 40) -1) return HA_OFFSET_ERROR; /* end of list */ break; #else case 8: case 7: case 6: case 5: ptr+= (share->rec_reflength-4); /* fall through */ #endif case 4: pos= (my_off_t) mi_uint4korr(ptr); if (pos == (my_off_t) (uint32) ~0L) return HA_OFFSET_ERROR; break; case 3: pos= (my_off_t) mi_uint3korr(ptr); if (pos == (my_off_t) (1 << 24) -1) return HA_OFFSET_ERROR; break; case 2: pos= (my_off_t) mi_uint2korr(ptr); if (pos == (my_off_t) (1 << 16) -1) return HA_OFFSET_ERROR; break; default: abort(); /* Impossible */ } return (*share->keypos_to_recpos)(share, pos); }
O0
c
ma_rec_pos: pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq -0x10(%rbp), %rax movl 0x740(%rax), %eax addl $-0x2, %eax movl %eax, %ecx movq %rcx, -0x28(%rbp) subl $0x6, %eax ja 0x97da4 movq -0x28(%rbp), %rax leaq 0xcba5d(%rip), %rcx # 0x163624 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movq -0x18(%rbp), %rax movzbl 0x7(%rax), %eax movq -0x18(%rbp), %rcx movzbl 0x6(%rcx), %ecx shll $0x8, %ecx orl %ecx, %eax movq -0x18(%rbp), %rcx movzbl 0x5(%rcx), %ecx shll $0x10, %ecx orl %ecx, %eax movq -0x18(%rbp), %rcx movzbl 0x4(%rcx), %ecx shll $0x18, %ecx orl %ecx, %eax movl %eax, %eax movq -0x18(%rbp), %rcx movzbl 0x3(%rcx), %ecx movq -0x18(%rbp), %rdx movzbl 0x2(%rdx), %edx shll $0x8, %edx orl %edx, %ecx movq -0x18(%rbp), %rdx movzbl 0x1(%rdx), %edx shll $0x10, %edx orl %edx, %ecx movq -0x18(%rbp), %rdx movzbl (%rdx), %edx shll $0x18, %edx orl %edx, %ecx movl %ecx, %ecx shlq $0x20, %rcx orq %rcx, %rax movq %rax, -0x20(%rbp) cmpq $-0x1, -0x20(%rbp) jne 0x97c50 movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rdi callq 0x975f0 movq %rax, -0x20(%rbp) movabsq $0xffffffffffffff, %rax # imm = 0xFFFFFFFFFFFFFF cmpq %rax, -0x20(%rbp) jne 0x97c7f movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rdi callq 0x97650 movq %rax, -0x20(%rbp) movabsq $0xffffffffffff, %rax # imm = 0xFFFFFFFFFFFF cmpq %rax, -0x20(%rbp) jne 0x97cae movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rdi callq 0x976a0 movq %rax, -0x20(%rbp) movabsq $0xffffffffff, %rax # imm = 0xFFFFFFFFFF cmpq %rax, -0x20(%rbp) jne 0x97cdd movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rax movzbl 0x3(%rax), %eax movq -0x18(%rbp), %rcx movzbl 0x2(%rcx), %ecx shll $0x8, %ecx orl %ecx, %eax movq -0x18(%rbp), %rcx movzbl 0x1(%rcx), %ecx shll $0x10, %ecx orl %ecx, %eax movq -0x18(%rbp), %rcx movzbl (%rcx), %ecx shll $0x18, %ecx orl %ecx, %eax movl %eax, %eax movq %rax, -0x20(%rbp) movl $0xffffffff, %eax # imm = 0xFFFFFFFF cmpq %rax, -0x20(%rbp) jne 0x97d2e movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rax movzbl 0x2(%rax), %eax movq -0x18(%rbp), %rcx movzbl 0x1(%rcx), %ecx shll $0x8, %ecx orl %ecx, %eax movq -0x18(%rbp), %rcx movzbl (%rcx), %ecx shll $0x10, %ecx orl %ecx, %eax movl %eax, %eax movq %rax, -0x20(%rbp) cmpq $0xffffff, -0x20(%rbp) # imm = 0xFFFFFF jne 0x97d6b movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 movq -0x18(%rbp), %rax movzbl 0x1(%rax), %eax movzwl %ax, %eax movq -0x18(%rbp), %rcx movzbl (%rcx), %ecx movzwl %cx, %ecx shll $0x8, %ecx orl %ecx, %eax movzwl %ax, %eax movq %rax, -0x20(%rbp) cmpq $0xffff, -0x20(%rbp) # imm = 0xFFFF jne 0x97da2 movq $-0x1, -0x8(%rbp) jmp 0x97dc2 jmp 0x97da9 callq 0x2a640 movq -0x10(%rbp), %rax movq 0x6c8(%rax), %rax movq -0x10(%rbp), %rdi movq -0x20(%rbp), %rsi callq *%rax movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rax addq $0x30, %rsp popq %rbp retq nopl (%rax)
_ma_rec_pos: push rbp mov rbp, rsp sub rsp, 30h mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov rax, [rbp+var_10] mov eax, [rax+740h] add eax, 0FFFFFFFEh; switch 7 cases mov ecx, eax mov [rbp+var_28], rcx sub eax, 6 ja def_97BCE; jumptable 0000000000097BCE default case mov rax, [rbp+var_28] lea rcx, jpt_97BCE movsxd rax, ds:(jpt_97BCE - 163624h)[rcx+rax*4] add rax, rcx jmp rax; switch jump loc_97BD0: mov rax, [rbp+var_18]; jumptable 0000000000097BCE case 8 movzx eax, byte ptr [rax+7] mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+6] shl ecx, 8 or eax, ecx mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+5] shl ecx, 10h or eax, ecx mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+4] shl ecx, 18h or eax, ecx mov eax, eax mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+3] mov rdx, [rbp+var_18] movzx edx, byte ptr [rdx+2] shl edx, 8 or ecx, edx mov rdx, [rbp+var_18] movzx edx, byte ptr [rdx+1] shl edx, 10h or ecx, edx mov rdx, [rbp+var_18] movzx edx, byte ptr [rdx] shl edx, 18h or ecx, edx mov ecx, ecx shl rcx, 20h or rax, rcx mov [rbp+var_20], rax cmp [rbp+var_20], 0FFFFFFFFFFFFFFFFh jnz short loc_97C50 mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp loc_97DC2 loc_97C50: jmp loc_97DA9 loc_97C55: mov rdi, [rbp+var_18]; jumptable 0000000000097BCE case 7 call mi_uint7korr mov [rbp+var_20], rax mov rax, 0FFFFFFFFFFFFFFh cmp [rbp+var_20], rax jnz short loc_97C7F mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp loc_97DC2 loc_97C7F: jmp loc_97DA9 loc_97C84: mov rdi, [rbp+var_18]; jumptable 0000000000097BCE case 6 call mi_uint6korr mov [rbp+var_20], rax mov rax, 0FFFFFFFFFFFFh cmp [rbp+var_20], rax jnz short loc_97CAE mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp loc_97DC2 loc_97CAE: jmp loc_97DA9 loc_97CB3: mov rdi, [rbp+var_18]; jumptable 0000000000097BCE case 5 call mi_uint5korr mov [rbp+var_20], rax mov rax, 0FFFFFFFFFFh cmp [rbp+var_20], rax jnz short loc_97CDD mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp loc_97DC2 loc_97CDD: jmp loc_97DA9 loc_97CE2: mov rax, [rbp+var_18]; jumptable 0000000000097BCE case 4 movzx eax, byte ptr [rax+3] mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+2] shl ecx, 8 or eax, ecx mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+1] shl ecx, 10h or eax, ecx mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx] shl ecx, 18h or eax, ecx mov eax, eax mov [rbp+var_20], rax mov eax, 0FFFFFFFFh cmp [rbp+var_20], rax jnz short loc_97D2E mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp loc_97DC2 loc_97D2E: jmp short loc_97DA9 loc_97D30: mov rax, [rbp+var_18]; jumptable 0000000000097BCE case 3 movzx eax, byte ptr [rax+2] mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx+1] shl ecx, 8 or eax, ecx mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx] shl ecx, 10h or eax, ecx mov eax, eax mov [rbp+var_20], rax cmp [rbp+var_20], 0FFFFFFh jnz short loc_97D6B mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp short loc_97DC2 loc_97D6B: jmp short loc_97DA9 loc_97D6D: mov rax, [rbp+var_18]; jumptable 0000000000097BCE case 2 movzx eax, byte ptr [rax+1] movzx eax, ax mov rcx, [rbp+var_18] movzx ecx, byte ptr [rcx] movzx ecx, cx shl ecx, 8 or eax, ecx movzx eax, ax mov [rbp+var_20], rax cmp [rbp+var_20], 0FFFFh jnz short loc_97DA2 mov [rbp+var_8], 0FFFFFFFFFFFFFFFFh jmp short loc_97DC2 loc_97DA2: jmp short loc_97DA9 def_97BCE: call _abort; jumptable 0000000000097BCE default case loc_97DA9: mov rax, [rbp+var_10] mov rax, [rax+6C8h] mov rdi, [rbp+var_10] mov rsi, [rbp+var_20] call rax mov [rbp+var_8], rax loc_97DC2: mov rax, [rbp+var_8] add rsp, 30h pop rbp retn
long long ma_rec_pos(long long a1, unsigned int *a2, long long a3) { unsigned long long v4; // [rsp+10h] [rbp-20h] long long v5; // [rsp+28h] [rbp-8h] switch ( *(_DWORD *)(a1 + 1856) ) { case 2: v4 = _byteswap_ushort(*(_WORD *)a2); if ( v4 != 0xFFFF ) goto LABEL_24; v5 = -1LL; break; case 3: v4 = (*(unsigned __int8 *)a2 << 16) | (*((unsigned __int8 *)a2 + 1) << 8) | (unsigned int)*((unsigned __int8 *)a2 + 2); if ( v4 != 0xFFFFFF ) goto LABEL_24; v5 = -1LL; break; case 4: v4 = _byteswap_ulong(*a2); if ( v4 != 0xFFFFFFFF ) goto LABEL_24; v5 = -1LL; break; case 5: v4 = mi_uint5korr(a2); if ( v4 != 0xFFFFFFFFFFLL ) goto LABEL_24; v5 = -1LL; break; case 6: v4 = mi_uint6korr(a2); if ( v4 != 0xFFFFFFFFFFFFLL ) goto LABEL_24; v5 = -1LL; break; case 7: v4 = mi_uint7korr(a2); if ( v4 != 0xFFFFFFFFFFFFFFLL ) goto LABEL_24; v5 = -1LL; break; case 8: v4 = ((unsigned long long)_byteswap_ulong(*a2) << 32) | _byteswap_ulong(a2[1]); if ( v4 == -1LL ) v5 = -1LL; else LABEL_24: v5 = (*(long long ( **)(long long, unsigned long long))(a1 + 1736))(a1, v4); break; default: abort(a1, a2, a3); } return v5; }
_ma_rec_pos: PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV RAX,qword ptr [RBP + -0x10] MOV EAX,dword ptr [RAX + 0x740] ADD EAX,-0x2 MOV ECX,EAX MOV qword ptr [RBP + -0x28],RCX SUB EAX,0x6 JA 0x00197da4 MOV RAX,qword ptr [RBP + -0x28] LEA RCX,[0x263624] MOVSXD RAX,dword ptr [RCX + RAX*0x4] ADD RAX,RCX switchD: JMP RAX caseD_8: MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + 0x7] MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x6] SHL ECX,0x8 OR EAX,ECX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x5] SHL ECX,0x10 OR EAX,ECX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x4] SHL ECX,0x18 OR EAX,ECX MOV EAX,EAX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x3] MOV RDX,qword ptr [RBP + -0x18] MOVZX EDX,byte ptr [RDX + 0x2] SHL EDX,0x8 OR ECX,EDX MOV RDX,qword ptr [RBP + -0x18] MOVZX EDX,byte ptr [RDX + 0x1] SHL EDX,0x10 OR ECX,EDX MOV RDX,qword ptr [RBP + -0x18] MOVZX EDX,byte ptr [RDX] SHL EDX,0x18 OR ECX,EDX MOV ECX,ECX SHL RCX,0x20 OR RAX,RCX MOV qword ptr [RBP + -0x20],RAX CMP qword ptr [RBP + -0x20],-0x1 JNZ 0x00197c50 MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197c50: JMP 0x00197da9 caseD_7: MOV RDI,qword ptr [RBP + -0x18] CALL 0x001975f0 MOV qword ptr [RBP + -0x20],RAX MOV RAX,0xffffffffffffff CMP qword ptr [RBP + -0x20],RAX JNZ 0x00197c7f MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197c7f: JMP 0x00197da9 caseD_6: MOV RDI,qword ptr [RBP + -0x18] CALL 0x00197650 MOV qword ptr [RBP + -0x20],RAX MOV RAX,0xffffffffffff CMP qword ptr [RBP + -0x20],RAX JNZ 0x00197cae MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197cae: JMP 0x00197da9 caseD_5: MOV RDI,qword ptr [RBP + -0x18] CALL 0x001976a0 MOV qword ptr [RBP + -0x20],RAX MOV RAX,0xffffffffff CMP qword ptr [RBP + -0x20],RAX JNZ 0x00197cdd MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197cdd: JMP 0x00197da9 caseD_4: MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + 0x3] MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x2] SHL ECX,0x8 OR EAX,ECX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x1] SHL ECX,0x10 OR EAX,ECX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX] SHL ECX,0x18 OR EAX,ECX MOV EAX,EAX MOV qword ptr [RBP + -0x20],RAX MOV EAX,0xffffffff CMP qword ptr [RBP + -0x20],RAX JNZ 0x00197d2e MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197d2e: JMP 0x00197da9 caseD_3: MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + 0x2] MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX + 0x1] SHL ECX,0x8 OR EAX,ECX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX] SHL ECX,0x10 OR EAX,ECX MOV EAX,EAX MOV qword ptr [RBP + -0x20],RAX CMP qword ptr [RBP + -0x20],0xffffff JNZ 0x00197d6b MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197d6b: JMP 0x00197da9 caseD_2: MOV RAX,qword ptr [RBP + -0x18] MOVZX EAX,byte ptr [RAX + 0x1] MOVZX EAX,AX MOV RCX,qword ptr [RBP + -0x18] MOVZX ECX,byte ptr [RCX] MOVZX ECX,CX SHL ECX,0x8 OR EAX,ECX MOVZX EAX,AX MOV qword ptr [RBP + -0x20],RAX CMP qword ptr [RBP + -0x20],0xffff JNZ 0x00197da2 MOV qword ptr [RBP + -0x8],-0x1 JMP 0x00197dc2 LAB_00197da2: JMP 0x00197da9 default: CALL 0x0012a640 LAB_00197da9: MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX + 0x6c8] MOV RDI,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RBP + -0x20] CALL RAX MOV qword ptr [RBP + -0x8],RAX LAB_00197dc2: MOV RAX,qword ptr [RBP + -0x8] ADD RSP,0x30 POP RBP RET
int8 _ma_rec_pos(long param_1,int1 *param_2) { int8 uVar1; ulong local_28; switch(*(int4 *)(param_1 + 0x740)) { case 2: local_28 = (ulong)CONCAT11(*param_2,param_2[1]); if (local_28 == 0xffff) { return 0xffffffffffffffff; } break; case 3: local_28 = (ulong)CONCAT12(*param_2,CONCAT11(param_2[1],param_2[2])); if (local_28 == 0xffffff) { return 0xffffffffffffffff; } break; case 4: local_28 = (ulong)CONCAT13(*param_2,CONCAT12(param_2[1],CONCAT11(param_2[2],param_2[3]))); if (local_28 == 0xffffffff) { return 0xffffffffffffffff; } break; case 5: local_28 = mi_uint5korr(param_2); if (local_28 == 0xffffffffff) { return 0xffffffffffffffff; } break; case 6: local_28 = mi_uint6korr(param_2); if (local_28 == 0xffffffffffff) { return 0xffffffffffffffff; } break; case 7: local_28 = mi_uint7korr(param_2); if (local_28 == 0xffffffffffffff) { return 0xffffffffffffffff; } break; case 8: local_28 = CONCAT44(CONCAT13(*param_2,CONCAT12(param_2[1],CONCAT11(param_2[2],param_2[3]))), CONCAT13(param_2[4],CONCAT12(param_2[5],CONCAT11(param_2[6],param_2[7])))); if (local_28 == 0xffffffffffffffff) { return 0xffffffffffffffff; } break; default: /* WARNING: Subroutine does not return */ abort(); } uVar1 = (**(code **)(param_1 + 0x6c8))(param_1,local_28); return uVar1; }
2,975
mysql_list_tables_start_internal
eloqsql/libmariadb/libmariadb/mariadb_async.c
static void mysql_list_tables_start_internal(void *d) { MK_ASYNC_INTERNAL_BODY( mysql_list_tables, (parms->mysql, parms->wild), parms->mysql, MYSQL_RES *, r_ptr) }
O0
c
mysql_list_tables_start_internal: pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x10(%rbp) movq -0x10(%rbp), %rax movq (%rax), %rax movq 0x480(%rax), %rax movq 0x28(%rax), %rax movq %rax, -0x20(%rbp) movq -0x10(%rbp), %rax movq (%rax), %rdi movq -0x10(%rbp), %rax movq 0x8(%rax), %rsi callq 0x3a870 movq %rax, -0x18(%rbp) movq -0x18(%rbp), %rcx movq -0x20(%rbp), %rax movq %rcx, 0x8(%rax) movq -0x20(%rbp), %rax movl $0x0, (%rax) addq $0x20, %rsp popq %rbp retq nop
mysql_list_tables_start_internal: push rbp mov rbp, rsp sub rsp, 20h mov [rbp+var_8], rdi mov rax, [rbp+var_8] mov [rbp+var_10], rax mov rax, [rbp+var_10] mov rax, [rax] mov rax, [rax+480h] mov rax, [rax+28h] mov [rbp+var_20], rax mov rax, [rbp+var_10] mov rdi, [rax] mov rax, [rbp+var_10] mov rsi, [rax+8] call mysql_list_tables mov [rbp+var_18], rax mov rcx, [rbp+var_18] mov rax, [rbp+var_20] mov [rax+8], rcx mov rax, [rbp+var_20] mov dword ptr [rax], 0 add rsp, 20h pop rbp retn
long long mysql_list_tables_start_internal(long long a1) { long long result; // rax long long v2; // [rsp+0h] [rbp-20h] v2 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)a1 + 1152LL) + 40LL); *(_QWORD *)(v2 + 8) = mysql_list_tables(*(_QWORD *)a1, *(const char **)(a1 + 8)); result = v2; *(_DWORD *)v2 = 0; return result; }
mysql_list_tables_start_internal: PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + -0x8],RDI MOV RAX,qword ptr [RBP + -0x8] MOV qword ptr [RBP + -0x10],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RAX] MOV RAX,qword ptr [RAX + 0x480] MOV RAX,qword ptr [RAX + 0x28] MOV qword ptr [RBP + -0x20],RAX MOV RAX,qword ptr [RBP + -0x10] MOV RDI,qword ptr [RAX] MOV RAX,qword ptr [RBP + -0x10] MOV RSI,qword ptr [RAX + 0x8] CALL 0x0013a870 MOV qword ptr [RBP + -0x18],RAX MOV RCX,qword ptr [RBP + -0x18] MOV RAX,qword ptr [RBP + -0x20] MOV qword ptr [RAX + 0x8],RCX MOV RAX,qword ptr [RBP + -0x20] MOV dword ptr [RAX],0x0 ADD RSP,0x20 POP RBP RET
void mysql_list_tables_start_internal(long *param_1) { int4 *puVar1; int8 uVar2; puVar1 = *(int4 **)(*(long *)(*param_1 + 0x480) + 0x28); uVar2 = mysql_list_tables(*param_1,param_1[1]); *(int8 *)(puVar1 + 2) = uVar2; *puVar1 = 0; return; }
2,976
ImPlot3D::GetMouseOverAxis(ImPlot3DPlot const&, bool const*, ImVec2 const*, int, int*)
zkingston[P]unknot/build_O1/_deps/implot3d-src/implot3d.cpp
int GetMouseOverAxis(const ImPlot3DPlot& plot, const bool* active_faces, const ImVec2* corners_pix, const int plane_2d, int* edge_out = nullptr) { const float axis_proximity_threshold = 15.0f; // Distance in pixels to consider the mouse "close" to an axis ImGuiIO& io = ImGui::GetIO(); ImVec2 mouse_pos = io.MousePos; if (edge_out) *edge_out = -1; bool visible_edges[12]; for (int i = 0; i < 12; i++) visible_edges[i] = false; for (int a = 0; a < 3; a++) { int face_idx = a + 3 * active_faces[a]; if (plane_2d != -1 && a != plane_2d) continue; for (size_t i = 0; i < 4; i++) visible_edges[face_edges[face_idx][i]] = true; } // Check each edge for proximity to the mouse for (int edge = 0; edge < 12; edge++) { if (!visible_edges[edge]) continue; ImVec2 p0 = corners_pix[edges[edge][0]]; ImVec2 p1 = corners_pix[edges[edge][1]]; // Check distance to the edge ImVec2 closest_point = ImLineClosestPoint(p0, p1, mouse_pos); float dist = ImLengthSqr(mouse_pos - closest_point); if (dist <= axis_proximity_threshold) { if (edge_out) *edge_out = edge; // Determine which axis the edge belongs to if (edge == 0 || edge == 2 || edge == 4 || edge == 6) return 0; // X-axis else if (edge == 1 || edge == 3 || edge == 5 || edge == 7) return 1; // Y-axis else return 2; // Z-axis } } return -1; // Not over any axis }
O1
cpp
ImPlot3D::GetMouseOverAxis(ImPlot3DPlot const&, bool const*, ImVec2 const*, int, int*): pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %r8, %rbx movl %ecx, %ebp movq %rdx, %r14 movq %rsi, %r15 callq 0x21ac26 movq 0xe0(%rax), %rax movq %rax, (%rsp) testq %rbx, %rbx je 0x4c4e2 movl $0xffffffff, (%rbx) # imm = 0xFFFFFFFF movl $0x0, 0x10(%rsp) movq $0x0, 0x8(%rsp) movl %ebp, %eax leaq 0x248304(%rip), %rcx # 0x294800 xorl %edx, %edx cmpl $-0x1, %ebp setne %sil cmpq %rax, %rdx setne %dil testb %dil, %sil jne 0x4c535 movzbl (%r15,%rdx), %esi leaq (%rsi,%rsi,2), %rsi shll $0x4, %esi addq %rcx, %rsi xorl %edi, %edi movslq (%rsi,%rdi,4), %r8 movb $0x1, 0x8(%rsp,%r8) incq %rdi cmpq $0x4, %rdi jne 0x4c522 incq %rdx addq $0x10, %rcx cmpq $0x3, %rdx jne 0x4c4fe xorl %r15d, %r15d leaq 0x248314(%rip), %r12 # 0x294860 movq %rsp, %r13 cmpb $0x1, 0x8(%rsp,%r15) jne 0x4c5de movslq (%r12,%r15,8), %rax movq (%r14,%rax,8), %rax movq %rax, 0x20(%rsp) movslq 0x4(%r12,%r15,8), %rax movq (%r14,%rax,8), %rax movq %rax, 0x18(%rsp) leaq 0x20(%rsp), %rdi leaq 0x18(%rsp), %rsi movq %r13, %rdx callq 0x21289c movss (%rsp), %xmm1 movss 0x4(%rsp), %xmm2 subss %xmm0, %xmm1 shufps $0x55, %xmm0, %xmm0 # xmm0 = xmm0[1,1,1,1] subss %xmm0, %xmm2 movss 0x247dc9(%rip), %xmm0 # 0x294370 mulss %xmm2, %xmm2 mulss %xmm1, %xmm1 addss %xmm2, %xmm1 ucomiss %xmm1, %xmm0 jb 0x4c5d9 testq %rbx, %rbx je 0x4c5c0 movl %r15d, (%rbx) xorl %ebp, %ebp testb $0x9, %r15b je 0x4c5d9 movl %r15d, %eax andl $0x9, %eax xorl %ebp, %ebp cmpl $0x1, %eax setne %bpl incl %ebp ucomiss %xmm1, %xmm0 jae 0x4c5f0 incq %r15 cmpq $0xc, %r15 jne 0x4c54f movl $0xffffffff, %ebp # imm = 0xFFFFFFFF movl %ebp, %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
_ZN8ImPlot3D16GetMouseOverAxisERK12ImPlot3DPlotPKbPK6ImVec2iPi: push rbp push r15 push r14 push r13 push r12 push rbx sub rsp, 28h mov rbx, r8 mov ebp, ecx mov r14, rdx mov r15, rsi call _ZN5ImGui5GetIOEv; ImGui::GetIO(void) mov rax, [rax+0E0h] mov [rsp+58h+var_58], rax test rbx, rbx jz short loc_4C4E2 mov dword ptr [rbx], 0FFFFFFFFh loc_4C4E2: mov [rsp+58h+var_48], 0 mov [rsp+58h+var_50], 0 mov eax, ebp lea rcx, _ZN8ImPlot3DL10face_edgesE; ImPlot3D::face_edges xor edx, edx loc_4C4FE: cmp ebp, 0FFFFFFFFh setnz sil cmp rdx, rax setnz dil test sil, dil jnz short loc_4C535 movzx esi, byte ptr [r15+rdx] lea rsi, [rsi+rsi*2] shl esi, 4 add rsi, rcx xor edi, edi loc_4C522: movsxd r8, dword ptr [rsi+rdi*4] mov byte ptr [rsp+r8+58h+var_50], 1 inc rdi cmp rdi, 4 jnz short loc_4C522 loc_4C535: inc rdx add rcx, 10h cmp rdx, 3 jnz short loc_4C4FE xor r15d, r15d lea r12, _ZN8ImPlot3DL5edgesE; ImPlot3D::edges mov r13, rsp loc_4C54F: cmp byte ptr [rsp+r15+58h+var_50], 1 jnz loc_4C5DE movsxd rax, dword ptr [r12+r15*8] mov rax, [r14+rax*8] mov [rsp+58h+var_38], rax movsxd rax, dword ptr [r12+r15*8+4] mov rax, [r14+rax*8] mov [rsp+58h+var_40], rax lea rdi, [rsp+58h+var_38] lea rsi, [rsp+58h+var_40] mov rdx, r13 call _Z18ImLineClosestPointRK6ImVec2S1_S1_; ImLineClosestPoint(ImVec2 const&,ImVec2 const&,ImVec2 const&) movss xmm1, dword ptr [rsp+58h+var_58] movss xmm2, dword ptr [rsp+58h+var_58+4] subss xmm1, xmm0 shufps xmm0, xmm0, 55h ; 'U' subss xmm2, xmm0 movss xmm0, cs:dword_294370 mulss xmm2, xmm2 mulss xmm1, xmm1 addss xmm1, xmm2 ucomiss xmm0, xmm1 jb short loc_4C5D9 test rbx, rbx jz short loc_4C5C0 mov [rbx], r15d loc_4C5C0: xor ebp, ebp test r15b, 9 jz short loc_4C5D9 mov eax, r15d and eax, 9 xor ebp, ebp cmp eax, 1 setnz bpl inc ebp loc_4C5D9: ucomiss xmm0, xmm1 jnb short loc_4C5F0 loc_4C5DE: inc r15 cmp r15, 0Ch jnz loc_4C54F mov ebp, 0FFFFFFFFh loc_4C5F0: mov eax, ebp add rsp, 28h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long ImPlot3D::GetMouseOverAxis( ImGui *a1, long long a2, long long a3, unsigned int a4, _DWORD *a5, __m128 a6) { char *v10; // rcx long long i; // rdx char *v12; // rsi long long j; // rdi long long v14; // r15 float v15; // xmm1_4 float v16; // xmm2_4 float v17; // xmm1_4 long long v19; // [rsp+0h] [rbp-58h] BYREF long long v20; // [rsp+8h] [rbp-50h] int v21; // [rsp+10h] [rbp-48h] long long v22; // [rsp+18h] [rbp-40h] BYREF long long v23[7]; // [rsp+20h] [rbp-38h] BYREF v19 = *(_QWORD *)(ImGui::GetIO(a1) + 224); if ( a5 ) *a5 = -1; v21 = 0; v20 = 0LL; v10 = (char *)&ImPlot3D::face_edges; for ( i = 0LL; i != 3; ++i ) { if ( i == a4 || a4 == -1 ) { v12 = &v10[48 * *(unsigned __int8 *)(a2 + i)]; for ( j = 0LL; j != 4; ++j ) *((_BYTE *)&v20 + *(int *)&v12[4 * j]) = 1; } v10 += 16; } v14 = 0LL; while ( 1 ) { if ( *((_BYTE *)&v20 + v14) == 1 ) { v23[0] = *(_QWORD *)(a3 + 8LL * ImPlot3D::edges[2 * v14]); v22 = *(_QWORD *)(a3 + 8LL * ImPlot3D::edges[2 * v14 + 1]); *(double *)a6.m128_u64 = ImLineClosestPoint(v23, &v22, &v19, v10); v15 = *(float *)&v19 - a6.m128_f32[0]; v16 = *((float *)&v19 + 1) - _mm_shuffle_ps(a6, a6, 85).m128_f32[0]; a6 = (__m128)0x41700000u; v17 = (float)(v15 * v15) + (float)(v16 * v16); if ( v17 <= 15.0 ) { if ( a5 ) *a5 = v14; a4 = 0; if ( (v14 & 9) != 0 ) a4 = ((v14 & 9) != 1) + 1; } if ( v17 <= 15.0 ) break; } if ( ++v14 == 12 ) return (unsigned int)-1; } return a4; }
GetMouseOverAxis: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x28 MOV RBX,R8 MOV EBP,ECX MOV R14,RDX MOV R15,RSI CALL 0x0031ac26 MOV RAX,qword ptr [RAX + 0xe0] MOV qword ptr [RSP],RAX TEST RBX,RBX JZ 0x0014c4e2 MOV dword ptr [RBX],0xffffffff LAB_0014c4e2: MOV dword ptr [RSP + 0x10],0x0 MOV qword ptr [RSP + 0x8],0x0 MOV EAX,EBP LEA RCX,[0x394800] XOR EDX,EDX LAB_0014c4fe: CMP EBP,-0x1 SETNZ SIL CMP RDX,RAX SETNZ DIL TEST SIL,DIL JNZ 0x0014c535 MOVZX ESI,byte ptr [R15 + RDX*0x1] LEA RSI,[RSI + RSI*0x2] SHL ESI,0x4 ADD RSI,RCX XOR EDI,EDI LAB_0014c522: MOVSXD R8,dword ptr [RSI + RDI*0x4] MOV byte ptr [RSP + R8*0x1 + 0x8],0x1 INC RDI CMP RDI,0x4 JNZ 0x0014c522 LAB_0014c535: INC RDX ADD RCX,0x10 CMP RDX,0x3 JNZ 0x0014c4fe XOR R15D,R15D LEA R12,[0x394860] MOV R13,RSP LAB_0014c54f: CMP byte ptr [RSP + R15*0x1 + 0x8],0x1 JNZ 0x0014c5de MOVSXD RAX,dword ptr [R12 + R15*0x8] MOV RAX,qword ptr [R14 + RAX*0x8] MOV qword ptr [RSP + 0x20],RAX MOVSXD RAX,dword ptr [R12 + R15*0x8 + 0x4] MOV RAX,qword ptr [R14 + RAX*0x8] MOV qword ptr [RSP + 0x18],RAX LEA RDI,[RSP + 0x20] LEA RSI,[RSP + 0x18] MOV RDX,R13 CALL 0x0031289c MOVSS XMM1,dword ptr [RSP] MOVSS XMM2,dword ptr [RSP + 0x4] SUBSS XMM1,XMM0 SHUFPS XMM0,XMM0,0x55 SUBSS XMM2,XMM0 MOVSS XMM0,dword ptr [0x00394370] MULSS XMM2,XMM2 MULSS XMM1,XMM1 ADDSS XMM1,XMM2 UCOMISS XMM0,XMM1 JC 0x0014c5d9 TEST RBX,RBX JZ 0x0014c5c0 MOV dword ptr [RBX],R15D LAB_0014c5c0: XOR EBP,EBP TEST R15B,0x9 JZ 0x0014c5d9 MOV EAX,R15D AND EAX,0x9 XOR EBP,EBP CMP EAX,0x1 SETNZ BPL INC EBP LAB_0014c5d9: UCOMISS XMM0,XMM1 JNC 0x0014c5f0 LAB_0014c5de: INC R15 CMP R15,0xc JNZ 0x0014c54f MOV EBP,0xffffffff LAB_0014c5f0: MOV EAX,EBP ADD RSP,0x28 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
/* ImPlot3D::GetMouseOverAxis(ImPlot3DPlot const&, bool const*, ImVec2 const*, int, int*) */ int ImPlot3D::GetMouseOverAxis (ImPlot3DPlot *param_1,bool *param_2,ImVec2 *param_3,int param_4,int *param_5) { bool bVar1; float fVar2; long lVar3; int1 *puVar4; ulong uVar5; int8 uVar6; float fVar7; float fVar8; int8 local_58; char local_50 [16]; int8 local_40; int8 local_38; lVar3 = ImGui::GetIO(); local_58 = *(int8 *)(lVar3 + 0xe0); if (param_5 != (int *)0x0) { *param_5 = -1; } local_50[8] = '\0'; local_50[9] = '\0'; local_50[10] = '\0'; local_50[0xb] = '\0'; local_50[0] = '\0'; local_50[1] = '\0'; local_50[2] = '\0'; local_50[3] = '\0'; local_50[4] = '\0'; local_50[5] = '\0'; local_50[6] = '\0'; local_50[7] = '\0'; puVar4 = face_edges; uVar5 = 0; do { if (param_4 == -1 || uVar5 == (uint)param_4) { bVar1 = param_2[uVar5]; lVar3 = 0; do { local_50[*(int *)(puVar4 + lVar3 * 4 + (ulong)((uint)bVar1 * 0x30))] = '\x01'; lVar3 = lVar3 + 1; } while (lVar3 != 4); } uVar5 = uVar5 + 1; puVar4 = puVar4 + 0x10; } while (uVar5 != 3); uVar5 = 0; do { if (local_50[uVar5] == '\x01') { local_38 = *(int8 *)(param_3 + (long)(int)(&edges)[uVar5 * 2] * 8); local_40 = *(int8 *)(param_3 + (long)(int)(&DAT_00394864)[uVar5 * 2] * 8); uVar6 = ImLineClosestPoint((ImVec2 *)&local_38,(ImVec2 *)&local_40,(ImVec2 *)&local_58); fVar2 = DAT_00394370; fVar7 = (float)local_58 - (float)uVar6; fVar8 = local_58._4_4_ - (float)((ulong)uVar6 >> 0x20); fVar7 = fVar7 * fVar7 + fVar8 * fVar8; if (fVar7 <= DAT_00394370) { if (param_5 != (int *)0x0) { *param_5 = (uint)uVar5; } param_4 = 0; if ((uVar5 & 9) != 0) { param_4 = (((uint)uVar5 & 9) != 1) + 1; } } if (fVar7 <= fVar2) { return param_4; } } uVar5 = uVar5 + 1; if (uVar5 == 0xc) { return -1; } } while( true ); }
2,977
MemoryManager::isAddrExist(unsigned int)
DanielDanyang[P]CSC3050-2025-Spring-Project-4/src/MemoryManager.cpp
bool MemoryManager::isAddrExist(uint32_t addr) { uint32_t i = this->getFirstEntryId(addr); uint32_t j = this->getSecondEntryId(addr); if (memory[i] && memory[i][j]) { return true; } return false; }
O0
cpp
MemoryManager::isAddrExist(unsigned int): subq $0x28, %rsp movq %rdi, 0x18(%rsp) movl %esi, 0x14(%rsp) movq 0x18(%rsp), %rdi movq %rdi, (%rsp) movl 0x14(%rsp), %esi callq 0x33d0 movq (%rsp), %rdi movl %eax, 0x10(%rsp) movl 0x14(%rsp), %esi callq 0x33f0 movl %eax, %ecx movq (%rsp), %rax movl %ecx, 0xc(%rsp) movl 0x10(%rsp), %ecx cmpq $0x0, (%rax,%rcx,8) je 0x34a3 movq (%rsp), %rax movl 0x10(%rsp), %ecx movq (%rax,%rcx,8), %rax movl 0xc(%rsp), %ecx cmpq $0x0, (%rax,%rcx,8) je 0x34a3 movb $0x1, 0x27(%rsp) jmp 0x34a8 movb $0x0, 0x27(%rsp) movb 0x27(%rsp), %al andb $0x1, %al addq $0x28, %rsp retq nopw %cs:(%rax,%rax)
_ZN13MemoryManager11isAddrExistEj: sub rsp, 28h mov [rsp+28h+var_10], rdi mov [rsp+28h+var_14], esi mov rdi, [rsp+28h+var_10]; this mov [rsp+28h+var_28], rdi mov esi, [rsp+28h+var_14]; unsigned int call _ZN13MemoryManager15getFirstEntryIdEj; MemoryManager::getFirstEntryId(uint) mov rdi, [rsp+28h+var_28]; this mov [rsp+28h+var_18], eax mov esi, [rsp+28h+var_14]; unsigned int call _ZN13MemoryManager16getSecondEntryIdEj; MemoryManager::getSecondEntryId(uint) mov ecx, eax mov rax, [rsp+28h+var_28] mov [rsp+28h+var_1C], ecx mov ecx, [rsp+28h+var_18] cmp qword ptr [rax+rcx*8], 0 jz short loc_34A3 mov rax, [rsp+28h+var_28] mov ecx, [rsp+28h+var_18] mov rax, [rax+rcx*8] mov ecx, [rsp+28h+var_1C] cmp qword ptr [rax+rcx*8], 0 jz short loc_34A3 mov [rsp+28h+var_1], 1 jmp short loc_34A8 loc_34A3: mov [rsp+28h+var_1], 0 loc_34A8: mov al, [rsp+28h+var_1] and al, 1 add rsp, 28h retn
bool MemoryManager::isAddrExist(MemoryManager *this, unsigned int a2) { unsigned int SecondEntryId; // [rsp+Ch] [rbp-1Ch] unsigned int FirstEntryId; // [rsp+10h] [rbp-18h] FirstEntryId = MemoryManager::getFirstEntryId(this, a2); SecondEntryId = MemoryManager::getSecondEntryId(this, a2); return *((_QWORD *)this + FirstEntryId) && *(_QWORD *)(*((_QWORD *)this + FirstEntryId) + 8LL * SecondEntryId); }
isAddrExist: SUB RSP,0x28 MOV qword ptr [RSP + 0x18],RDI MOV dword ptr [RSP + 0x14],ESI MOV RDI,qword ptr [RSP + 0x18] MOV qword ptr [RSP],RDI MOV ESI,dword ptr [RSP + 0x14] CALL 0x001033d0 MOV RDI,qword ptr [RSP] MOV dword ptr [RSP + 0x10],EAX MOV ESI,dword ptr [RSP + 0x14] CALL 0x001033f0 MOV ECX,EAX MOV RAX,qword ptr [RSP] MOV dword ptr [RSP + 0xc],ECX MOV ECX,dword ptr [RSP + 0x10] CMP qword ptr [RAX + RCX*0x8],0x0 JZ 0x001034a3 MOV RAX,qword ptr [RSP] MOV ECX,dword ptr [RSP + 0x10] MOV RAX,qword ptr [RAX + RCX*0x8] MOV ECX,dword ptr [RSP + 0xc] CMP qword ptr [RAX + RCX*0x8],0x0 JZ 0x001034a3 MOV byte ptr [RSP + 0x27],0x1 JMP 0x001034a8 LAB_001034a3: MOV byte ptr [RSP + 0x27],0x0 LAB_001034a8: MOV AL,byte ptr [RSP + 0x27] AND AL,0x1 ADD RSP,0x28 RET
/* MemoryManager::isAddrExist(unsigned int) */ int1 __thiscall MemoryManager::isAddrExist(MemoryManager *this,uint param_1) { uint uVar1; uint uVar2; int1 local_1; uVar1 = getFirstEntryId(this,param_1); uVar2 = getSecondEntryId(this,param_1); if ((*(long *)(this + (ulong)uVar1 * 8) == 0) || (*(long *)(*(long *)(this + (ulong)uVar1 * 8) + (ulong)uVar2 * 8) == 0)) { local_1 = 0; } else { local_1 = 1; } return local_1; }
2,978
setup_key_functions
eloqsql/storage/myisam/mi_open.c
static void setup_key_functions(register MI_KEYDEF *keyinfo) { if (keyinfo->key_alg == HA_KEY_ALG_RTREE) { #ifdef HAVE_RTREE_KEYS keyinfo->ck_insert = rtree_insert; keyinfo->ck_delete = rtree_delete; #else DBUG_ASSERT(0); /* mi_open should check it never happens */ #endif } else { keyinfo->ck_insert = _mi_ck_write; keyinfo->ck_delete = _mi_ck_delete; } if (keyinfo->flag & HA_BINARY_PACK_KEY) { /* Simple prefix compression */ keyinfo->bin_search=_mi_seq_search; keyinfo->get_key=_mi_get_binary_pack_key; keyinfo->pack_key=_mi_calc_bin_pack_key_length; keyinfo->store_key=_mi_store_bin_pack_key; } else if (keyinfo->flag & HA_VAR_LENGTH_KEY) { keyinfo->get_key= _mi_get_pack_key; if (keyinfo->seg[0].flag & HA_PACK_KEY) { /* Prefix compression */ /* _mi_prefix_search() compares end-space against ASCII blank (' '). It cannot be used for character sets, that do not encode the blank character like ASCII does. UCS2 is an example. All character sets with a fixed width > 1 or a mimimum width > 1 cannot represent blank like ASCII does. In these cases we have to use _mi_seq_search() for the search. */ if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) || (keyinfo->seg->flag & HA_NULL_PART) || (keyinfo->seg->charset->mbminlen > 1)) keyinfo->bin_search=_mi_seq_search; else keyinfo->bin_search=_mi_prefix_search; keyinfo->pack_key=_mi_calc_var_pack_key_length; keyinfo->store_key=_mi_store_var_pack_key; } else { keyinfo->bin_search=_mi_seq_search; keyinfo->pack_key=_mi_calc_var_key_length; /* Variable length key */ keyinfo->store_key=_mi_store_static_key; } } else { keyinfo->bin_search=_mi_bin_search; keyinfo->get_key=_mi_get_static_key; keyinfo->pack_key=_mi_calc_static_key_length; keyinfo->store_key=_mi_store_static_key; } return; }
O3
c
setup_key_functions: pushq %rbp movq %rsp, %rbp cmpb $0x2, 0xc(%rdi) leaq 0x8940(%rip), %rax # 0x87b4f cmoveq 0x303db9(%rip), %rax # 0x382fd0 leaq -0xabdd(%rip), %rcx # 0x74641 cmoveq 0x303d5a(%rip), %rcx # 0x382f80 movq %rax, 0x60(%rdi) movq %rcx, 0x68(%rdi) movzwl 0xa(%rdi), %eax testb $0x20, %al jne 0x7f258 testb $0x8, %al jne 0x7f28b leaq 0x7197(%rip), %rax # 0x863d8 leaq 0x6987(%rip), %rdx # 0x85bcf leaq 0x5be0(%rip), %rcx # 0x84e2f leaq 0x4ec4(%rip), %rsi # 0x8411a jmp 0x7f274 leaq 0x737c(%rip), %rax # 0x865db leaq 0x6fbd(%rip), %rdx # 0x86223 leaq 0x5f05(%rip), %rcx # 0x85172 leaq 0x4fd7(%rip), %rsi # 0x8424b movq %rsi, 0x40(%rdi) movl $0x48, %esi movq %rcx, (%rdi,%rsi) movq %rdx, 0x50(%rdi) movq %rax, 0x58(%rdi) popq %rbp retq leaq 0x5bdd(%rip), %rax # 0x84e6f movq %rax, 0x48(%rdi) movq 0x28(%rdi), %rax movzwl 0x12(%rax), %r8d leaq 0x4fa5(%rip), %rcx # 0x8424b movl $0x40, %esi testb $0x2, %r8b jne 0x7f2c1 leaq 0x7120(%rip), %rax # 0x863d8 leaq 0x6927(%rip), %rdx # 0x85be6 jmp 0x7f27d movq (%rax), %r9 leaq 0x7121(%rip), %rax # 0x863ec leaq 0x6938(%rip), %rdx # 0x85c0a testq %r9, %r9 je 0x7f27d movl 0xc(%r9), %r10d andl $0x40, %r10d andl $0x10, %r8d orl %r10d, %r8d jne 0x7f27d cmpl $0x2, 0x98(%r9) jb 0x7f2fb leaq 0x4f52(%rip), %rcx # 0x8424b jmp 0x7f27d leaq 0x50fb(%rip), %rcx # 0x843fd jmp 0x7f27d
setup_key_functions_0: push rbp mov rbp, rsp cmp byte ptr [rdi+0Ch], 2 lea rax, _mi_ck_write cmovz rax, cs:rtree_insert_ptr lea rcx, _mi_ck_delete cmovz rcx, cs:rtree_delete_ptr mov [rdi+60h], rax mov [rdi+68h], rcx movzx eax, word ptr [rdi+0Ah] test al, 20h jnz short loc_7F258 test al, 8 jnz short loc_7F28B lea rax, _mi_store_static_key lea rdx, _mi_calc_static_key_length lea rcx, _mi_get_static_key lea rsi, _mi_bin_search jmp short loc_7F274 loc_7F258: lea rax, _mi_store_bin_pack_key lea rdx, _mi_calc_bin_pack_key_length lea rcx, _mi_get_binary_pack_key lea rsi, _mi_seq_search loc_7F274: mov [rdi+40h], rsi mov esi, 48h ; 'H' loc_7F27D: mov [rdi+rsi], rcx mov [rdi+50h], rdx mov [rdi+58h], rax pop rbp retn loc_7F28B: lea rax, _mi_get_pack_key mov [rdi+48h], rax mov rax, [rdi+28h] movzx r8d, word ptr [rax+12h] lea rcx, _mi_seq_search mov esi, 40h ; '@' test r8b, 2 jnz short loc_7F2C1 lea rax, _mi_store_static_key lea rdx, _mi_calc_var_key_length jmp short loc_7F27D loc_7F2C1: mov r9, [rax] lea rax, _mi_store_var_pack_key lea rdx, _mi_calc_var_pack_key_length test r9, r9 jz short loc_7F27D mov r10d, [r9+0Ch] and r10d, 40h and r8d, 10h or r8d, r10d jnz short loc_7F27D cmp dword ptr [r9+98h], 2 jb short loc_7F2FB lea rcx, _mi_seq_search jmp short loc_7F27D loc_7F2FB: lea rcx, _mi_prefix_search jmp loc_7F27D
long long ( * setup_key_functions_0(long long a1))() { long long ( *v1)(); // rax long long ( *v2)(long long, unsigned int, long long, long long); // rcx __int16 v3; // ax long long ( *result)(); // rax long long ( *v5)(int, int, int, int, int, int, long long); // rdx long long ( *v6)(); // rcx long long ( *v7)(int, int, int, int, int, int, long long, long long, long long); // rsi long long v8; // rsi long long *v9; // rax __int16 v10; // r8 long long v11; // r9 v1 = (long long ( *)())mi_ck_write; if ( *(_BYTE *)(a1 + 12) == 2 ) v1 = rtree_insert; v2 = mi_ck_delete; if ( *(_BYTE *)(a1 + 12) == 2 ) v2 = (long long ( *)(long long, unsigned int, long long, long long))rtree_delete; *(_QWORD *)(a1 + 96) = v1; *(_QWORD *)(a1 + 104) = v2; v3 = *(_WORD *)(a1 + 10); if ( (v3 & 0x20) != 0 ) { result = mi_store_bin_pack_key; v5 = mi_calc_bin_pack_key_length; v6 = mi_get_binary_pack_key; v7 = mi_seq_search; goto LABEL_9; } if ( (v3 & 8) == 0 ) { result = mi_store_static_key; v5 = mi_calc_static_key_length; v6 = mi_get_static_key; v7 = (long long ( *)(int, int, int, int, int, int, long long, long long, long long))mi_bin_search; LABEL_9: *(_QWORD *)(a1 + 64) = v7; v8 = 72LL; goto LABEL_10; } *(_QWORD *)(a1 + 72) = mi_get_pack_key; v9 = *(long long **)(a1 + 40); v10 = *((_WORD *)v9 + 9); v6 = (long long ( *)())mi_seq_search; v8 = 64LL; if ( (v10 & 2) != 0 ) { v11 = *v9; result = mi_store_var_pack_key; v5 = mi_calc_var_pack_key_length; if ( v11 && !(*(_DWORD *)(v11 + 12) & 0x40 | v10 & 0x10) ) { if ( *(_DWORD *)(v11 + 152) < 2u ) v6 = (long long ( *)())mi_prefix_search; else v6 = (long long ( *)())mi_seq_search; } } else { result = mi_store_static_key; v5 = mi_calc_var_key_length; } LABEL_10: *(_QWORD *)(a1 + v8) = v6; *(_QWORD *)(a1 + 80) = v5; *(_QWORD *)(a1 + 88) = result; return result; }
setup_key_functions: PUSH RBP MOV RBP,RSP CMP byte ptr [RDI + 0xc],0x2 LEA RAX,[0x187b4f] CMOVZ RAX,qword ptr [0x00482fd0] LEA RCX,[0x174641] CMOVZ RCX,qword ptr [0x00482f80] MOV qword ptr [RDI + 0x60],RAX MOV qword ptr [RDI + 0x68],RCX MOVZX EAX,word ptr [RDI + 0xa] TEST AL,0x20 JNZ 0x0017f258 TEST AL,0x8 JNZ 0x0017f28b LEA RAX,[0x1863d8] LEA RDX,[0x185bcf] LEA RCX,[0x184e2f] LEA RSI,[0x18411a] JMP 0x0017f274 LAB_0017f258: LEA RAX,[0x1865db] LEA RDX,[0x186223] LEA RCX,[0x185172] LEA RSI,[0x18424b] LAB_0017f274: MOV qword ptr [RDI + 0x40],RSI MOV ESI,0x48 LAB_0017f27d: MOV qword ptr [RDI + RSI*0x1],RCX MOV qword ptr [RDI + 0x50],RDX MOV qword ptr [RDI + 0x58],RAX POP RBP RET LAB_0017f28b: LEA RAX,[0x184e6f] MOV qword ptr [RDI + 0x48],RAX MOV RAX,qword ptr [RDI + 0x28] MOVZX R8D,word ptr [RAX + 0x12] LEA RCX,[0x18424b] MOV ESI,0x40 TEST R8B,0x2 JNZ 0x0017f2c1 LEA RAX,[0x1863d8] LEA RDX,[0x185be6] JMP 0x0017f27d LAB_0017f2c1: MOV R9,qword ptr [RAX] LEA RAX,[0x1863ec] LEA RDX,[0x185c0a] TEST R9,R9 JZ 0x0017f27d MOV R10D,dword ptr [R9 + 0xc] AND R10D,0x40 AND R8D,0x10 OR R8D,R10D JNZ 0x0017f27d CMP dword ptr [R9 + 0x98],0x2 JC 0x0017f2fb LEA RCX,[0x18424b] JMP 0x0017f27d LAB_0017f2fb: LEA RCX,[0x1843fd] JMP 0x0017f27d
void setup_key_functions(long param_1) { ushort uVar1; long lVar2; code *pcVar3; code *pcVar4; code *pcVar5; code *pcVar6; long lVar7; bool bVar8; bVar8 = *(char *)(param_1 + 0xc) == '\x02'; pcVar3 = _mi_ck_write; if (bVar8) { pcVar3 = (code *)PTR_rtree_insert_00482fd0; } pcVar4 = _mi_ck_delete; if (bVar8) { pcVar4 = (code *)PTR_rtree_delete_00482f80; } *(code **)(param_1 + 0x60) = pcVar3; *(code **)(param_1 + 0x68) = pcVar4; if ((*(ushort *)(param_1 + 10) & 0x20) == 0) { if ((*(ushort *)(param_1 + 10) & 8) != 0) { *(code **)(param_1 + 0x48) = _mi_get_pack_key; uVar1 = *(ushort *)((long)*(long **)(param_1 + 0x28) + 0x12); pcVar4 = _mi_seq_search; lVar7 = 0x40; if ((uVar1 & 2) == 0) { pcVar3 = _mi_store_static_key; pcVar5 = _mi_calc_var_key_length; } else { lVar2 = **(long **)(param_1 + 0x28); pcVar3 = _mi_store_var_pack_key; pcVar5 = _mi_calc_var_pack_key_length; if ((lVar2 != 0) && ((uVar1 & 0x10) == 0 && (*(uint *)(lVar2 + 0xc) & 0x40) == 0)) { if (*(uint *)(lVar2 + 0x98) < 2) { pcVar4 = _mi_prefix_search; } else { pcVar4 = _mi_seq_search; } } } goto LAB_0017f27d; } pcVar3 = _mi_store_static_key; pcVar5 = _mi_calc_static_key_length; pcVar4 = _mi_get_static_key; pcVar6 = _mi_bin_search; } else { pcVar3 = _mi_store_bin_pack_key; pcVar5 = _mi_calc_bin_pack_key_length; pcVar4 = _mi_get_binary_pack_key; pcVar6 = _mi_seq_search; } *(code **)(param_1 + 0x40) = pcVar6; lVar7 = 0x48; LAB_0017f27d: *(code **)(param_1 + lVar7) = pcVar4; *(code **)(param_1 + 0x50) = pcVar5; *(code **)(param_1 + 0x58) = pcVar3; return; }
2,979
ast_create_case
eshkol/src/frontend/ast/create/ast_create.c
AstNode* ast_create_case(Arena* arena, AstNode* key, AstNode** clauses, size_t clause_count, size_t line, size_t column) { AstNode* node = ast_create_node(arena, AST_CASE, line, column); if (!node) { return NULL; } node->as.case_expr.key = key; node->as.case_expr.clauses = clauses; node->as.case_expr.clause_count = clause_count; return node; }
O3
c
ast_create_case: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %r15 movl $0x13, %esi movq %r8, %rdx movq %r9, %rcx callq 0x3978 testq %rax, %rax je 0x2f8b movq %r15, 0x48(%rax) movq %r14, 0x50(%rax) movq %rbx, 0x58(%rax) addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
ast_create_case: push rbp mov rbp, rsp push r15 push r14 push rbx push rax mov rbx, rcx mov r14, rdx mov r15, rsi mov esi, 13h mov rdx, r8 mov rcx, r9 call ast_create_node test rax, rax jz short loc_2F8B mov [rax+48h], r15 mov [rax+50h], r14 mov [rax+58h], rbx loc_2F8B: add rsp, 8 pop rbx pop r14 pop r15 pop rbp retn
_QWORD * ast_create_case(long long a1, long long a2, long long a3, long long a4, long long a5, long long a6) { _QWORD *result; // rax result = (_QWORD *)ast_create_node(a1, 19LL, a5, a6); if ( result ) { result[9] = a2; result[10] = a3; result[11] = a4; } return result; }
ast_create_case: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH RBX PUSH RAX MOV RBX,RCX MOV R14,RDX MOV R15,RSI MOV ESI,0x13 MOV RDX,R8 MOV RCX,R9 CALL 0x00103978 TEST RAX,RAX JZ 0x00102f8b MOV qword ptr [RAX + 0x48],R15 MOV qword ptr [RAX + 0x50],R14 MOV qword ptr [RAX + 0x58],RBX LAB_00102f8b: ADD RSP,0x8 POP RBX POP R14 POP R15 POP RBP RET
void ast_create_case(int8 param_1,int8 param_2,int8 param_3,int8 param_4, int8 param_5,int8 param_6) { long lVar1; lVar1 = ast_create_node(param_1,0x13,param_5,param_6); if (lVar1 != 0) { *(int8 *)(lVar1 + 0x48) = param_2; *(int8 *)(lVar1 + 0x50) = param_3; *(int8 *)(lVar1 + 0x58) = param_4; } return; }
2,980
my_strntoul_mb2_or_mb4
eloqsql/strings/ctype-ucs2.c
static ulong my_strntoul_mb2_or_mb4(CHARSET_INFO *cs, const char *nptr, size_t l, int base, char **endptr, int *err) { int negative= 0; int overflow; int cnv; my_wc_t wc; my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc; register unsigned int cutlim; register uint32 cutoff; register uint32 res; register const uchar *s= (const uchar*) nptr; register const uchar *e= (const uchar*) nptr + l; const uchar *save; *err= 0; do { if ((cnv= mb_wc(cs, &wc, s, e)) > 0) { switch (wc) { case ' ' : break; case '\t': break; case '-' : negative= !negative; break; case '+' : break; default : goto bs; } } else /* No more characters or bad multibyte sequence */ { if (endptr !=NULL ) *endptr= (char*)s; err[0]= (cnv == MY_CS_ILSEQ) ? EILSEQ : EDOM; return 0; } s+= cnv; } while (1); bs: overflow= 0; res= 0; save= s; cutoff= ((uint32)~0L) / (uint32) base; cutlim= (uint) (((uint32)~0L) % (uint32) base); do { if ((cnv= mb_wc(cs, &wc, s, e)) > 0) { s+= cnv; if (wc >= '0' && wc <= '9') wc-= '0'; else if (wc >= 'A' && wc <= 'Z') wc= wc - 'A' + 10; else if (wc >= 'a' && wc <= 'z') wc= wc - 'a' + 10; else break; if ((int) wc >= base) break; if (res > cutoff || (res == cutoff && wc > cutlim)) overflow = 1; else { res*= (uint32) base; res+= wc; } } else if (cnv == MY_CS_ILSEQ) { if (endptr != NULL ) *endptr= (char*)s; err[0]= EILSEQ; return 0; } else { /* No more characters */ break; } } while(1); if (endptr != NULL) *endptr= (char *) s; if (s == save) { err[0]= EDOM; return 0L; } if (overflow) { err[0]= (ERANGE); return (~(uint32) 0); } return (negative ? -((long) res) : (long) res); }
O3
c
my_strntoul_mb2_or_mb4: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %r8, -0x40(%rbp) movl %ecx, -0x34(%rbp) movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 movq 0xb8(%rdi), %rax movq 0x28(%rax), %r12 addq %rsi, %r13 movq %r9, -0x50(%rbp) movl $0x0, (%r9) leaq -0x30(%rbp), %rsi movq %r15, %rdx movq %r13, %rcx callq *%r12 testl %eax, %eax jle 0x4b435 movl $0x0, -0x38(%rbp) leaq -0x30(%rbp), %rbx movq -0x30(%rbp), %rcx cmpq $0x2a, %rcx jg 0x4b405 cmpq $0x9, %rcx je 0x4b41d cmpq $0x20, %rcx je 0x4b41d jmp 0x4b467 cmpq $0x2b, %rcx je 0x4b41d cmpq $0x2d, %rcx jne 0x4b467 xorl %ecx, %ecx cmpl $0x0, -0x38(%rbp) sete %cl movl %ecx, -0x38(%rbp) movl %eax, %eax addq %rax, %r15 movq %r14, %rdi movq %rbx, %rsi movq %r15, %rdx movq %r13, %rcx callq *%r12 testl %eax, %eax jg 0x4b3ed movq -0x40(%rbp), %rcx testq %rcx, %rcx je 0x4b441 movq %r15, (%rcx) testl %eax, %eax movl $0x54, %eax movl $0x21, %ecx cmovel %eax, %ecx movq -0x50(%rbp), %rax movl %ecx, (%rax) xorl %eax, %eax addq $0x48, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0xffffffff, %eax # imm = 0xFFFFFFFF xorl %edx, %edx divl -0x34(%rbp) movl %edx, %ebx movl %eax, -0x44(%rbp) leaq -0x30(%rbp), %rsi movq %r14, %rdi movq %r15, %rdx movq %r13, %rcx callq *%r12 testl %eax, %eax jle 0x4b52b movq %r12, -0x68(%rbp) movl %ebx, %ecx movq %rcx, -0x60(%rbp) xorl %ecx, %ecx movq %r15, %rbx xorl %edi, %edi movq %rbx, %rsi movl %eax, %ebx addq %rsi, %rbx movq -0x30(%rbp), %rsi leaq -0x30(%rsi), %rax cmpq $0x9, %rax ja 0x4b4bb movq %rax, -0x30(%rbp) jmp 0x4b4e0 leaq -0x41(%rsi), %rax cmpq $0x19, %rax ja 0x4b4cb addq $-0x37, %rsi jmp 0x4b4d9 leaq -0x61(%rsi), %rax cmpq $0x19, %rax ja 0x4b53c addq $-0x57, %rsi movq %rsi, -0x30(%rbp) movq %rsi, %rax cmpl -0x34(%rbp), %eax jge 0x4b53c movl $0x1, %esi cmpl -0x44(%rbp), %ecx ja 0x4b503 jne 0x4b4fb movl -0x44(%rbp), %r12d cmpq -0x60(%rbp), %rax ja 0x4b506 imull -0x34(%rbp), %ecx addl %eax, %ecx movl %edi, %esi movl %ecx, %r12d movl %esi, -0x54(%rbp) movq %r14, %rdi leaq -0x30(%rbp), %rsi movq %rbx, %rdx movq %r13, %rcx callq *-0x68(%rbp) movl -0x54(%rbp), %esi movl %r12d, %ecx movl %esi, %edi testl %eax, %eax jg 0x4b49f jmp 0x4b533 xorl %r12d, %r12d movq %r15, %rbx xorl %esi, %esi testl %eax, %eax je 0x4b574 movl %esi, %edi movl %r12d, %ecx movq -0x40(%rbp), %rax testq %rax, %rax je 0x4b548 movq %rbx, (%rax) cmpq %r15, %rbx je 0x4b565 testl %edi, %edi je 0x4b58f movq -0x50(%rbp), %rax movl $0x22, (%rax) movl $0xffffffff, %eax # imm = 0xFFFFFFFF jmp 0x4b458 movq -0x50(%rbp), %rax movl $0x21, (%rax) jmp 0x4b456 movq -0x40(%rbp), %rax testq %rax, %rax je 0x4b580 movq %rbx, (%rax) movq -0x50(%rbp), %rax movl $0x54, (%rax) jmp 0x4b456 movl %ecx, %ecx movq %rcx, %rax negq %rax cmpl $0x0, -0x38(%rbp) cmoveq %rcx, %rax jmp 0x4b458
my_strntoul_mb2_or_mb4: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 48h mov [rbp+var_40], r8 mov [rbp+var_34], ecx mov r13, rdx mov r15, rsi mov r14, rdi mov rax, [rdi+0B8h] mov r12, [rax+28h] add r13, rsi mov [rbp+var_50], r9 mov dword ptr [r9], 0 lea rsi, [rbp+var_30] mov rdx, r15 mov rcx, r13 call r12 test eax, eax jle short loc_4B435 mov [rbp+var_38], 0 lea rbx, [rbp+var_30] loc_4B3ED: mov rcx, [rbp+var_30] cmp rcx, 2Ah ; '*' jg short loc_4B405 cmp rcx, 9 jz short loc_4B41D cmp rcx, 20h ; ' ' jz short loc_4B41D jmp short loc_4B467 loc_4B405: cmp rcx, 2Bh ; '+' jz short loc_4B41D cmp rcx, 2Dh ; '-' jnz short loc_4B467 xor ecx, ecx cmp [rbp+var_38], 0 setz cl mov [rbp+var_38], ecx loc_4B41D: mov eax, eax add r15, rax mov rdi, r14 mov rsi, rbx mov rdx, r15 mov rcx, r13 call r12 test eax, eax jg short loc_4B3ED loc_4B435: mov rcx, [rbp+var_40] test rcx, rcx jz short loc_4B441 mov [rcx], r15 loc_4B441: test eax, eax mov eax, 54h ; 'T' mov ecx, 21h ; '!' cmovz ecx, eax mov rax, [rbp+var_50] mov [rax], ecx loc_4B456: xor eax, eax loc_4B458: add rsp, 48h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_4B467: mov eax, 0FFFFFFFFh xor edx, edx div [rbp+var_34] mov ebx, edx mov [rbp+var_44], eax lea rsi, [rbp+var_30] mov rdi, r14 mov rdx, r15 mov rcx, r13 call r12 test eax, eax jle loc_4B52B mov [rbp+var_68], r12 mov ecx, ebx mov [rbp+var_60], rcx xor ecx, ecx mov rbx, r15 xor edi, edi loc_4B49F: mov rsi, rbx mov ebx, eax add rbx, rsi mov rsi, [rbp+var_30] lea rax, [rsi-30h] cmp rax, 9 ja short loc_4B4BB mov [rbp+var_30], rax jmp short loc_4B4E0 loc_4B4BB: lea rax, [rsi-41h] cmp rax, 19h ja short loc_4B4CB add rsi, 0FFFFFFFFFFFFFFC9h jmp short loc_4B4D9 loc_4B4CB: lea rax, [rsi-61h] cmp rax, 19h ja short loc_4B53C add rsi, 0FFFFFFFFFFFFFFA9h loc_4B4D9: mov [rbp+var_30], rsi mov rax, rsi loc_4B4E0: cmp eax, [rbp+var_34] jge short loc_4B53C mov esi, 1 cmp ecx, [rbp+var_44] ja short loc_4B503 jnz short loc_4B4FB mov r12d, [rbp+var_44] cmp rax, [rbp+var_60] ja short loc_4B506 loc_4B4FB: imul ecx, [rbp+var_34] add ecx, eax mov esi, edi loc_4B503: mov r12d, ecx loc_4B506: mov [rbp+var_54], esi mov rdi, r14 lea rsi, [rbp+var_30] mov rdx, rbx mov rcx, r13 call [rbp+var_68] mov esi, [rbp+var_54] mov ecx, r12d mov edi, esi test eax, eax jg loc_4B49F jmp short loc_4B533 loc_4B52B: xor r12d, r12d mov rbx, r15 xor esi, esi loc_4B533: test eax, eax jz short loc_4B574 mov edi, esi mov ecx, r12d loc_4B53C: mov rax, [rbp+var_40] test rax, rax jz short loc_4B548 mov [rax], rbx loc_4B548: cmp rbx, r15 jz short loc_4B565 test edi, edi jz short loc_4B58F mov rax, [rbp+var_50] mov dword ptr [rax], 22h ; '"' mov eax, 0FFFFFFFFh jmp loc_4B458 loc_4B565: mov rax, [rbp+var_50] mov dword ptr [rax], 21h ; '!' jmp loc_4B456 loc_4B574: mov rax, [rbp+var_40] test rax, rax jz short loc_4B580 mov [rax], rbx loc_4B580: mov rax, [rbp+var_50] mov dword ptr [rax], 54h ; 'T' jmp loc_4B456 loc_4B58F: mov ecx, ecx mov rax, rcx neg rax cmp [rbp+var_38], 0 cmovz rax, rcx jmp loc_4B458
long long my_strntoul_mb2_or_mb4(long long a1, long long a2, long long a3, unsigned int a4, _QWORD *a5, int *a6) { long long v6; // r15 long long ( *v8)(long long, _QWORD *, long long, long long); // r12 long long v9; // r13 int v10; // eax int v11; // ecx long long result; // rax int v13; // eax unsigned int v14; // ecx long long v15; // rbx int v16; // edi unsigned long long v17; // rax long long v18; // rsi int v19; // esi unsigned int v20; // r12d long long ( *v21)(long long, _QWORD *, long long, long long); // [rsp+8h] [rbp-68h] unsigned int v23; // [rsp+2Ch] [rbp-44h] BOOL v25; // [rsp+38h] [rbp-38h] _QWORD v27[6]; // [rsp+40h] [rbp-30h] BYREF v6 = a2; v8 = *(long long ( **)(long long, _QWORD *, long long, long long))(*(_QWORD *)(a1 + 184) + 40LL); v9 = a2 + a3; *a6 = 0; v10 = v8(a1, v27, a2, a2 + a3); if ( v10 <= 0 ) { LABEL_11: if ( a5 ) *a5 = v6; v11 = 33; if ( !v10 ) v11 = 84; *a6 = v11; return 0LL; } v25 = 0; while ( 1 ) { if ( v27[0] > 42LL ) { if ( v27[0] != 43LL ) { if ( v27[0] != 45LL ) break; v25 = !v25; } goto LABEL_10; } if ( v27[0] != 9LL && v27[0] != 32LL ) break; LABEL_10: v6 += (unsigned int)v10; v10 = v8(a1, v27, v6, v9); if ( v10 <= 0 ) goto LABEL_11; } v23 = 0xFFFFFFFF / a4; v13 = v8(a1, v27, v6, v9); if ( v13 > 0 ) { v21 = v8; v14 = 0; v15 = v6; v16 = 0; while ( 1 ) { v15 += (unsigned int)v13; v17 = v27[0] - 48LL; if ( (unsigned long long)(v27[0] - 48LL) > 9 ) { if ( (unsigned long long)(v27[0] - 65LL) > 0x19 ) { if ( (unsigned long long)(v27[0] - 97LL) > 0x19 ) goto LABEL_37; v18 = v27[0] - 87LL; } else { v18 = v27[0] - 55LL; } v27[0] = v18; v17 = v18; } else { v27[0] -= 48LL; } if ( (int)v17 >= (int)a4 ) goto LABEL_37; v19 = 1; if ( v14 <= v23 ) { if ( v14 == v23 ) { v20 = 0xFFFFFFFF / a4; if ( v17 > 0xFFFFFFFF % a4 ) goto LABEL_32; } v14 = v17 + a4 * v14; v19 = v16; } v20 = v14; LABEL_32: v13 = v21(a1, v27, v15, v9); v14 = v20; v16 = v19; if ( v13 <= 0 ) goto LABEL_35; } } v20 = 0; v15 = v6; v19 = 0; LABEL_35: if ( !v13 ) { if ( a5 ) *a5 = v15; *a6 = 84; return 0LL; } v16 = v19; v14 = v20; LABEL_37: if ( a5 ) *a5 = v15; if ( v15 == v6 ) { *a6 = 33; return 0LL; } if ( v16 ) { *a6 = 34; return 0xFFFFFFFFLL; } else { result = -(long long)v14; if ( !v25 ) return v14; } return result; }
my_strntoul_mb2_or_mb4: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x48 MOV qword ptr [RBP + -0x40],R8 MOV dword ptr [RBP + -0x34],ECX MOV R13,RDX MOV R15,RSI MOV R14,RDI MOV RAX,qword ptr [RDI + 0xb8] MOV R12,qword ptr [RAX + 0x28] ADD R13,RSI MOV qword ptr [RBP + -0x50],R9 MOV dword ptr [R9],0x0 LEA RSI,[RBP + -0x30] MOV RDX,R15 MOV RCX,R13 CALL R12 TEST EAX,EAX JLE 0x0014b435 MOV dword ptr [RBP + -0x38],0x0 LEA RBX,[RBP + -0x30] LAB_0014b3ed: MOV RCX,qword ptr [RBP + -0x30] CMP RCX,0x2a JG 0x0014b405 CMP RCX,0x9 JZ 0x0014b41d CMP RCX,0x20 JZ 0x0014b41d JMP 0x0014b467 LAB_0014b405: CMP RCX,0x2b JZ 0x0014b41d CMP RCX,0x2d JNZ 0x0014b467 XOR ECX,ECX CMP dword ptr [RBP + -0x38],0x0 SETZ CL MOV dword ptr [RBP + -0x38],ECX LAB_0014b41d: MOV EAX,EAX ADD R15,RAX MOV RDI,R14 MOV RSI,RBX MOV RDX,R15 MOV RCX,R13 CALL R12 TEST EAX,EAX JG 0x0014b3ed LAB_0014b435: MOV RCX,qword ptr [RBP + -0x40] TEST RCX,RCX JZ 0x0014b441 MOV qword ptr [RCX],R15 LAB_0014b441: TEST EAX,EAX MOV EAX,0x54 MOV ECX,0x21 CMOVZ ECX,EAX MOV RAX,qword ptr [RBP + -0x50] MOV dword ptr [RAX],ECX LAB_0014b456: XOR EAX,EAX LAB_0014b458: ADD RSP,0x48 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_0014b467: MOV EAX,0xffffffff XOR EDX,EDX DIV dword ptr [RBP + -0x34] MOV EBX,EDX MOV dword ptr [RBP + -0x44],EAX LEA RSI,[RBP + -0x30] MOV RDI,R14 MOV RDX,R15 MOV RCX,R13 CALL R12 TEST EAX,EAX JLE 0x0014b52b MOV qword ptr [RBP + -0x68],R12 MOV ECX,EBX MOV qword ptr [RBP + -0x60],RCX XOR ECX,ECX MOV RBX,R15 XOR EDI,EDI LAB_0014b49f: MOV RSI,RBX MOV EBX,EAX ADD RBX,RSI MOV RSI,qword ptr [RBP + -0x30] LEA RAX,[RSI + -0x30] CMP RAX,0x9 JA 0x0014b4bb MOV qword ptr [RBP + -0x30],RAX JMP 0x0014b4e0 LAB_0014b4bb: LEA RAX,[RSI + -0x41] CMP RAX,0x19 JA 0x0014b4cb ADD RSI,-0x37 JMP 0x0014b4d9 LAB_0014b4cb: LEA RAX,[RSI + -0x61] CMP RAX,0x19 JA 0x0014b53c ADD RSI,-0x57 LAB_0014b4d9: MOV qword ptr [RBP + -0x30],RSI MOV RAX,RSI LAB_0014b4e0: CMP EAX,dword ptr [RBP + -0x34] JGE 0x0014b53c MOV ESI,0x1 CMP ECX,dword ptr [RBP + -0x44] JA 0x0014b503 JNZ 0x0014b4fb MOV R12D,dword ptr [RBP + -0x44] CMP RAX,qword ptr [RBP + -0x60] JA 0x0014b506 LAB_0014b4fb: IMUL ECX,dword ptr [RBP + -0x34] ADD ECX,EAX MOV ESI,EDI LAB_0014b503: MOV R12D,ECX LAB_0014b506: MOV dword ptr [RBP + -0x54],ESI MOV RDI,R14 LEA RSI,[RBP + -0x30] MOV RDX,RBX MOV RCX,R13 CALL qword ptr [RBP + -0x68] MOV ESI,dword ptr [RBP + -0x54] MOV ECX,R12D MOV EDI,ESI TEST EAX,EAX JG 0x0014b49f JMP 0x0014b533 LAB_0014b52b: XOR R12D,R12D MOV RBX,R15 XOR ESI,ESI LAB_0014b533: TEST EAX,EAX JZ 0x0014b574 MOV EDI,ESI MOV ECX,R12D LAB_0014b53c: MOV RAX,qword ptr [RBP + -0x40] TEST RAX,RAX JZ 0x0014b548 MOV qword ptr [RAX],RBX LAB_0014b548: CMP RBX,R15 JZ 0x0014b565 TEST EDI,EDI JZ 0x0014b58f MOV RAX,qword ptr [RBP + -0x50] MOV dword ptr [RAX],0x22 MOV EAX,0xffffffff JMP 0x0014b458 LAB_0014b565: MOV RAX,qword ptr [RBP + -0x50] MOV dword ptr [RAX],0x21 JMP 0x0014b456 LAB_0014b574: MOV RAX,qword ptr [RBP + -0x40] TEST RAX,RAX JZ 0x0014b580 MOV qword ptr [RAX],RBX LAB_0014b580: MOV RAX,qword ptr [RBP + -0x50] MOV dword ptr [RAX],0x54 JMP 0x0014b456 LAB_0014b58f: MOV ECX,ECX MOV RAX,RCX NEG RAX CMP dword ptr [RBP + -0x38],0x0 CMOVZ RAX,RCX JMP 0x0014b458
ulong my_strntoul_mb2_or_mb4 (long param_1,long param_2,long param_3,uint param_4,long *param_5, int4 *param_6) { code *pcVar1; bool bVar2; bool bVar3; bool bVar4; uint uVar5; uint uVar6; int4 uVar7; uint uVar8; long lVar9; ulong uVar10; ulong local_38; pcVar1 = *(code **)(*(long *)(param_1 + 0xb8) + 0x28); param_3 = param_3 + param_2; *param_6 = 0; uVar5 = (*pcVar1)(param_1,&local_38,param_2,param_3); if (0 < (int)uVar5) { bVar2 = false; do { if ((long)local_38 < 0x2b) { if ((local_38 != 9) && (local_38 != 0x20)) { LAB_0014b467: uVar5 = (uint)(0xffffffff / (ulong)param_4); uVar6 = (*pcVar1)(param_1,&local_38,param_2,param_3); lVar9 = param_2; if ((int)uVar6 < 1) { uVar8 = 0; bVar3 = false; goto LAB_0014b533; } uVar8 = 0; bVar3 = false; goto LAB_0014b49f; } } else if (local_38 != 0x2b) { if (local_38 != 0x2d) goto LAB_0014b467; bVar2 = !bVar2; } param_2 = param_2 + (ulong)uVar5; uVar5 = (*pcVar1)(param_1,&local_38,param_2,param_3); } while (0 < (int)uVar5); } if (param_5 != (long *)0x0) { *param_5 = param_2; } uVar7 = 0x21; if (uVar5 == 0) { uVar7 = 0x54; } *param_6 = uVar7; return 0; while( true ) { if ((int)param_4 <= (int)uVar10) goto LAB_0014b53c; uVar6 = uVar8; bVar4 = true; if ((uVar8 <= uVar5) && ((uVar8 != uVar5 || (uVar6 = uVar5, uVar10 <= 0xffffffffU % (ulong)param_4)))) { uVar6 = uVar8 * param_4 + (int)uVar10; bVar4 = bVar3; } bVar3 = bVar4; uVar8 = uVar6; local_38 = uVar10; uVar6 = (*pcVar1)(param_1,&local_38,lVar9,param_3); if ((int)uVar6 < 1) break; LAB_0014b49f: lVar9 = (ulong)uVar6 + lVar9; uVar10 = local_38 - 0x30; if (9 < uVar10) { if (local_38 - 0x41 < 0x1a) { uVar10 = local_38 - 0x37; } else { if (0x19 < local_38 - 0x61) goto LAB_0014b53c; uVar10 = local_38 - 0x57; } } } LAB_0014b533: if (uVar6 == 0) { if (param_5 != (long *)0x0) { *param_5 = lVar9; } *param_6 = 0x54; } else { LAB_0014b53c: if (param_5 != (long *)0x0) { *param_5 = lVar9; } if (lVar9 != param_2) { if (bVar3) { *param_6 = 0x22; return 0xffffffff; } if (!bVar2) { return (ulong)uVar8; } return -(ulong)uVar8; } *param_6 = 0x21; } return 0; }
2,981
array_append_string_unique
eloqsql/mysys/mf_arr_appstr.c
my_bool array_append_string_unique(const char *str, const char **array, size_t size) { const char **p; /* end points at the terminating NULL element */ const char **end= array + size - 1; DBUG_ASSERT(*end == NULL); for (p= array; *p; ++p) { if (strcmp(*p, str) == 0) break; } if (p >= end) return TRUE; /* Array is full */ DBUG_ASSERT(*p == NULL || strcmp(*p, str) == 0); while (*(p + 1)) { *p= *(p + 1); ++p; } DBUG_ASSERT(p < end); *p= str; return FALSE; /* Success */ }
O0
c
array_append_string_unique: pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq -0x18(%rbp), %rax movq -0x20(%rbp), %rcx shlq $0x3, %rcx addq %rcx, %rax addq $-0x8, %rax movq %rax, -0x30(%rbp) jmp 0x4239d movq -0x18(%rbp), %rax movq %rax, -0x28(%rbp) movq -0x28(%rbp), %rax cmpq $0x0, (%rax) je 0x423d6 movq -0x28(%rbp), %rax movq (%rax), %rdi movq -0x10(%rbp), %rsi callq 0x25480 cmpl $0x0, %eax jne 0x423c6 jmp 0x423d6 jmp 0x423c8 movq -0x28(%rbp), %rax addq $0x8, %rax movq %rax, -0x28(%rbp) jmp 0x423a5 movq -0x28(%rbp), %rax cmpq -0x30(%rbp), %rax jb 0x423e6 movb $0x1, -0x1(%rbp) jmp 0x42427 jmp 0x423e8 jmp 0x423ea jmp 0x423ec movq -0x28(%rbp), %rax cmpq $0x0, 0x8(%rax) je 0x42414 movq -0x28(%rbp), %rax movq 0x8(%rax), %rcx movq -0x28(%rbp), %rax movq %rcx, (%rax) movq -0x28(%rbp), %rax addq $0x8, %rax movq %rax, -0x28(%rbp) jmp 0x423ec jmp 0x42416 jmp 0x42418 movq -0x10(%rbp), %rcx movq -0x28(%rbp), %rax movq %rcx, (%rax) movb $0x0, -0x1(%rbp) movb -0x1(%rbp), %al addq $0x30, %rsp popq %rbp retq
array_append_string_unique: push rbp mov rbp, rsp sub rsp, 30h mov [rbp+var_10], rdi mov [rbp+var_18], rsi mov [rbp+var_20], rdx mov rax, [rbp+var_18] mov rcx, [rbp+var_20] shl rcx, 3 add rax, rcx add rax, 0FFFFFFFFFFFFFFF8h mov [rbp+var_30], rax jmp short $+2 loc_4239D: mov rax, [rbp+var_18] mov [rbp+var_28], rax loc_423A5: mov rax, [rbp+var_28] cmp qword ptr [rax], 0 jz short loc_423D6 mov rax, [rbp+var_28] mov rdi, [rax] mov rsi, [rbp+var_10] call _strcmp cmp eax, 0 jnz short loc_423C6 jmp short loc_423D6 loc_423C6: jmp short $+2 loc_423C8: mov rax, [rbp+var_28] add rax, 8 mov [rbp+var_28], rax jmp short loc_423A5 loc_423D6: mov rax, [rbp+var_28] cmp rax, [rbp+var_30] jb short loc_423E6 mov [rbp+var_1], 1 jmp short loc_42427 loc_423E6: jmp short $+2 loc_423E8: jmp short $+2 loc_423EA: jmp short $+2 loc_423EC: mov rax, [rbp+var_28] cmp qword ptr [rax+8], 0 jz short loc_42414 mov rax, [rbp+var_28] mov rcx, [rax+8] mov rax, [rbp+var_28] mov [rax], rcx mov rax, [rbp+var_28] add rax, 8 mov [rbp+var_28], rax jmp short loc_423EC loc_42414: jmp short $+2 loc_42416: jmp short $+2 loc_42418: mov rcx, [rbp+var_10] mov rax, [rbp+var_28] mov [rax], rcx mov [rbp+var_1], 0 loc_42427: mov al, [rbp+var_1] add rsp, 30h pop rbp retn
char array_append_string_unique(long long a1, _QWORD *a2, long long a3) { unsigned long long v4; // [rsp+0h] [rbp-30h] _QWORD *i; // [rsp+8h] [rbp-28h] v4 = (unsigned long long)&a2[a3 - 1]; for ( i = a2; *i && (unsigned int)strcmp(*i, a1); ++i ) ; if ( (unsigned long long)i >= v4 ) return 1; while ( i[1] ) { *i = i[1]; ++i; } *i = a1; return 0; }
array_append_string_unique: PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + -0x10],RDI MOV qword ptr [RBP + -0x18],RSI MOV qword ptr [RBP + -0x20],RDX MOV RAX,qword ptr [RBP + -0x18] MOV RCX,qword ptr [RBP + -0x20] SHL RCX,0x3 ADD RAX,RCX ADD RAX,-0x8 MOV qword ptr [RBP + -0x30],RAX JMP 0x0014239d LAB_0014239d: MOV RAX,qword ptr [RBP + -0x18] MOV qword ptr [RBP + -0x28],RAX LAB_001423a5: MOV RAX,qword ptr [RBP + -0x28] CMP qword ptr [RAX],0x0 JZ 0x001423d6 MOV RAX,qword ptr [RBP + -0x28] MOV RDI,qword ptr [RAX] MOV RSI,qword ptr [RBP + -0x10] CALL 0x00125480 CMP EAX,0x0 JNZ 0x001423c6 JMP 0x001423d6 LAB_001423c6: JMP 0x001423c8 LAB_001423c8: MOV RAX,qword ptr [RBP + -0x28] ADD RAX,0x8 MOV qword ptr [RBP + -0x28],RAX JMP 0x001423a5 LAB_001423d6: MOV RAX,qword ptr [RBP + -0x28] CMP RAX,qword ptr [RBP + -0x30] JC 0x001423e6 MOV byte ptr [RBP + -0x1],0x1 JMP 0x00142427 LAB_001423e6: JMP 0x001423e8 LAB_001423e8: JMP 0x001423ea LAB_001423ea: JMP 0x001423ec LAB_001423ec: MOV RAX,qword ptr [RBP + -0x28] CMP qword ptr [RAX + 0x8],0x0 JZ 0x00142414 MOV RAX,qword ptr [RBP + -0x28] MOV RCX,qword ptr [RAX + 0x8] MOV RAX,qword ptr [RBP + -0x28] MOV qword ptr [RAX],RCX MOV RAX,qword ptr [RBP + -0x28] ADD RAX,0x8 MOV qword ptr [RBP + -0x28],RAX JMP 0x001423ec LAB_00142414: JMP 0x00142416 LAB_00142416: JMP 0x00142418 LAB_00142418: MOV RCX,qword ptr [RBP + -0x10] MOV RAX,qword ptr [RBP + -0x28] MOV qword ptr [RAX],RCX MOV byte ptr [RBP + -0x1],0x0 LAB_00142427: MOV AL,byte ptr [RBP + -0x1] ADD RSP,0x30 POP RBP RET
int1 array_append_string_unique(char *param_1,long *param_2,long param_3) { int iVar1; long *local_30; int1 local_9; local_30 = param_2; while ((*local_30 != 0 && (iVar1 = strcmp((char *)*local_30,param_1), iVar1 != 0))) { local_30 = local_30 + 1; } if (local_30 < param_2 + param_3 + -1) { for (; local_30[1] != 0; local_30 = local_30 + 1) { *local_30 = local_30[1]; } *local_30 = (long)param_1; local_9 = 0; } else { local_9 = 1; } return local_9; }
2,982
array_append_string_unique
eloqsql/mysys/mf_arr_appstr.c
my_bool array_append_string_unique(const char *str, const char **array, size_t size) { const char **p; /* end points at the terminating NULL element */ const char **end= array + size - 1; DBUG_ASSERT(*end == NULL); for (p= array; *p; ++p) { if (strcmp(*p, str) == 0) break; } if (p >= end) return TRUE; /* Array is full */ DBUG_ASSERT(*p == NULL || strcmp(*p, str) == 0); while (*(p + 1)) { *p= *(p + 1); ++p; } DBUG_ASSERT(p < end); *p= str; return FALSE; /* Success */ }
O3
c
array_append_string_unique: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 leaq (%rsi,%rdx,8), %r15 addq $-0x8, %r15 movq (%rsi), %rdi testq %rdi, %rdi je 0x35d7e movq %r14, %rsi callq 0x244d0 testl %eax, %eax je 0x35d7e movq 0x8(%rbx), %rdi addq $0x8, %rbx jmp 0x35d63 movb $0x1, %al cmpq %r15, %rbx jae 0x35da0 movq 0x8(%rbx), %rax testq %rax, %rax je 0x35d9b movq %rax, (%rbx) movq 0x10(%rbx), %rax addq $0x8, %rbx jmp 0x35d89 movq %r14, (%rbx) xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq nop
array_append_string_unique: push rbp mov rbp, rsp push r15 push r14 push rbx push rax mov rbx, rsi mov r14, rdi lea r15, [rsi+rdx*8] add r15, 0FFFFFFFFFFFFFFF8h mov rdi, [rsi] loc_35D63: test rdi, rdi jz short loc_35D7E mov rsi, r14 call _strcmp test eax, eax jz short loc_35D7E mov rdi, [rbx+8] add rbx, 8 jmp short loc_35D63 loc_35D7E: mov al, 1 cmp rbx, r15 jnb short loc_35DA0 mov rax, [rbx+8] loc_35D89: test rax, rax jz short loc_35D9B mov [rbx], rax mov rax, [rbx+10h] add rbx, 8 jmp short loc_35D89 loc_35D9B: mov [rbx], r14 xor eax, eax loc_35DA0: add rsp, 8 pop rbx pop r14 pop r15 pop rbp retn
char array_append_string_unique(long long a1, _QWORD *a2, long long a3) { _QWORD *v3; // rbx unsigned long long v5; // r15 long long v6; // rdi char result; // al long long v8; // rax v3 = a2; v5 = (unsigned long long)&a2[a3 - 1]; v6 = *a2; while ( v6 && (unsigned int)strcmp(v6, a1) ) { v6 = v3[1]; ++v3; } result = 1; if ( (unsigned long long)v3 < v5 ) { v8 = v3[1]; while ( v8 ) { *v3 = v8; v8 = v3[2]; ++v3; } *v3 = a1; return 0; } return result; }
array_append_string_unique: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH RBX PUSH RAX MOV RBX,RSI MOV R14,RDI LEA R15,[RSI + RDX*0x8] ADD R15,-0x8 MOV RDI,qword ptr [RSI] LAB_00135d63: TEST RDI,RDI JZ 0x00135d7e MOV RSI,R14 CALL 0x001244d0 TEST EAX,EAX JZ 0x00135d7e MOV RDI,qword ptr [RBX + 0x8] ADD RBX,0x8 JMP 0x00135d63 LAB_00135d7e: MOV AL,0x1 CMP RBX,R15 JNC 0x00135da0 MOV RAX,qword ptr [RBX + 0x8] LAB_00135d89: TEST RAX,RAX JZ 0x00135d9b MOV qword ptr [RBX],RAX MOV RAX,qword ptr [RBX + 0x10] ADD RBX,0x8 JMP 0x00135d89 LAB_00135d9b: MOV qword ptr [RBX],R14 XOR EAX,EAX LAB_00135da0: ADD RSP,0x8 POP RBX POP R14 POP R15 POP RBP RET
int8 array_append_string_unique(char *param_1,long *param_2,long param_3) { long *plVar1; int iVar2; int8 uVar3; long lVar4; char *__s1; long *plVar5; plVar5 = param_2 + param_3 + -1; __s1 = (char *)*param_2; while (__s1 != (char *)0x0) { iVar2 = strcmp(__s1,param_1); if (iVar2 == 0) break; plVar1 = param_2 + 1; param_2 = param_2 + 1; __s1 = (char *)*plVar1; } uVar3 = 1; if (param_2 < plVar5) { lVar4 = param_2[1]; while (lVar4 != 0) { *param_2 = lVar4; plVar5 = param_2 + 2; param_2 = param_2 + 1; lVar4 = *plVar5; } *param_2 = (long)param_1; uVar3 = 0; } return uVar3; }
2,983
my_readlink
eloqsql/mysys/my_symlink.c
int my_readlink(char *to, const char *filename, myf MyFlags) { #ifndef HAVE_READLINK strmov(to,filename); return 1; #else int result=0; int length; DBUG_ENTER("my_readlink"); if ((length=readlink(filename, to, FN_REFLEN-1)) < 0) { /* Don't give an error if this wasn't a symlink */ if ((my_errno=errno) == EINVAL) { result= 1; strmov(to,filename); } else { if (MyFlags & MY_WME) my_error(EE_CANT_READLINK, MYF(0), filename, errno); result= -1; } } else to[length]=0; DBUG_PRINT("exit" ,("result: %d", result)); DBUG_RETURN(result); #endif /* HAVE_READLINK */ }
O3
c
my_readlink: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 movl $0x1ff, %edx # imm = 0x1FF movq %rsi, %rdi movq %r14, %rsi callq 0x29240 testl %eax, %eax js 0xa0c92 andl $0x7fffffff, %eax # imm = 0x7FFFFFFF movb $0x0, (%r14,%rax) xorl %r14d, %r14d jmp 0xa0cdf callq 0x29790 movq %rax, %r12 movl (%rax), %r13d callq 0xa1ab2 movl %r13d, (%rax) cmpl $0x16, %r13d jne 0xa0cbe movq %r14, %rdi movq %rbx, %rsi callq 0x29350 movl $0x1, %r14d jmp 0xa0cdf movl $0xffffffff, %r14d # imm = 0xFFFFFFFF testb $0x10, %r15b je 0xa0cdf movl (%r12), %ecx movl $0x18, %edi xorl %esi, %esi movq %rbx, %rdx xorl %eax, %eax callq 0x9dfc3 movl %r14d, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
my_readlink: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx push rax mov r15, rdx mov rbx, rsi mov r14, rdi mov edx, 1FFh mov rdi, rsi mov rsi, r14 call _readlink test eax, eax js short loc_A0C92 and eax, 7FFFFFFFh mov byte ptr [r14+rax], 0 xor r14d, r14d jmp short loc_A0CDF loc_A0C92: call ___errno_location mov r12, rax mov r13d, [rax] call _my_thread_var mov [rax], r13d cmp r13d, 16h jnz short loc_A0CBE mov rdi, r14 mov rsi, rbx call _strcpy mov r14d, 1 jmp short loc_A0CDF loc_A0CBE: mov r14d, 0FFFFFFFFh test r15b, 10h jz short loc_A0CDF mov ecx, [r12] mov edi, 18h xor esi, esi mov rdx, rbx xor eax, eax call my_error loc_A0CDF: mov eax, r14d add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn
long long my_readlink(long long a1, long long a2, char a3) { int v4; // eax unsigned int v5; // r14d unsigned int *v6; // r12 unsigned int v7; // r13d v4 = readlink(a2, a1, 511LL); if ( v4 < 0 ) { v6 = (unsigned int *)__errno_location(a2); v7 = *v6; *(_DWORD *)my_thread_var(a2) = v7; if ( v7 == 22 ) { strcpy(a1, a2); return 1; } else { v5 = -1; if ( (a3 & 0x10) != 0 ) my_error(0x18u, 0LL, a2, *v6); } } else { *(_BYTE *)(a1 + (v4 & 0x7FFFFFFF)) = 0; return 0; } return v5; }
my_readlink: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX MOV R15,RDX MOV RBX,RSI MOV R14,RDI MOV EDX,0x1ff MOV RDI,RSI MOV RSI,R14 CALL 0x00129240 TEST EAX,EAX JS 0x001a0c92 AND EAX,0x7fffffff MOV byte ptr [R14 + RAX*0x1],0x0 XOR R14D,R14D JMP 0x001a0cdf LAB_001a0c92: CALL 0x00129790 MOV R12,RAX MOV R13D,dword ptr [RAX] CALL 0x001a1ab2 MOV dword ptr [RAX],R13D CMP R13D,0x16 JNZ 0x001a0cbe MOV RDI,R14 MOV RSI,RBX CALL 0x00129350 MOV R14D,0x1 JMP 0x001a0cdf LAB_001a0cbe: MOV R14D,0xffffffff TEST R15B,0x10 JZ 0x001a0cdf MOV ECX,dword ptr [R12] MOV EDI,0x18 XOR ESI,ESI MOV RDX,RBX XOR EAX,EAX CALL 0x0019dfc3 LAB_001a0cdf: MOV EAX,R14D ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET
int8 my_readlink(char *param_1,char *param_2,ulong param_3) { int iVar1; ssize_t sVar2; int *piVar3; int *piVar4; int8 uVar5; sVar2 = readlink(param_2,param_1,0x1ff); if ((int)(uint)sVar2 < 0) { piVar3 = __errno_location(); iVar1 = *piVar3; piVar4 = (int *)_my_thread_var(); *piVar4 = iVar1; if (iVar1 == 0x16) { strcpy(param_1,param_2); uVar5 = 1; } else { uVar5 = 0xffffffff; if ((param_3 & 0x10) != 0) { my_error(0x18,0,param_2,*piVar3); } } } else { param_1[(uint)sVar2 & 0x7fffffff] = '\0'; uVar5 = 0; } return uVar5; }
2,984
my_fcvt
eloqsql/strings/dtoa.c
size_t my_fcvt(double x, int precision, char *to, my_bool *error) { int decpt, sign, len, i; char *res, *src, *end, *dst= to; char buf[DTOA_BUFF_SIZE]; DBUG_ASSERT(precision >= 0 && precision < DECIMAL_NOT_SPECIFIED && to != NULL); res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf)); if (decpt == DTOA_OVERFLOW) { dtoa_free(res, buf, sizeof(buf)); *to++= '0'; *to= '\0'; if (error != NULL) *error= TRUE; return 1; } src= res; len= (int)(end - src); if (sign) *dst++= '-'; if (decpt <= 0) { *dst++= '0'; *dst++= '.'; for (i= decpt; i < 0; i++) *dst++= '0'; } for (i= 1; i <= len; i++) { *dst++= *src++; if (i == decpt && i < len) *dst++= '.'; } while (i++ <= decpt) *dst++= '0'; if (precision > 0) { if (len <= decpt) *dst++= '.'; for (i= precision - MY_MAX(0, (len - decpt)); i > 0; i--) *dst++= '0'; } *dst= '\0'; if (error != NULL) *error= FALSE; dtoa_free(res, buf, sizeof(buf)); return dst - to; }
O3
c
my_fcvt: pushq %rbp movq %rsp, %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xe98, %rsp # imm = 0xE98 movq %rdx, -0xea8(%rbp) movq %rsi, %r14 movl %edi, %esi movq %fs:0x28, %rax movq %rax, -0x30(%rbp) leaq -0xe94(%rbp), %r13 leaq -0xe9c(%rbp), %rcx leaq -0xec0(%rbp), %r8 leaq -0xe90(%rbp), %rbx movl $0x5, %edi movl %esi, -0xe98(%rbp) movq %r13, %rdx movq %rbx, %r9 callq 0x76f46 movq %rax, %r15 movl (%r13), %r12d cmpl $0x270f, %r12d # imm = 0x270F jne 0x76db3 cmpq %rbx, %r15 setae %al leaq -0x30(%rbp), %rcx cmpq %r15, %rcx seta %cl testb %cl, %al jne 0x76d8f movq %r15, %rdi callq 0x26420 movw $0x30, (%r14) movl $0x1, %r13d movq -0xea8(%rbp), %rax testq %rax, %rax je 0x76f1d movb $0x1, (%rax) jmp 0x76f1d movq -0xec0(%rbp), %rbx movq %r14, %rax movl %ebx, %r14d cmpl $0x0, -0xe9c(%rbp) movq %rax, %r13 je 0x76dd3 leaq 0x1(%rax), %r13 movb $0x2d, (%rax) movq %rax, -0xeb8(%rbp) subl %r15d, %r14d testl %r12d, %r12d movl -0xe98(%rbp), %r8d jg 0x76e2d movw $0x2e30, (%r13) # imm = 0x2E30 leaq 0x2(%r13), %rdi testl %r12d, %r12d js 0x76dfe movq %rdi, %r13 jmp 0x76e2d movl %r12d, %eax notl %eax movq %rax, -0xeb0(%rbp) leaq 0x1(%rax), %rdx movl $0x30, %esi callq 0x261c0 movl -0xe98(%rbp), %r8d movq -0xeb0(%rbp), %rax addq %rax, %r13 addq $0x3, %r13 testl %r14d, %r14d jle 0x76e74 subl %r15d, %ebx incl %ebx movl %r14d, %eax xorl %ecx, %ecx movq %r13, %rdx leal 0x1(%rcx), %esi movb (%r15,%rcx), %dil incq %r13 movb %dil, (%rdx) cmpl -0xe94(%rbp), %esi jne 0x76e64 cmpl %r14d, %esi jge 0x76e64 movb $0x2e, 0x1(%rdx) addq $0x2, %rdx movq %rdx, %r13 incq %rcx cmpl %ecx, %eax jne 0x76e3c movl -0xe94(%rbp), %r12d jmp 0x76e79 movl $0x1, %ebx cmpl %r12d, %ebx jg 0x76e96 decl %ebx movb $0x30, (%r13) incq %r13 movl -0xe94(%rbp), %r12d incl %ebx cmpl %r12d, %ebx jl 0x76e80 testl %r8d, %r8d jle 0x76edc cmpl %r14d, %r12d jl 0x76eaf movb $0x2e, (%r13) incq %r13 movl -0xe94(%rbp), %r12d subl %r12d, %r14d cmpl %r8d, %r14d jge 0x76edc xorl %ebx, %ebx testl %r14d, %r14d cmovgl %r14d, %ebx notl %ebx addl %r8d, %ebx leaq 0x1(%rbx), %rdx movq %r13, %rdi movl $0x30, %esi callq 0x261c0 addq %rbx, %r13 incq %r13 movb $0x0, (%r13) movq -0xea8(%rbp), %rax testq %rax, %rax movq -0xeb8(%rbp), %rbx je 0x76ef7 movb $0x0, (%rax) leaq -0xe90(%rbp), %rax cmpq %rax, %r15 setae %al leaq -0x30(%rbp), %rcx cmpq %r15, %rcx seta %cl testb %cl, %al jne 0x76f1a movq %r15, %rdi callq 0x26420 subq %rbx, %r13 movq %fs:0x28, %rax cmpq -0x30(%rbp), %rax jne 0x76f41 movq %r13, %rax addq $0xe98, %rsp # imm = 0xE98 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq callq 0x263b0
my_fcvt: push rbp mov rbp, rsp push r15 push r14 push r13 push r12 push rbx sub rsp, 0E98h mov [rbp+var_EA8], rdx mov r14, rsi mov esi, edi mov rax, fs:28h mov [rbp+var_30], rax lea r13, [rbp+var_E94] lea rcx, [rbp+var_E9C] lea r8, [rbp+var_EC0] lea rbx, [rbp+var_E90] mov edi, 5 mov [rbp+var_E98], esi mov rdx, r13 mov r9, rbx call dtoa mov r15, rax mov r12d, [r13+0] cmp r12d, 270Fh jnz short loc_76DB3 cmp r15, rbx setnb al lea rcx, [rbp+var_30] cmp rcx, r15 setnbe cl test al, cl jnz short loc_76D8F mov rdi, r15 call _free loc_76D8F: mov word ptr [r14], 30h ; '0' mov r13d, 1 mov rax, [rbp+var_EA8] test rax, rax jz loc_76F1D mov byte ptr [rax], 1 jmp loc_76F1D loc_76DB3: mov rbx, [rbp+var_EC0] mov rax, r14 mov r14d, ebx cmp [rbp+var_E9C], 0 mov r13, rax jz short loc_76DD3 lea r13, [rax+1] mov byte ptr [rax], 2Dh ; '-' loc_76DD3: mov [rbp+var_EB8], rax sub r14d, r15d test r12d, r12d mov r8d, [rbp+var_E98] jg short loc_76E2D mov word ptr [r13+0], 2E30h lea rdi, [r13+2] test r12d, r12d js short loc_76DFE mov r13, rdi jmp short loc_76E2D loc_76DFE: mov eax, r12d not eax mov [rbp+var_EB0], rax lea rdx, [rax+1] mov esi, 30h ; '0' call _memset mov r8d, [rbp+var_E98] mov rax, [rbp+var_EB0] add r13, rax add r13, 3 loc_76E2D: test r14d, r14d jle short loc_76E74 sub ebx, r15d inc ebx mov eax, r14d xor ecx, ecx loc_76E3C: mov rdx, r13 lea esi, [rcx+1] mov dil, [r15+rcx] inc r13 mov [rdx], dil cmp esi, [rbp+var_E94] jnz short loc_76E64 cmp esi, r14d jge short loc_76E64 mov byte ptr [rdx+1], 2Eh ; '.' add rdx, 2 mov r13, rdx loc_76E64: inc rcx cmp eax, ecx jnz short loc_76E3C mov r12d, [rbp+var_E94] jmp short loc_76E79 loc_76E74: mov ebx, 1 loc_76E79: cmp ebx, r12d jg short loc_76E96 dec ebx loc_76E80: mov byte ptr [r13+0], 30h ; '0' inc r13 mov r12d, [rbp+var_E94] inc ebx cmp ebx, r12d jl short loc_76E80 loc_76E96: test r8d, r8d jle short loc_76EDC cmp r12d, r14d jl short loc_76EAF mov byte ptr [r13+0], 2Eh ; '.' inc r13 mov r12d, [rbp+var_E94] loc_76EAF: sub r14d, r12d cmp r14d, r8d jge short loc_76EDC xor ebx, ebx test r14d, r14d cmovg ebx, r14d not ebx add ebx, r8d lea rdx, [rbx+1] mov rdi, r13 mov esi, 30h ; '0' call _memset add r13, rbx inc r13 loc_76EDC: mov byte ptr [r13+0], 0 mov rax, [rbp+var_EA8] test rax, rax mov rbx, [rbp+var_EB8] jz short loc_76EF7 mov byte ptr [rax], 0 loc_76EF7: lea rax, [rbp+var_E90] cmp r15, rax setnb al lea rcx, [rbp+var_30] cmp rcx, r15 setnbe cl test al, cl jnz short loc_76F1A mov rdi, r15 call _free loc_76F1A: sub r13, rbx loc_76F1D: mov rax, fs:28h cmp rax, [rbp+var_30] jnz short loc_76F41 mov rax, r13 add rsp, 0E98h pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_76F41: call ___stack_chk_fail
_BYTE * my_fcvt(unsigned int a1, _WORD *a2, _BYTE *a3) { unsigned long long v3; // r15 int v4; // r12d long long v5; // r13 int v6; // ebx int v7; // r14d _BYTE *v8; // r13 int v9; // r14d int v10; // r8d int v11; // ebx long long v12; // rcx _BYTE *v13; // rdx int v14; // ebx int v15; // r14d int v16; // ebx long long v17; // rbx _WORD *v18; // rbx long long v20; // [rsp+0h] [rbp-EC0h] BYREF _WORD *v21; // [rsp+8h] [rbp-EB8h] long long v22; // [rsp+10h] [rbp-EB0h] _BYTE *v23; // [rsp+18h] [rbp-EA8h] int v24; // [rsp+24h] [rbp-E9Ch] BYREF int v25; // [rsp+28h] [rbp-E98h] int v26; // [rsp+2Ch] [rbp-E94h] BYREF _BYTE v27[3680]; // [rsp+30h] [rbp-E90h] BYREF _QWORD v28[6]; // [rsp+E90h] [rbp-30h] BYREF v23 = a3; v28[0] = __readfsqword(0x28u); v25 = a1; v3 = dtoa(5LL, a1, &v26, &v24, &v20, v27); v4 = v26; if ( v26 == 9999 ) { if ( (unsigned long long)v28 <= v3 || v3 < (unsigned long long)v27 ) free(v3); *a2 = 48; v5 = 1LL; if ( v23 ) *v23 = 1; } else { v6 = v20; v7 = v20; v8 = a2; if ( v24 ) { v8 = (char *)a2 + 1; *(_BYTE *)a2 = 45; } v21 = a2; v9 = v7 - v3; v10 = v25; if ( v4 <= 0 ) { *(_WORD *)v8 = 11824; if ( v4 < 0 ) { v22 = (unsigned int)~v4; memset(v8 + 2, 48LL, v22 + 1); v10 = v25; v8 += v22 + 3; } else { v8 += 2; } } if ( v9 <= 0 ) { v11 = 1; } else { v11 = v6 - v3 + 1; v12 = 0LL; do { v13 = v8++; *v13 = *(_BYTE *)(v3 + v12); if ( (_DWORD)v12 + 1 == v26 && (int)v12 + 1 < v9 ) { v13[1] = 46; v8 = v13 + 2; } ++v12; } while ( v9 != (_DWORD)v12 ); v4 = v26; } if ( v11 <= v4 ) { v14 = v11 - 1; do { *v8++ = 48; v4 = v26; ++v14; } while ( v14 < v26 ); } if ( v10 > 0 ) { if ( v4 >= v9 ) { *v8++ = 46; v4 = v26; } v15 = v9 - v4; if ( v15 < v10 ) { v16 = 0; if ( v15 > 0 ) v16 = v15; v17 = (unsigned int)(v10 + ~v16); memset(v8, 48LL, v17 + 1); v8 += v17 + 1; } } *v8 = 0; v18 = v21; if ( v23 ) *v23 = 0; if ( (unsigned long long)v28 <= v3 || v3 < (unsigned long long)v27 ) free(v3); return (_BYTE *)(v8 - (_BYTE *)v18); } return (_BYTE *)v5; }
my_fcvt: PUSH RBP MOV RBP,RSP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0xe98 MOV qword ptr [RBP + -0xea8],RDX MOV R14,RSI MOV ESI,EDI MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RBP + -0x30],RAX LEA R13,[RBP + -0xe94] LEA RCX,[RBP + -0xe9c] LEA R8,[RBP + -0xec0] LEA RBX,[RBP + -0xe90] MOV EDI,0x5 MOV dword ptr [RBP + -0xe98],ESI MOV RDX,R13 MOV R9,RBX CALL 0x00176f46 MOV R15,RAX MOV R12D,dword ptr [R13] CMP R12D,0x270f JNZ 0x00176db3 CMP R15,RBX SETNC AL LEA RCX,[RBP + -0x30] CMP RCX,R15 SETA CL TEST AL,CL JNZ 0x00176d8f MOV RDI,R15 CALL 0x00126420 LAB_00176d8f: MOV word ptr [R14],0x30 MOV R13D,0x1 MOV RAX,qword ptr [RBP + -0xea8] TEST RAX,RAX JZ 0x00176f1d MOV byte ptr [RAX],0x1 JMP 0x00176f1d LAB_00176db3: MOV RBX,qword ptr [RBP + -0xec0] MOV RAX,R14 MOV R14D,EBX CMP dword ptr [RBP + -0xe9c],0x0 MOV R13,RAX JZ 0x00176dd3 LEA R13,[RAX + 0x1] MOV byte ptr [RAX],0x2d LAB_00176dd3: MOV qword ptr [RBP + -0xeb8],RAX SUB R14D,R15D TEST R12D,R12D MOV R8D,dword ptr [RBP + -0xe98] JG 0x00176e2d MOV word ptr [R13],0x2e30 LEA RDI,[R13 + 0x2] TEST R12D,R12D JS 0x00176dfe MOV R13,RDI JMP 0x00176e2d LAB_00176dfe: MOV EAX,R12D NOT EAX MOV qword ptr [RBP + -0xeb0],RAX LEA RDX,[RAX + 0x1] MOV ESI,0x30 CALL 0x001261c0 MOV R8D,dword ptr [RBP + -0xe98] MOV RAX,qword ptr [RBP + -0xeb0] ADD R13,RAX ADD R13,0x3 LAB_00176e2d: TEST R14D,R14D JLE 0x00176e74 SUB EBX,R15D INC EBX MOV EAX,R14D XOR ECX,ECX LAB_00176e3c: MOV RDX,R13 LEA ESI,[RCX + 0x1] MOV DIL,byte ptr [R15 + RCX*0x1] INC R13 MOV byte ptr [RDX],DIL CMP ESI,dword ptr [RBP + -0xe94] JNZ 0x00176e64 CMP ESI,R14D JGE 0x00176e64 MOV byte ptr [RDX + 0x1],0x2e ADD RDX,0x2 MOV R13,RDX LAB_00176e64: INC RCX CMP EAX,ECX JNZ 0x00176e3c MOV R12D,dword ptr [RBP + -0xe94] JMP 0x00176e79 LAB_00176e74: MOV EBX,0x1 LAB_00176e79: CMP EBX,R12D JG 0x00176e96 DEC EBX LAB_00176e80: MOV byte ptr [R13],0x30 INC R13 MOV R12D,dword ptr [RBP + -0xe94] INC EBX CMP EBX,R12D JL 0x00176e80 LAB_00176e96: TEST R8D,R8D JLE 0x00176edc CMP R12D,R14D JL 0x00176eaf MOV byte ptr [R13],0x2e INC R13 MOV R12D,dword ptr [RBP + -0xe94] LAB_00176eaf: SUB R14D,R12D CMP R14D,R8D JGE 0x00176edc XOR EBX,EBX TEST R14D,R14D CMOVG EBX,R14D NOT EBX ADD EBX,R8D LEA RDX,[RBX + 0x1] MOV RDI,R13 MOV ESI,0x30 CALL 0x001261c0 ADD R13,RBX INC R13 LAB_00176edc: MOV byte ptr [R13],0x0 MOV RAX,qword ptr [RBP + -0xea8] TEST RAX,RAX MOV RBX,qword ptr [RBP + -0xeb8] JZ 0x00176ef7 MOV byte ptr [RAX],0x0 LAB_00176ef7: LEA RAX,[RBP + -0xe90] CMP R15,RAX SETNC AL LEA RCX,[RBP + -0x30] CMP RCX,R15 SETA CL TEST AL,CL JNZ 0x00176f1a MOV RDI,R15 CALL 0x00126420 LAB_00176f1a: SUB R13,RBX LAB_00176f1d: MOV RAX,qword ptr FS:[0x28] CMP RAX,qword ptr [RBP + -0x30] JNZ 0x00176f41 MOV RAX,R13 ADD RSP,0xe98 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_00176f41: CALL 0x001263b0
long my_fcvt(int param_1,int2 *param_2,int1 *param_3) { long *__ptr; int iVar1; uint uVar2; uint uVar3; long lVar4; int2 *puVar5; int2 *__s; int iVar6; long in_FS_OFFSET; int local_ec8 [2]; int2 *local_ec0; ulong local_eb8; int1 *local_eb0; int local_ea4; int local_ea0; uint local_e9c; long local_e98 [460]; long local_38; local_38 = *(long *)(in_FS_OFFSET + 0x28); local_eb0 = param_3; local_ea0 = param_1; __ptr = (long *)dtoa(5,param_1,&local_e9c,&local_ea4,local_ec8,local_e98); uVar3 = local_e9c; if (local_e9c == 9999) { if (__ptr < local_e98 || &local_38 <= __ptr) { free(__ptr); } *param_2 = 0x30; lVar4 = 1; if (local_eb0 != (int1 *)0x0) { *local_eb0 = 1; } } else { puVar5 = param_2; if (local_ea4 != 0) { puVar5 = (int2 *)((long)param_2 + 1); *(int1 *)param_2 = 0x2d; } iVar6 = local_ec8[0] - (int)__ptr; __s = puVar5; local_ec0 = param_2; if ((int)local_e9c < 1) { *puVar5 = 0x2e30; __s = puVar5 + 1; if ((int)local_e9c < 0) { local_eb8 = (ulong)~local_e9c; memset(__s,0x30,local_eb8 + 1); __s = (int2 *)((long)puVar5 + local_eb8 + 3); } } if (iVar6 < 1) { iVar1 = 1; } else { iVar1 = (local_ec8[0] - (int)__ptr) + 1; lVar4 = 0; puVar5 = __s; do { uVar3 = (int)lVar4 + 1; __s = (int2 *)((long)puVar5 + 1); *(int1 *)puVar5 = *(int1 *)((long)__ptr + lVar4); if ((uVar3 == local_e9c) && ((int)uVar3 < iVar6)) { *(int1 *)((long)puVar5 + 1) = 0x2e; __s = puVar5 + 1; } lVar4 = lVar4 + 1; puVar5 = __s; uVar3 = local_e9c; } while (iVar6 != (int)lVar4); } if (iVar1 <= (int)uVar3) { iVar1 = iVar1 + -1; do { *(int1 *)__s = 0x30; __s = (int2 *)((long)__s + 1); iVar1 = iVar1 + 1; uVar3 = local_e9c; } while (iVar1 < (int)local_e9c); } if (0 < local_ea0) { if (iVar6 <= (int)uVar3) { *(int1 *)__s = 0x2e; __s = (int2 *)((long)__s + 1); uVar3 = local_e9c; } uVar3 = iVar6 - uVar3; if ((int)uVar3 < local_ea0) { uVar2 = 0; if (0 < (int)uVar3) { uVar2 = uVar3; } uVar3 = ~uVar2 + local_ea0; memset(__s,0x30,(ulong)uVar3 + 1); __s = (int2 *)((long)__s + (ulong)uVar3 + 1); } } puVar5 = local_ec0; *(int1 *)__s = 0; if (local_eb0 != (int1 *)0x0) { *local_eb0 = 0; } if (__ptr < local_e98 || &local_38 <= __ptr) { free(__ptr); } lVar4 = (long)__s - (long)puVar5; } if (*(long *)(in_FS_OFFSET + 0x28) != local_38) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return lVar4; }
2,985
format[abi:cxx11](char const*, ...)
monkey531[P]llama/src/llama-impl.cpp
std::string format(const char * fmt, ...) { va_list ap; va_list ap2; va_start(ap, fmt); va_copy(ap2, ap); int size = vsnprintf(NULL, 0, fmt, ap); GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT std::vector<char> buf(size + 1); int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2); GGML_ASSERT(size2 == size); va_end(ap2); va_end(ap); return std::string(buf.data(), size); }
O0
cpp
format[abi:cxx11](char const*, ...): subq $0x178, %rsp # imm = 0x178 movq %rdi, 0x30(%rsp) movq %rdi, %r10 movq %r10, 0x38(%rsp) testb %al, %al je 0x2bcd35 movaps %xmm0, 0x70(%rsp) movaps %xmm1, 0x80(%rsp) movaps %xmm2, 0x90(%rsp) movaps %xmm3, 0xa0(%rsp) movaps %xmm4, 0xb0(%rsp) movaps %xmm5, 0xc0(%rsp) movaps %xmm6, 0xd0(%rsp) movaps %xmm7, 0xe0(%rsp) movq %r9, 0x68(%rsp) movq %r8, 0x60(%rsp) movq %rcx, 0x58(%rsp) movq %rdx, 0x50(%rsp) movq %rdi, 0x170(%rsp) movq %rsi, 0x168(%rsp) leaq 0x150(%rsp), %rax leaq 0x40(%rsp), %rcx movq %rcx, 0x10(%rax) leaq 0x180(%rsp), %rcx movq %rcx, 0x8(%rax) movl $0x30, 0x4(%rax) movl $0x10, (%rax) leaq 0x130(%rsp), %rax leaq 0x150(%rsp), %rcx movq 0x10(%rcx), %rdx movq %rdx, 0x10(%rax) movups (%rcx), %xmm0 movups %xmm0, (%rax) movq 0x168(%rsp), %rdx leaq 0x150(%rsp), %rcx xorl %eax, %eax movl %eax, %esi movq %rsi, %rdi callq 0x21f240 movl %eax, 0x12c(%rsp) cmpl $0x0, 0x12c(%rsp) jl 0x2bcddb cmpl $0x7fffffff, 0x12c(%rsp) # imm = 0x7FFFFFFF jl 0x2bcdfc leaq 0x114e7e(%rip), %rdi # 0x3d1c60 movl $0x58, %esi leaq 0x10f59a(%rip), %rdx # 0x3cc388 leaq 0x114eb8(%rip), %rcx # 0x3d1cad movb $0x0, %al callq 0x217150 movl 0x12c(%rsp), %eax incl %eax cltq movq %rax, 0x20(%rsp) leaq 0x10f(%rsp), %rdi movq %rdi, 0x28(%rsp) callq 0x219930 movq 0x20(%rsp), %rsi movq 0x28(%rsp), %rdx leaq 0x110(%rsp), %rdi callq 0x1fdfd0 jmp 0x2bce37 leaq 0x10f(%rsp), %rdi callq 0x206fb0 leaq 0x110(%rsp), %rdi callq 0x1ee890 movq %rax, %rdi movl 0x12c(%rsp), %eax addl $0x1, %eax movslq %eax, %rsi movq 0x168(%rsp), %rdx leaq 0x130(%rsp), %rcx callq 0x21f240 movl %eax, 0xf8(%rsp) movl 0xf8(%rsp), %eax cmpl 0x12c(%rsp), %eax je 0x2bceef leaq 0x114dcc(%rip), %rdi # 0x3d1c60 leaq 0x10f4ed(%rip), %rdx # 0x3cc388 leaq 0x114e27(%rip), %rcx # 0x3d1cc9 xorl %eax, %eax movl $0x5b, %esi callq 0x217150 jmp 0x2bceb0 movq %rax, %rcx movl %edx, %eax movq %rcx, 0x100(%rsp) movl %eax, 0xfc(%rsp) leaq 0x10f(%rsp), %rdi callq 0x206fb0 jmp 0x2bcf90 movq %rax, %rcx movl %edx, %eax movq %rcx, 0x100(%rsp) movl %eax, 0xfc(%rsp) jmp 0x2bcf83 leaq 0x110(%rsp), %rdi callq 0x1ee890 movq %rax, 0x8(%rsp) movslq 0x12c(%rsp), %rax movq %rax, 0x10(%rsp) leaq 0xf7(%rsp), %rdi movq %rdi, 0x18(%rsp) callq 0x219930 movq 0x30(%rsp), %rdi movq 0x8(%rsp), %rsi movq 0x10(%rsp), %rdx movq 0x18(%rsp), %rcx callq 0x208650 jmp 0x2bcf3b leaq 0xf7(%rsp), %rdi callq 0x206fb0 leaq 0x110(%rsp), %rdi callq 0x1ffa10 movq 0x38(%rsp), %rax addq $0x178, %rsp # imm = 0x178 retq movq %rax, %rcx movl %edx, %eax movq %rcx, 0x100(%rsp) movl %eax, 0xfc(%rsp) leaq 0xf7(%rsp), %rdi callq 0x206fb0 leaq 0x110(%rsp), %rdi callq 0x1ffa10 movq 0x100(%rsp), %rdi callq 0x219750 nopl (%rax)
_Z6formatB5cxx11PKcz: sub rsp, 178h mov [rsp+178h+var_148], rdi mov r10, rdi mov [rsp+178h+var_140], r10 test al, al jz short loc_2BCD35 movaps [rsp+178h+var_108], xmm0 movaps [rsp+178h+var_F8], xmm1 movaps [rsp+178h+var_E8], xmm2 movaps [rsp+178h+var_D8], xmm3 movaps [rsp+178h+var_C8], xmm4 movaps [rsp+178h+var_B8], xmm5 movaps [rsp+178h+var_A8], xmm6 movaps [rsp+178h+var_98], xmm7 loc_2BCD35: mov [rsp+178h+var_110], r9 mov [rsp+178h+var_118], r8 mov [rsp+178h+var_120], rcx mov [rsp+178h+var_128], rdx mov [rsp+178h+var_8], rdi mov [rsp+178h+var_10], rsi lea rax, [rsp+178h+var_28] lea rcx, [rsp+178h+var_138] mov [rax+10h], rcx lea rcx, [rsp+178h+arg_0] mov [rax+8], rcx mov dword ptr [rax+4], 30h ; '0' mov dword ptr [rax], 10h lea rax, [rsp+178h+var_48] lea rcx, [rsp+178h+var_28] mov rdx, [rcx+10h] mov [rax+10h], rdx movups xmm0, xmmword ptr [rcx] movups xmmword ptr [rax], xmm0 mov rdx, [rsp+178h+var_10] lea rcx, [rsp+178h+var_28] xor eax, eax mov esi, eax mov rdi, rsi call vsnprintf mov [rsp+178h+var_4C], eax cmp [rsp+178h+var_4C], 0 jl short loc_2BCDDB cmp [rsp+178h+var_4C], 7FFFFFFFh jl short loc_2BCDFC loc_2BCDDB: lea rdi, aWorkspaceLlm4b_6; "/workspace/llm4binary/github/2025_star3"... mov esi, 58h ; 'X' lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aSize0SizeIntMa; "size >= 0 && size < INT_MAX" mov al, 0 call _ggml_abort loc_2BCDFC: mov eax, [rsp+178h+var_4C] inc eax cdqe mov [rsp+178h+var_158], rax lea rdi, [rsp+178h+var_69] mov [rsp+178h+var_150], rdi call __ZNSaIcEC1Ev; std::allocator<char>::allocator(void) mov rsi, [rsp+178h+var_158] mov rdx, [rsp+178h+var_150] lea rdi, [rsp+178h+var_68] call __ZNSt6vectorIcSaIcEEC2EmRKS0_; std::vector<char>::vector(ulong,std::allocator<char> const&) jmp short $+2 loc_2BCE37: lea rdi, [rsp+178h+var_69] call __ZNSaIcED1Ev; std::allocator<char>::~allocator() lea rdi, [rsp+178h+var_68] call __ZNSt6vectorIcSaIcEE4dataEv; std::vector<char>::data(void) mov rdi, rax mov eax, [rsp+178h+var_4C] add eax, 1 movsxd rsi, eax mov rdx, [rsp+178h+var_10] lea rcx, [rsp+178h+var_48] call vsnprintf mov [rsp+178h+var_80], eax mov eax, [rsp+178h+var_80] cmp eax, [rsp+178h+var_4C] jz short loc_2BCEEF lea rdi, aWorkspaceLlm4b_6; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aSize2Size; "size2 == size" xor eax, eax mov esi, 5Bh ; '[' call _ggml_abort jmp short $+2 loc_2BCEB0: mov rcx, rax mov eax, edx mov [rsp+178h+var_78], rcx mov [rsp+178h+var_7C], eax lea rdi, [rsp+178h+var_69] call __ZNSaIcED1Ev; std::allocator<char>::~allocator() jmp loc_2BCF90 mov rcx, rax mov eax, edx mov [rsp+178h+var_78], rcx mov [rsp+178h+var_7C], eax jmp loc_2BCF83 loc_2BCEEF: lea rdi, [rsp+178h+var_68] call __ZNSt6vectorIcSaIcEE4dataEv; std::vector<char>::data(void) mov [rsp+178h+var_170], rax movsxd rax, [rsp+178h+var_4C] mov [rsp+178h+var_168], rax lea rdi, [rsp+178h+var_81] mov [rsp+178h+var_160], rdi call __ZNSaIcEC1Ev; std::allocator<char>::allocator(void) mov rdi, [rsp+178h+var_148] mov rsi, [rsp+178h+var_170] mov rdx, [rsp+178h+var_168] mov rcx, [rsp+178h+var_160] call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcmRKS3_; std::string::basic_string(char const*,ulong,std::allocator<char> const&) jmp short $+2 loc_2BCF3B: lea rdi, [rsp+178h+var_81] call __ZNSaIcED1Ev; std::allocator<char>::~allocator() lea rdi, [rsp+178h+var_68] call __ZNSt6vectorIcSaIcEED2Ev; std::vector<char>::~vector() mov rax, [rsp+178h+var_140] add rsp, 178h retn mov rcx, rax mov eax, edx mov [rsp+178h+var_78], rcx mov [rsp+178h+var_7C], eax lea rdi, [rsp+178h+var_81] call __ZNSaIcED1Ev; std::allocator<char>::~allocator() loc_2BCF83: lea rdi, [rsp+178h+var_68] call __ZNSt6vectorIcSaIcEED2Ev; std::vector<char>::~vector() loc_2BCF90: mov rdi, [rsp+178h+var_78] call __Unwind_Resume
long long format[abi:cxx11]( long long a1, long long a2, long long a3, long long a4, long long a5, long long a6, __m128 a7, __m128 a8, __m128 a9, __m128 a10, __m128 a11, __m128 a12, __m128 a13, __m128 a14, char a15) { int v15; // ecx int v16; // r8d int v17; // r9d long long v18; // rax int v19; // edx long long v21; // [rsp+8h] [rbp-170h] long long v22; // [rsp+10h] [rbp-168h] unsigned int v23; // [rsp+20h] [rbp-158h] _BYTE v24[16]; // [rsp+40h] [rbp-138h] BYREF long long v25; // [rsp+50h] [rbp-128h] long long v26; // [rsp+58h] [rbp-120h] long long v27; // [rsp+60h] [rbp-118h] long long v28; // [rsp+68h] [rbp-110h] __m128 v29; // [rsp+70h] [rbp-108h] __m128 v30; // [rsp+80h] [rbp-F8h] __m128 v31; // [rsp+90h] [rbp-E8h] __m128 v32; // [rsp+A0h] [rbp-D8h] __m128 v33; // [rsp+B0h] [rbp-C8h] __m128 v34; // [rsp+C0h] [rbp-B8h] __m128 v35; // [rsp+D0h] [rbp-A8h] __m128 v36; // [rsp+E0h] [rbp-98h] char v37; // [rsp+F7h] [rbp-81h] BYREF int v38; // [rsp+F8h] [rbp-80h] int v39; // [rsp+FCh] [rbp-7Ch] long long v40; // [rsp+100h] [rbp-78h] char v41; // [rsp+10Fh] [rbp-69h] BYREF _BYTE v42[28]; // [rsp+110h] [rbp-68h] BYREF unsigned int v43; // [rsp+12Ch] [rbp-4Ch] __int128 v44; // [rsp+130h] [rbp-48h] BYREF _BYTE *v45; // [rsp+140h] [rbp-38h] __int128 v46; // [rsp+150h] [rbp-28h] BYREF _BYTE *v47; // [rsp+160h] [rbp-18h] long long v48; // [rsp+168h] [rbp-10h] long long v49; // [rsp+170h] [rbp-8h] v29 = a7; v30 = a8; v31 = a9; v32 = a10; v33 = a11; v34 = a12; v35 = a13; v36 = a14; v28 = a6; v27 = a5; v26 = a4; v25 = a3; v49 = a1; v48 = a2; v47 = v24; *((_QWORD *)&v46 + 1) = &a15; *(_QWORD *)&v46 = 0x3000000010LL; v45 = v24; v44 = v46; v43 = vsnprintf(0LL, 0LL, a2, &v46); if ( v43 > 0x7FFFFFFE ) ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp", 88LL, "GGML_ASSERT(%s) failed", "size >= 0 && size < INT_MAX"); v23 = v43 + 1; std::allocator<char>::allocator(); std::vector<char>::vector((unsigned int)v42, v23, (unsigned int)&v41, v15, v16, v17); std::allocator<char>::~allocator(&v41); v18 = std::vector<char>::data(v42); v38 = vsnprintf(v18, (int)(v43 + 1), v48, &v44); if ( v38 != v43 ) { v40 = ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp", 91LL, "GGML_ASSERT(%s) failed", "size2 == size"); v39 = v19; std::allocator<char>::~allocator(&v41); _Unwind_Resume(v40); } v21 = std::vector<char>::data(v42); v22 = (int)v43; std::allocator<char>::allocator(); std::string::basic_string(a1, v21, v22, &v37); std::allocator<char>::~allocator(&v37); std::vector<char>::~vector(v42); return a1; }
2,986
format[abi:cxx11](char const*, ...)
monkey531[P]llama/src/llama-impl.cpp
std::string format(const char * fmt, ...) { va_list ap; va_list ap2; va_start(ap, fmt); va_copy(ap2, ap); int size = vsnprintf(NULL, 0, fmt, ap); GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT std::vector<char> buf(size + 1); int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2); GGML_ASSERT(size2 == size); va_end(ap2); va_end(ap); return std::string(buf.data(), size); }
O3
cpp
format[abi:cxx11](char const*, ...): pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x110, %rsp # imm = 0x110 movq %rsi, %r14 movq %rdi, %rbx leaq 0x60(%rsp), %rsi movq %rdx, 0x10(%rsi) movq %rcx, 0x18(%rsi) movq %r8, 0x20(%rsi) movq %r9, 0x28(%rsi) testb %al, %al je 0xa9ef1 movaps %xmm0, 0x90(%rsp) movaps %xmm1, 0xa0(%rsp) movaps %xmm2, 0xb0(%rsp) movaps %xmm3, 0xc0(%rsp) movaps %xmm4, 0xd0(%rsp) movaps %xmm5, 0xe0(%rsp) movaps %xmm6, 0xf0(%rsp) movaps %xmm7, 0x100(%rsp) movabsq $0x3000000010, %rax # imm = 0x3000000010 leaq 0x40(%rsp), %rcx movq %rax, (%rcx) leaq 0x140(%rsp), %rax movq %rax, 0x8(%rcx) movq %rsi, 0x10(%rcx) movq %rsi, 0x30(%rsp) movq (%rcx), %rax movq %rax, 0x20(%rsp) movq 0x8(%rcx), %rax movq %rax, 0x28(%rsp) xorl %edi, %edi xorl %esi, %esi movq %r14, %rdx callq 0x6c418 cmpl $0x7fffffff, %eax # imm = 0x7FFFFFFF jae 0xa9fb6 movl %eax, %r15d leal 0x1(%r15), %r12d leaq 0x8(%rsp), %r13 leaq 0x7(%rsp), %rdx movq %r13, %rdi movq %r12, %rsi callq 0x66d10 movq (%r13), %rdi leaq 0x20(%rsp), %rcx movq %r12, %rsi movq %r14, %rdx callq 0x6c418 cmpl %r15d, %eax jne 0xa9fd7 movq 0x8(%rsp), %rsi movl %r15d, %edx leaq 0x10(%rbx), %rax movq %rax, (%rbx) addq %rsi, %rdx movq %rbx, %rdi callq 0x65680 movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0xa9fa2 movq 0x18(%rsp), %rsi subq %rdi, %rsi callq 0x681a0 movq %rbx, %rax addq $0x110, %rsp # imm = 0x110 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq leaq 0x6bbb3(%rip), %rdi # 0x115b70 leaq 0x66400(%rip), %rdx # 0x1103c4 leaq 0x6bbf2(%rip), %rcx # 0x115bbd movl $0x58, %esi xorl %eax, %eax callq 0x6af70 leaq 0x6bb92(%rip), %rdi # 0x115b70 leaq 0x663df(%rip), %rdx # 0x1103c4 leaq 0x6bbed(%rip), %rcx # 0x115bd9 movl $0x5b, %esi xorl %eax, %eax callq 0x6af70 jmp 0xa9ffa movq %rax, %rbx movq 0x8(%rsp), %rdi testq %rdi, %rdi je 0xaa014 movq 0x18(%rsp), %rsi subq %rdi, %rsi callq 0x681a0 movq %rbx, %rdi callq 0x6b5d0
_Z6formatB5cxx11PKcz: push r15 push r14 push r13 push r12 push rbx sub rsp, 110h mov r14, rsi mov rbx, rdi lea rsi, [rsp+138h+var_D8] mov [rsi+10h], rdx mov [rsi+18h], rcx mov [rsi+20h], r8 mov [rsi+28h], r9 test al, al jz short loc_A9EF1 movaps [rsp+138h+var_A8], xmm0 movaps [rsp+138h+var_98], xmm1 movaps [rsp+138h+var_88], xmm2 movaps [rsp+138h+var_78], xmm3 movaps [rsp+138h+var_68], xmm4 movaps [rsp+138h+var_58], xmm5 movaps [rsp+138h+var_48], xmm6 movaps [rsp+138h+var_38], xmm7 loc_A9EF1: mov rax, 3000000010h lea rcx, [rsp+138h+var_F8] mov [rcx], rax lea rax, [rsp+138h+arg_0] mov [rcx+8], rax mov [rcx+10h], rsi mov [rsp+138h+var_108], rsi mov rax, [rcx] mov [rsp+138h+var_118], rax mov rax, [rcx+8] mov [rsp+138h+var_110], rax xor edi, edi xor esi, esi mov rdx, r14 call vsnprintf cmp eax, 7FFFFFFFh jnb short loc_A9FB6 mov r15d, eax lea r12d, [r15+1] lea r13, [rsp+138h+var_130] lea rdx, [rsp+138h+var_131] mov rdi, r13 mov rsi, r12 call __ZNSt6vectorIcSaIcEEC2EmRKS0_; std::vector<char>::vector(ulong,std::allocator<char> const&) mov rdi, [r13+0] lea rcx, [rsp+138h+var_118] mov rsi, r12 mov rdx, r14 call vsnprintf cmp eax, r15d jnz short loc_A9FD7 mov rsi, [rsp+138h+var_130] mov edx, r15d lea rax, [rbx+10h] mov [rbx], rax add rdx, rsi mov rdi, rbx call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag; std::string::_M_construct<char const*>(char const*,char const*,std::forward_iterator_tag) mov rdi, [rsp+138h+var_130]; void * test rdi, rdi jz short loc_A9FA2 mov rsi, [rsp+138h+var_120] sub rsi, rdi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_A9FA2: mov rax, rbx add rsp, 110h pop rbx pop r12 pop r13 pop r14 pop r15 retn loc_A9FB6: lea rdi, aWorkspaceLlm4b_6; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aSize0SizeIntMa; "size >= 0 && size < INT_MAX" mov esi, 58h ; 'X' xor eax, eax call _ggml_abort loc_A9FD7: lea rdi, aWorkspaceLlm4b_6; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aSize2Size; "size2 == size" mov esi, 5Bh ; '[' xor eax, eax call _ggml_abort jmp short $+2 loc_A9FFA: mov rbx, rax mov rdi, [rsp+138h+var_130]; void * test rdi, rdi jz short loc_AA014 mov rsi, [rsp+138h+var_120] sub rsi, rdi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_AA014: mov rdi, rbx call __Unwind_Resume
_QWORD * format[abi:cxx11]( _QWORD *a1, long long a2, long long a3, long long a4, long long a5, long long a6, __m128 a7, __m128 a8, __m128 a9, __m128 a10, __m128 a11, __m128 a12, __m128 a13, __m128 a14, char a15) { unsigned int v15; // eax unsigned int v16; // r15d long long v17; // r12 long long v18; // r8 long long v19; // r9 char *v20; // rsi long long v22; // rax long long v23; // rbx long long v24; // [rsp+0h] [rbp-138h] BYREF void *v25; // [rsp+8h] [rbp-130h] BYREF long long v26; // [rsp+10h] [rbp-128h] long long v27; // [rsp+18h] [rbp-120h] _QWORD v28[4]; // [rsp+20h] [rbp-118h] BYREF _QWORD v29[4]; // [rsp+40h] [rbp-F8h] BYREF _BYTE v30[16]; // [rsp+60h] [rbp-D8h] BYREF long long v31; // [rsp+70h] [rbp-C8h] long long v32; // [rsp+78h] [rbp-C0h] long long v33; // [rsp+80h] [rbp-B8h] long long v34; // [rsp+88h] [rbp-B0h] __m128 v35; // [rsp+90h] [rbp-A8h] __m128 v36; // [rsp+A0h] [rbp-98h] __m128 v37; // [rsp+B0h] [rbp-88h] __m128 v38; // [rsp+C0h] [rbp-78h] __m128 v39; // [rsp+D0h] [rbp-68h] __m128 v40; // [rsp+E0h] [rbp-58h] __m128 v41; // [rsp+F0h] [rbp-48h] __m128 v42; // [rsp+100h] [rbp-38h] v35 = a7; v36 = a8; v37 = a9; v38 = a10; v39 = a11; v40 = a12; v41 = a13; v42 = a14; v31 = a3; v32 = a4; v33 = a5; v34 = a6; v29[0] = 0x3000000010LL; v29[1] = &a15; v29[2] = v30; v28[2] = v30; v28[0] = 0x3000000010LL; v28[1] = &a15; v15 = vsnprintf(0LL, 0LL, a2, v29, a5, a6, v24, v25, v26); if ( v15 >= 0x7FFFFFFF ) { ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp", 88LL, "GGML_ASSERT(%s) failed", "size >= 0 && size < INT_MAX"); LABEL_7: ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp", 91LL, "GGML_ASSERT(%s) failed", "size2 == size"); v23 = v22; if ( v25 ) operator delete(v25, v27 - (_QWORD)v25); _Unwind_Resume(v23); } v16 = v15; v17 = v15 + 1; std::vector<char>::vector(&v25, v17, (char *)&v24 + 7); if ( (unsigned int)vsnprintf(v25, v17, a2, v28, v18, v19, v24, v25, v26) != v16 ) goto LABEL_7; v20 = (char *)v25; *a1 = a1 + 2; std::string::_M_construct<char const*>(a1, v20, &v20[v16]); if ( v25 ) operator delete(v25, v27 - (_QWORD)v25); return a1; }
format[abi:cxx11]: PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX SUB RSP,0x110 MOV R14,RSI MOV RBX,RDI LEA RSI,[RSP + 0x60] MOV qword ptr [RSI + 0x10],RDX MOV qword ptr [RSI + 0x18],RCX MOV qword ptr [RSI + 0x20],R8 MOV qword ptr [RSI + 0x28],R9 TEST AL,AL JZ 0x001a9ef1 MOVAPS xmmword ptr [RSP + 0x90],XMM0 MOVAPS xmmword ptr [RSP + 0xa0],XMM1 MOVAPS xmmword ptr [RSP + 0xb0],XMM2 MOVAPS xmmword ptr [RSP + 0xc0],XMM3 MOVAPS xmmword ptr [RSP + 0xd0],XMM4 MOVAPS xmmword ptr [RSP + 0xe0],XMM5 MOVAPS xmmword ptr [RSP + 0xf0],XMM6 MOVAPS xmmword ptr [RSP + 0x100],XMM7 LAB_001a9ef1: MOV RAX,0x3000000010 LEA RCX,[RSP + 0x40] MOV qword ptr [RCX],RAX LEA RAX,[RSP + 0x140] MOV qword ptr [RCX + 0x8],RAX MOV qword ptr [RCX + 0x10],RSI MOV qword ptr [RSP + 0x30],RSI MOV RAX,qword ptr [RCX] MOV qword ptr [RSP + 0x20],RAX MOV RAX,qword ptr [RCX + 0x8] MOV qword ptr [RSP + 0x28],RAX XOR EDI,EDI XOR ESI,ESI MOV RDX,R14 CALL 0x0016c418 CMP EAX,0x7fffffff JNC 0x001a9fb6 MOV R15D,EAX LEA R12D,[R15 + 0x1] LEA R13,[RSP + 0x8] LEA RDX,[RSP + 0x7] MOV RDI,R13 MOV RSI,R12 CALL 0x00166d10 MOV RDI,qword ptr [R13] LEA RCX,[RSP + 0x20] MOV RSI,R12 MOV RDX,R14 CALL 0x0016c418 CMP EAX,R15D JNZ 0x001a9fd7 MOV RSI,qword ptr [RSP + 0x8] MOV EDX,R15D LEA RAX,[RBX + 0x10] MOV qword ptr [RBX],RAX ADD RDX,RSI LAB_001a9f83: MOV RDI,RBX CALL 0x00165680 LAB_001a9f8b: MOV RDI,qword ptr [RSP + 0x8] TEST RDI,RDI JZ 0x001a9fa2 MOV RSI,qword ptr [RSP + 0x18] SUB RSI,RDI CALL 0x001681a0 LAB_001a9fa2: MOV RAX,RBX ADD RSP,0x110 POP RBX POP R12 POP R13 POP R14 POP R15 RET LAB_001a9fb6: LEA RDI,[0x215b70] LEA RDX,[0x2103c4] LEA RCX,[0x215bbd] MOV ESI,0x58 XOR EAX,EAX CALL 0x0016af70 LAB_001a9fd7: LEA RDI,[0x215b70] LEA RDX,[0x2103c4] LEA RCX,[0x215bd9] MOV ESI,0x5b XOR EAX,EAX CALL 0x0016af70
/* format[abi:cxx11](char const*, ...) */ char * format_abi_cxx11_(char *param_1,...) { char in_AL; uint uVar1; uint uVar2; int8 in_RCX; int8 in_RDX; char *in_RSI; int8 in_R8; int8 in_R9; int8 in_XMM0_Qa; int8 in_XMM1_Qa; int8 in_XMM2_Qa; int8 in_XMM3_Qa; int8 in_XMM4_Qa; int8 in_XMM5_Qa; int8 in_XMM6_Qa; int8 in_XMM7_Qa; char *local_130 [2]; long local_120; int8 local_118; int1 *local_110; int1 *local_108; int8 local_f8; int1 *local_f0; int1 *local_e8; int1 local_d8 [16]; int8 local_c8; int8 local_c0; int8 local_b8; int8 local_b0; int8 local_a8; int8 local_98; int8 local_88; int8 local_78; int8 local_68; int8 local_58; int8 local_48; int8 local_38; local_108 = local_d8; if (in_AL != '\0') { local_a8 = in_XMM0_Qa; local_98 = in_XMM1_Qa; local_88 = in_XMM2_Qa; local_78 = in_XMM3_Qa; local_68 = in_XMM4_Qa; local_58 = in_XMM5_Qa; local_48 = in_XMM6_Qa; local_38 = in_XMM7_Qa; } local_f8 = 0x3000000010; local_110 = &stack0x00000008; local_118 = 0x3000000010; local_f0 = local_110; local_e8 = local_108; local_c8 = in_RDX; local_c0 = in_RCX; local_b8 = in_R8; local_b0 = in_R9; uVar1 = vsnprintf((char *)0x0,0,in_RSI,&local_f8); if (uVar1 < 0x7fffffff) { std::vector<char,std::allocator<char>>::vector((ulong)local_130,(allocator *)(ulong)(uVar1 + 1)) ; uVar2 = vsnprintf(local_130[0],(size_t)(ulong)(uVar1 + 1),in_RSI,&local_118); if (uVar2 == uVar1) { *(char **)param_1 = param_1 + 0x10; /* try { // try from 001a9f83 to 001a9f8a has its CatchHandler @ 001a9ff8 */ std::__cxx11::string::_M_construct<char_const*>(param_1,local_130[0],local_130[0] + uVar1); if (local_130[0] != (char *)0x0) { operator_delete(local_130[0],local_120 - (long)local_130[0]); } return param_1; } /* try { // try from 001a9fd7 to 001a9ff7 has its CatchHandler @ 001a9ffa */ /* WARNING: Subroutine does not return */ ggml_abort("/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp",0x5b, "GGML_ASSERT(%s) failed","size2 == size"); } /* WARNING: Subroutine does not return */ ggml_abort("/workspace/llm4binary/github/2025_star3/monkey531[P]llama/src/llama-impl.cpp",0x58, "GGML_ASSERT(%s) failed","size >= 0 && size < INT_MAX"); }
2,987
cyclotomic_sqr_fp12
corpus-core[P]colibri-stateless/build_O0/_deps/blst-src/src/fp12_tower.c
static void cyclotomic_sqr_fp12(vec384fp12 ret, const vec384fp12 a) { vec384fp4 t0, t1, t2; sqr_fp4(t0, a[0][0], a[1][1]); sqr_fp4(t1, a[1][0], a[0][2]); sqr_fp4(t2, a[0][1], a[1][2]); sub_fp2(ret[0][0], t0[0], a[0][0]); add_fp2(ret[0][0], ret[0][0], ret[0][0]); add_fp2(ret[0][0], ret[0][0], t0[0]); sub_fp2(ret[0][1], t1[0], a[0][1]); add_fp2(ret[0][1], ret[0][1], ret[0][1]); add_fp2(ret[0][1], ret[0][1], t1[0]); sub_fp2(ret[0][2], t2[0], a[0][2]); add_fp2(ret[0][2], ret[0][2], ret[0][2]); add_fp2(ret[0][2], ret[0][2], t2[0]); mul_by_u_plus_1_fp2(t2[1], t2[1]); add_fp2(ret[1][0], t2[1], a[1][0]); add_fp2(ret[1][0], ret[1][0], ret[1][0]); add_fp2(ret[1][0], ret[1][0], t2[1]); add_fp2(ret[1][1], t0[1], a[1][1]); add_fp2(ret[1][1], ret[1][1], ret[1][1]); add_fp2(ret[1][1], ret[1][1], t0[1]); add_fp2(ret[1][2], t1[1], a[1][2]); add_fp2(ret[1][2], ret[1][2], ret[1][2]); add_fp2(ret[1][2], ret[1][2], t1[1]); }
O0
c
cyclotomic_sqr_fp12: pushq %rbp movq %rsp, %rbp subq $0x250, %rsp # imm = 0x250 movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) leaq -0xd0(%rbp), %rdi movq -0x10(%rbp), %rsi movq -0x10(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0x60, %rdx callq 0xbc5a0 leaq -0x190(%rbp), %rdi movq -0x10(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 movq -0x10(%rbp), %rdx addq $0xc0, %rdx callq 0xbc5a0 leaq -0x250(%rbp), %rdi movq -0x10(%rbp), %rsi addq $0x60, %rsi movq -0x10(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0xc0, %rdx callq 0xbc5a0 movq -0x8(%rbp), %rdi leaq -0xd0(%rbp), %rsi movq -0x10(%rbp), %rdx callq 0xb4ed0 movq -0x8(%rbp), %rdi movq -0x8(%rbp), %rsi movq -0x8(%rbp), %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi movq -0x8(%rbp), %rsi leaq -0xd0(%rbp), %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x60, %rdi leaq -0x190(%rbp), %rsi movq -0x10(%rbp), %rdx addq $0x60, %rdx callq 0xb4ed0 movq -0x8(%rbp), %rdi addq $0x60, %rdi movq -0x8(%rbp), %rsi addq $0x60, %rsi movq -0x8(%rbp), %rdx addq $0x60, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x60, %rdi movq -0x8(%rbp), %rsi addq $0x60, %rsi leaq -0x190(%rbp), %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0xc0, %rdi leaq -0x250(%rbp), %rsi movq -0x10(%rbp), %rdx addq $0xc0, %rdx callq 0xb4ed0 movq -0x8(%rbp), %rdi addq $0xc0, %rdi movq -0x8(%rbp), %rsi addq $0xc0, %rsi movq -0x8(%rbp), %rdx addq $0xc0, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0xc0, %rdi movq -0x8(%rbp), %rsi addq $0xc0, %rsi leaq -0x250(%rbp), %rdx callq 0xb4e60 leaq -0x250(%rbp), %rdi addq $0x60, %rdi leaq -0x250(%rbp), %rsi addq $0x60, %rsi callq 0xbbfe0 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 leaq -0x250(%rbp), %rsi addq $0x60, %rsi movq -0x10(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 movq -0x8(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 leaq -0x250(%rbp), %rdx addq $0x60, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0x60, %rdi leaq -0xd0(%rbp), %rsi addq $0x60, %rsi movq -0x10(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0x60, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0x60, %rdi movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 addq $0x60, %rsi movq -0x8(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0x60, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0x60, %rdi movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 addq $0x60, %rsi leaq -0xd0(%rbp), %rdx addq $0x60, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0xc0, %rdi leaq -0x190(%rbp), %rsi addq $0x60, %rsi movq -0x10(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0xc0, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0xc0, %rdi movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 addq $0xc0, %rsi movq -0x8(%rbp), %rdx addq $0x120, %rdx # imm = 0x120 addq $0xc0, %rdx callq 0xb4e60 movq -0x8(%rbp), %rdi addq $0x120, %rdi # imm = 0x120 addq $0xc0, %rdi movq -0x8(%rbp), %rsi addq $0x120, %rsi # imm = 0x120 addq $0xc0, %rsi leaq -0x190(%rbp), %rdx addq $0x60, %rdx callq 0xb4e60 addq $0x250, %rsp # imm = 0x250 popq %rbp retq nopl (%rax)
cyclotomic_sqr_fp12: push rbp mov rbp, rsp sub rsp, 250h mov [rbp+var_8], rdi mov [rbp+var_10], rsi lea rdi, [rbp+var_D0] mov rsi, [rbp+var_10] mov rdx, [rbp+var_10] add rdx, 120h add rdx, 60h ; '`' call sqr_fp4 lea rdi, [rbp+var_190] mov rsi, [rbp+var_10] add rsi, 120h mov rdx, [rbp+var_10] add rdx, 0C0h call sqr_fp4 lea rdi, [rbp+var_250] mov rsi, [rbp+var_10] add rsi, 60h ; '`' mov rdx, [rbp+var_10] add rdx, 120h add rdx, 0C0h call sqr_fp4 mov rdi, [rbp+var_8] lea rsi, [rbp+var_D0] mov rdx, [rbp+var_10] call _sub_fp2 mov rdi, [rbp+var_8] mov rsi, [rbp+var_8] mov rdx, [rbp+var_8] call add_fp2 mov rdi, [rbp+var_8] mov rsi, [rbp+var_8] lea rdx, [rbp+var_D0] call add_fp2 mov rdi, [rbp+var_8] add rdi, 60h ; '`' lea rsi, [rbp+var_190] mov rdx, [rbp+var_10] add rdx, 60h ; '`' call _sub_fp2 mov rdi, [rbp+var_8] add rdi, 60h ; '`' mov rsi, [rbp+var_8] add rsi, 60h ; '`' mov rdx, [rbp+var_8] add rdx, 60h ; '`' call add_fp2 mov rdi, [rbp+var_8] add rdi, 60h ; '`' mov rsi, [rbp+var_8] add rsi, 60h ; '`' lea rdx, [rbp+var_190] call add_fp2 mov rdi, [rbp+var_8] add rdi, 0C0h lea rsi, [rbp+var_250] mov rdx, [rbp+var_10] add rdx, 0C0h call _sub_fp2 mov rdi, [rbp+var_8] add rdi, 0C0h mov rsi, [rbp+var_8] add rsi, 0C0h mov rdx, [rbp+var_8] add rdx, 0C0h call add_fp2 mov rdi, [rbp+var_8] add rdi, 0C0h mov rsi, [rbp+var_8] add rsi, 0C0h lea rdx, [rbp+var_250] call add_fp2 lea rdi, [rbp+var_250] add rdi, 60h ; '`' lea rsi, [rbp+var_250] add rsi, 60h ; '`' call mul_by_u_plus_1_fp2 mov rdi, [rbp+var_8] add rdi, 120h lea rsi, [rbp+var_250] add rsi, 60h ; '`' mov rdx, [rbp+var_10] add rdx, 120h call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h mov rsi, [rbp+var_8] add rsi, 120h mov rdx, [rbp+var_8] add rdx, 120h call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h mov rsi, [rbp+var_8] add rsi, 120h lea rdx, [rbp+var_250] add rdx, 60h ; '`' call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 60h ; '`' lea rsi, [rbp+var_D0] add rsi, 60h ; '`' mov rdx, [rbp+var_10] add rdx, 120h add rdx, 60h ; '`' call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 60h ; '`' mov rsi, [rbp+var_8] add rsi, 120h add rsi, 60h ; '`' mov rdx, [rbp+var_8] add rdx, 120h add rdx, 60h ; '`' call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 60h ; '`' mov rsi, [rbp+var_8] add rsi, 120h add rsi, 60h ; '`' lea rdx, [rbp+var_D0] add rdx, 60h ; '`' call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 0C0h lea rsi, [rbp+var_190] add rsi, 60h ; '`' mov rdx, [rbp+var_10] add rdx, 120h add rdx, 0C0h call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 0C0h mov rsi, [rbp+var_8] add rsi, 120h add rsi, 0C0h mov rdx, [rbp+var_8] add rdx, 120h add rdx, 0C0h call add_fp2 mov rdi, [rbp+var_8] add rdi, 120h add rdi, 0C0h mov rsi, [rbp+var_8] add rsi, 120h add rsi, 0C0h lea rdx, [rbp+var_190] add rdx, 60h ; '`' call add_fp2 add rsp, 250h pop rbp retn
long long cyclotomic_sqr_fp12(long long a1, long long a2) { _BYTE v3[96]; // [rsp+0h] [rbp-250h] BYREF _BYTE v4[96]; // [rsp+60h] [rbp-1F0h] BYREF _BYTE v5[96]; // [rsp+C0h] [rbp-190h] BYREF _BYTE v6[96]; // [rsp+120h] [rbp-130h] BYREF _BYTE v7[96]; // [rsp+180h] [rbp-D0h] BYREF _BYTE v8[96]; // [rsp+1E0h] [rbp-70h] BYREF long long v9; // [rsp+240h] [rbp-10h] long long v10; // [rsp+248h] [rbp-8h] v10 = a1; v9 = a2; sqr_fp4(v7, a2, a2 + 384); sqr_fp4(v5, v9 + 288, v9 + 192); sqr_fp4(v3, v9 + 96, v9 + 480); sub_fp2(v10, v7, v9); add_fp2(v10, v10, v10); add_fp2(v10, v10, v7); sub_fp2(v10 + 96, v5, v9 + 96); add_fp2(v10 + 96, v10 + 96, v10 + 96); add_fp2(v10 + 96, v10 + 96, v5); sub_fp2(v10 + 192, v3, v9 + 192); add_fp2(v10 + 192, v10 + 192, v10 + 192); add_fp2(v10 + 192, v10 + 192, v3); mul_by_u_plus_1_fp2(v4, v4); add_fp2(v10 + 288, v4, v9 + 288); add_fp2(v10 + 288, v10 + 288, v10 + 288); add_fp2(v10 + 288, v10 + 288, v4); add_fp2(v10 + 384, v8, v9 + 384); add_fp2(v10 + 384, v10 + 384, v10 + 384); add_fp2(v10 + 384, v10 + 384, v8); add_fp2(v10 + 480, v6, v9 + 480); add_fp2(v10 + 480, v10 + 480, v10 + 480); return add_fp2(v10 + 480, v10 + 480, v6); }
cyclotomic_sqr_fp12: PUSH RBP MOV RBP,RSP SUB RSP,0x250 MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI LEA RDI,[RBP + -0xd0] MOV RSI,qword ptr [RBP + -0x10] MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x120 ADD RDX,0x60 CALL 0x001bc5a0 LEA RDI,[RBP + -0x190] MOV RSI,qword ptr [RBP + -0x10] ADD RSI,0x120 MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0xc0 CALL 0x001bc5a0 LEA RDI,[RBP + -0x250] MOV RSI,qword ptr [RBP + -0x10] ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x120 ADD RDX,0xc0 CALL 0x001bc5a0 MOV RDI,qword ptr [RBP + -0x8] LEA RSI,[RBP + -0xd0] MOV RDX,qword ptr [RBP + -0x10] CALL 0x001b4ed0 MOV RDI,qword ptr [RBP + -0x8] MOV RSI,qword ptr [RBP + -0x8] MOV RDX,qword ptr [RBP + -0x8] CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] MOV RSI,qword ptr [RBP + -0x8] LEA RDX,[RBP + -0xd0] CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x60 LEA RSI,[RBP + -0x190] MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x60 CALL 0x001b4ed0 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x60 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x8] ADD RDX,0x60 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x60 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x60 LEA RDX,[RBP + -0x190] CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0xc0 LEA RSI,[RBP + -0x250] MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0xc0 CALL 0x001b4ed0 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0xc0 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0xc0 MOV RDX,qword ptr [RBP + -0x8] ADD RDX,0xc0 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0xc0 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0xc0 LEA RDX,[RBP + -0x250] CALL 0x001b4e60 LEA RDI,[RBP + -0x250] ADD RDI,0x60 LEA RSI,[RBP + -0x250] ADD RSI,0x60 CALL 0x001bbfe0 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 LEA RSI,[RBP + -0x250] ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x120 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 MOV RDX,qword ptr [RBP + -0x8] ADD RDX,0x120 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 LEA RDX,[RBP + -0x250] ADD RDX,0x60 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0x60 LEA RSI,[RBP + -0xd0] ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x120 ADD RDX,0x60 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0x60 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x8] ADD RDX,0x120 ADD RDX,0x60 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0x60 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 ADD RSI,0x60 LEA RDX,[RBP + -0xd0] ADD RDX,0x60 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0xc0 LEA RSI,[RBP + -0x190] ADD RSI,0x60 MOV RDX,qword ptr [RBP + -0x10] ADD RDX,0x120 ADD RDX,0xc0 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0xc0 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 ADD RSI,0xc0 MOV RDX,qword ptr [RBP + -0x8] ADD RDX,0x120 ADD RDX,0xc0 CALL 0x001b4e60 MOV RDI,qword ptr [RBP + -0x8] ADD RDI,0x120 ADD RDI,0xc0 MOV RSI,qword ptr [RBP + -0x8] ADD RSI,0x120 ADD RSI,0xc0 LEA RDX,[RBP + -0x190] ADD RDX,0x60 CALL 0x001b4e60 ADD RSP,0x250 POP RBP RET
void cyclotomic_sqr_fp12(long param_1,long param_2) { int1 local_258 [96]; int1 auStack_1f8 [96]; int1 local_198 [96]; int1 auStack_138 [96]; int1 local_d8 [96]; int1 auStack_78 [96]; long local_18; long local_10; local_18 = param_2; local_10 = param_1; sqr_fp4(local_d8,param_2,param_2 + 0x180); sqr_fp4(local_198,local_18 + 0x120,local_18 + 0xc0); sqr_fp4(local_258,local_18 + 0x60,local_18 + 0x1e0); sub_fp2(local_10,local_d8,local_18); add_fp2(local_10,local_10,local_10); add_fp2(local_10,local_10,local_d8); sub_fp2(local_10 + 0x60,local_198,local_18 + 0x60); add_fp2(local_10 + 0x60,local_10 + 0x60,local_10 + 0x60); add_fp2(local_10 + 0x60,local_10 + 0x60,local_198); sub_fp2(local_10 + 0xc0,local_258,local_18 + 0xc0); add_fp2(local_10 + 0xc0,local_10 + 0xc0,local_10 + 0xc0); add_fp2(local_10 + 0xc0,local_10 + 0xc0,local_258); mul_by_u_plus_1_fp2(auStack_1f8,auStack_1f8); add_fp2(local_10 + 0x120,auStack_1f8,local_18 + 0x120); add_fp2(local_10 + 0x120,local_10 + 0x120,local_10 + 0x120); add_fp2(local_10 + 0x120,local_10 + 0x120,auStack_1f8); add_fp2(local_10 + 0x180,auStack_78,local_18 + 0x180); add_fp2(local_10 + 0x180,local_10 + 0x180,local_10 + 0x180); add_fp2(local_10 + 0x180,local_10 + 0x180,auStack_78); add_fp2(local_10 + 0x1e0,auStack_138,local_18 + 0x1e0); add_fp2(local_10 + 0x1e0,local_10 + 0x1e0,local_10 + 0x1e0); add_fp2(local_10 + 0x1e0,local_10 + 0x1e0,auStack_138); return; }
2,988
nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)
monkey531[P]llama/common/json.hpp
inline cached_power get_cached_power_for_binary_exponent(int e) { // Now // // alpha <= e_c + e + q <= gamma (1) // ==> f_c * 2^alpha <= c * 2^e * 2^q // // and since the c's are normalized, 2^(q-1) <= f_c, // // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) // ==> 2^(alpha - e - 1) <= c // // If c were an exact power of ten, i.e. c = 10^k, one may determine k as // // k = ceil( log_10( 2^(alpha - e - 1) ) ) // = ceil( (alpha - e - 1) * log_10(2) ) // // From the paper: // "In theory the result of the procedure could be wrong since c is rounded, // and the computation itself is approximated [...]. In practice, however, // this simple function is sufficient." // // For IEEE double precision floating-point numbers converted into // normalized diyfp's w = f * 2^e, with q = 64, // // e >= -1022 (min IEEE exponent) // -52 (p - 1) // -52 (p - 1, possibly normalize denormal IEEE numbers) // -11 (normalize the diyfp) // = -1137 // // and // // e <= +1023 (max IEEE exponent) // -52 (p - 1) // -11 (normalize the diyfp) // = 960 // // This binary exponent range [-1137,960] results in a decimal exponent // range [-307,324]. One does not need to store a cached power for each // k in this range. For each such k it suffices to find a cached power // such that the exponent of the product lies in [alpha,gamma]. // This implies that the difference of the decimal exponents of adjacent // table entries must be less than or equal to // // floor( (gamma - alpha) * log_10(2) ) = 8. // // (A smaller distance gamma-alpha would require a larger table.) // NB: // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. constexpr int kCachedPowersMinDecExp = -300; constexpr int kCachedPowersDecStep = 8; static constexpr std::array<cached_power, 79> kCachedPowers = { { { 0xAB70FE17C79AC6CA, -1060, -300 }, { 0xFF77B1FCBEBCDC4F, -1034, -292 }, { 0xBE5691EF416BD60C, -1007, -284 }, { 0x8DD01FAD907FFC3C, -980, -276 }, { 0xD3515C2831559A83, -954, -268 }, { 0x9D71AC8FADA6C9B5, -927, -260 }, { 0xEA9C227723EE8BCB, -901, -252 }, { 0xAECC49914078536D, -874, -244 }, { 0x823C12795DB6CE57, -847, -236 }, { 0xC21094364DFB5637, -821, -228 }, { 0x9096EA6F3848984F, -794, -220 }, { 0xD77485CB25823AC7, -768, -212 }, { 0xA086CFCD97BF97F4, -741, -204 }, { 0xEF340A98172AACE5, -715, -196 }, { 0xB23867FB2A35B28E, -688, -188 }, { 0x84C8D4DFD2C63F3B, -661, -180 }, { 0xC5DD44271AD3CDBA, -635, -172 }, { 0x936B9FCEBB25C996, -608, -164 }, { 0xDBAC6C247D62A584, -582, -156 }, { 0xA3AB66580D5FDAF6, -555, -148 }, { 0xF3E2F893DEC3F126, -529, -140 }, { 0xB5B5ADA8AAFF80B8, -502, -132 }, { 0x87625F056C7C4A8B, -475, -124 }, { 0xC9BCFF6034C13053, -449, -116 }, { 0x964E858C91BA2655, -422, -108 }, { 0xDFF9772470297EBD, -396, -100 }, { 0xA6DFBD9FB8E5B88F, -369, -92 }, { 0xF8A95FCF88747D94, -343, -84 }, { 0xB94470938FA89BCF, -316, -76 }, { 0x8A08F0F8BF0F156B, -289, -68 }, { 0xCDB02555653131B6, -263, -60 }, { 0x993FE2C6D07B7FAC, -236, -52 }, { 0xE45C10C42A2B3B06, -210, -44 }, { 0xAA242499697392D3, -183, -36 }, { 0xFD87B5F28300CA0E, -157, -28 }, { 0xBCE5086492111AEB, -130, -20 }, { 0x8CBCCC096F5088CC, -103, -12 }, { 0xD1B71758E219652C, -77, -4 }, { 0x9C40000000000000, -50, 4 }, { 0xE8D4A51000000000, -24, 12 }, { 0xAD78EBC5AC620000, 3, 20 }, { 0x813F3978F8940984, 30, 28 }, { 0xC097CE7BC90715B3, 56, 36 }, { 0x8F7E32CE7BEA5C70, 83, 44 }, { 0xD5D238A4ABE98068, 109, 52 }, { 0x9F4F2726179A2245, 136, 60 }, { 0xED63A231D4C4FB27, 162, 68 }, { 0xB0DE65388CC8ADA8, 189, 76 }, { 0x83C7088E1AAB65DB, 216, 84 }, { 0xC45D1DF942711D9A, 242, 92 }, { 0x924D692CA61BE758, 269, 100 }, { 0xDA01EE641A708DEA, 295, 108 }, { 0xA26DA3999AEF774A, 322, 116 }, { 0xF209787BB47D6B85, 348, 124 }, { 0xB454E4A179DD1877, 375, 132 }, { 0x865B86925B9BC5C2, 402, 140 }, { 0xC83553C5C8965D3D, 428, 148 }, { 0x952AB45CFA97A0B3, 455, 156 }, { 0xDE469FBD99A05FE3, 481, 164 }, { 0xA59BC234DB398C25, 508, 172 }, { 0xF6C69A72A3989F5C, 534, 180 }, { 0xB7DCBF5354E9BECE, 561, 188 }, { 0x88FCF317F22241E2, 588, 196 }, { 0xCC20CE9BD35C78A5, 614, 204 }, { 0x98165AF37B2153DF, 641, 212 }, { 0xE2A0B5DC971F303A, 667, 220 }, { 0xA8D9D1535CE3B396, 694, 228 }, { 0xFB9B7CD9A4A7443C, 720, 236 }, { 0xBB764C4CA7A44410, 747, 244 }, { 0x8BAB8EEFB6409C1A, 774, 252 }, { 0xD01FEF10A657842C, 800, 260 }, { 0x9B10A4E5E9913129, 827, 268 }, { 0xE7109BFBA19C0C9D, 853, 276 }, { 0xAC2820D9623BF429, 880, 284 }, { 0x80444B5E7AA7CF85, 907, 292 }, { 0xBF21E44003ACDD2D, 933, 300 }, { 0x8E679C2F5E44FF8F, 960, 308 }, { 0xD433179D9C8CB841, 986, 316 }, { 0x9E19DB92B4E31BA9, 1013, 324 }, } }; // This computation gives exactly the same results for k as // k = ceil((kAlpha - e - 1) * 0.30102999566398114) // for |e| <= 1500, but doesn't require floating-point operations. // NB: log_10(2) ~= 78913 / 2^18 JSON_ASSERT(e >= -1500); JSON_ASSERT(e <= 1500); const int f = kAlpha - e - 1; const int k = (f * 78913) / (1 << 18) + static_cast<int>(f > 0); const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep; JSON_ASSERT(index >= 0); JSON_ASSERT(static_cast<std::size_t>(index) < kCachedPowers.size()); const cached_power cached = kCachedPowers[static_cast<std::size_t>(index)]; JSON_ASSERT(kAlpha <= cached.e + e + 64); JSON_ASSERT(kGamma >= cached.e + e + 64); return cached; }
O1
cpp
nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int): pushq %rax cmpl $0xfffffa23, %edi # imm = 0xFFFFFA23 jle 0xb8c37 cmpl $0x5dd, %edi # imm = 0x5DD jge 0xb8c56 movl $0xffffffc3, %ecx # imm = 0xFFFFFFC3 subl %edi, %ecx imull $0x13441, %ecx, %eax # imm = 0x13441 leal 0x3ffff(%rax), %edx testl %eax, %eax cmovnsl %eax, %edx sarl $0x12, %edx xorl %eax, %eax testl %ecx, %ecx setg %al addl %edx, %eax cmpl $0xfffffec5, %eax # imm = 0xFFFFFEC5 jle 0xb8c72 leal 0x133(%rax), %ecx addl $0x13a, %eax # imm = 0x13A testl %ecx, %ecx cmovnsl %ecx, %eax sarl $0x3, %eax cmpl $0x4f, %eax jae 0xb8c8e movl %eax, %eax shlq $0x4, %rax leaq 0x3ced0(%rip), %rcx # 0xf5ae8 movq 0x8(%rcx,%rax), %rdx addl %edx, %edi cmpl $-0x7d, %edi jle 0xb8caa cmpl $-0x5f, %edi jge 0xb8cc6 movq (%rcx,%rax), %rax popq %rcx retq leaq 0x351b5(%rip), %rdi # 0xeddf3 leaq 0x351f8(%rip), %rdx # 0xede3d leaq 0x3a8fc(%rip), %rcx # 0xf3548 movl $0x43e4, %esi # imm = 0x43E4 jmp 0xb8ce0 leaq 0x35196(%rip), %rdi # 0xeddf3 leaq 0x351d9(%rip), %rdx # 0xede3d leaq 0x3a8e8(%rip), %rcx # 0xf3553 movl $0x43e5, %esi # imm = 0x43E5 jmp 0xb8ce0 leaq 0x3517a(%rip), %rdi # 0xeddf3 leaq 0x351bd(%rip), %rdx # 0xede3d leaq 0x3a8d6(%rip), %rcx # 0xf355d movl $0x43ea, %esi # imm = 0x43EA jmp 0xb8ce0 leaq 0x3515e(%rip), %rdi # 0xeddf3 leaq 0x351a1(%rip), %rdx # 0xede3d leaq 0x3a8c5(%rip), %rcx # 0xf3568 movl $0x43eb, %esi # imm = 0x43EB jmp 0xb8ce0 leaq 0x35142(%rip), %rdi # 0xeddf3 leaq 0x35185(%rip), %rdx # 0xede3d leaq 0x3a8e0(%rip), %rcx # 0xf359f movl $0x43ee, %esi # imm = 0x43EE jmp 0xb8ce0 leaq 0x35126(%rip), %rdi # 0xeddf3 leaq 0x35169(%rip), %rdx # 0xede3d leaq 0x3a8e0(%rip), %rcx # 0xf35bb movl $0x43ef, %esi # imm = 0x43EF xorl %eax, %eax callq 0x1beb0 nop
_ZN8nlohmann16json_abi_v3_11_36detail9dtoa_impl36get_cached_power_for_binary_exponentEi: push rax cmp edi, 0FFFFFA23h jle loc_B8C37 cmp edi, 5DDh jge loc_B8C56 mov ecx, 0FFFFFFC3h sub ecx, edi imul eax, ecx, 13441h lea edx, [rax+3FFFFh] test eax, eax cmovns edx, eax sar edx, 12h xor eax, eax test ecx, ecx setnle al add eax, edx cmp eax, 0FFFFFEC5h jle loc_B8C72 lea ecx, [rax+133h] add eax, 13Ah test ecx, ecx cmovns eax, ecx sar eax, 3 cmp eax, 4Fh ; 'O' jnb loc_B8C8E mov eax, eax shl rax, 4 lea rcx, _ZZN8nlohmann16json_abi_v3_11_36detail9dtoa_impl36get_cached_power_for_binary_exponentEiE13kCachedPowers; nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers mov rdx, [rcx+rax+8] add edi, edx cmp edi, 0FFFFFF83h jle loc_B8CAA cmp edi, 0FFFFFFA1h jge loc_B8CC6 mov rax, [rcx+rax] pop rcx retn loc_B8C37: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aE1500; "e >= -1500" mov esi, 43E4h jmp loc_B8CE0 loc_B8C56: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aE1500_0; "e <= 1500" mov esi, 43E5h jmp short loc_B8CE0 loc_B8C72: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aIndex0; "index >= 0" mov esi, 43EAh jmp short loc_B8CE0 loc_B8C8E: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aStaticCastStdS; "static_cast<std::size_t>(index) < kCach"... mov esi, 43EBh jmp short loc_B8CE0 loc_B8CAA: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aKalphaCachedEE; "kAlpha <= cached.e + e + 64" mov esi, 43EEh jmp short loc_B8CE0 loc_B8CC6: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aKgammaCachedEE; "kGamma >= cached.e + e + 64" mov esi, 43EFh loc_B8CE0: xor eax, eax call _ggml_abort nop
long long nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent( nlohmann::json_abi_v3_11_3::detail::dtoa_impl *this) { int v1; // eax int v2; // ecx int v3; // eax unsigned int v4; // eax long long v5; // rax int v6; // edi long long v8; // rsi if ( (int)this <= -1501 ) { v8 = 17380LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17380LL, "GGML_ASSERT(%s) failed", "e >= -1500"); } else if ( (int)this >= 1501 ) { v8 = 17381LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17381LL, "GGML_ASSERT(%s) failed", "e <= 1500"); } else { v1 = 78913 * (-61 - (int)this) / 0x40000 + (-61 - (int)this > 0); if ( v1 <= -315 ) { v8 = 17386LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17386LL, "GGML_ASSERT(%s) failed", "index >= 0"); } else { v2 = v1 + 307; v3 = v1 + 314; if ( v2 >= 0 ) v3 = v2; v4 = v3 >> 3; if ( v4 >= 0x4F ) { v8 = 17387LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17387LL, "GGML_ASSERT(%s) failed", "static_cast<std::size_t>(index) < kCachedPowers.size()"); } else { v5 = 16LL * v4; v6 = *(_QWORD *)((char *)&nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers + v5 + 8) + (_DWORD)this; if ( v6 <= -125 ) { v8 = 17390LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17390LL, "GGML_ASSERT(%s) failed", "kAlpha <= cached.e + e + 64"); } else { if ( v6 < -95 ) return *(_QWORD *)((char *)&nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers + v5); v8 = 17391LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17391LL, "GGML_ASSERT(%s) failed", "kGamma >= cached.e + e + 64"); } } } } return nlohmann::json_abi_v3_11_3::detail::dtoa_impl::diyfp::mul( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", v8); }
get_cached_power_for_binary_exponent: PUSH RAX CMP EDI,0xfffffa23 JLE 0x001b8c37 CMP EDI,0x5dd JGE 0x001b8c56 MOV ECX,0xffffffc3 SUB ECX,EDI IMUL EAX,ECX,0x13441 LEA EDX,[RAX + 0x3ffff] TEST EAX,EAX CMOVNS EDX,EAX SAR EDX,0x12 XOR EAX,EAX TEST ECX,ECX SETG AL ADD EAX,EDX CMP EAX,0xfffffec5 JLE 0x001b8c72 LEA ECX,[RAX + 0x133] ADD EAX,0x13a TEST ECX,ECX CMOVNS EAX,ECX SAR EAX,0x3 CMP EAX,0x4f JNC 0x001b8c8e MOV EAX,EAX SHL RAX,0x4 LEA RCX,[0x1f5ae8] MOV RDX,qword ptr [RCX + RAX*0x1 + 0x8] ADD EDI,EDX CMP EDI,-0x7d JLE 0x001b8caa CMP EDI,-0x5f JGE 0x001b8cc6 MOV RAX,qword ptr [RCX + RAX*0x1] POP RCX RET LAB_001b8c37: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f3548] MOV ESI,0x43e4 JMP 0x001b8ce0 LAB_001b8c56: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f3553] MOV ESI,0x43e5 JMP 0x001b8ce0 LAB_001b8c72: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f355d] MOV ESI,0x43ea JMP 0x001b8ce0 LAB_001b8c8e: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f3568] MOV ESI,0x43eb JMP 0x001b8ce0 LAB_001b8caa: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f359f] MOV ESI,0x43ee JMP 0x001b8ce0 LAB_001b8cc6: LEA RDI,[0x1eddf3] LEA RDX,[0x1ede3d] LEA RCX,[0x1f35bb] MOV ESI,0x43ef LAB_001b8ce0: XOR EAX,EAX CALL 0x0011beb0
/* nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int) */ int8 nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int param_1) { int iVar1; int iVar2; long lVar3; char *pcVar4; int8 uVar5; if (param_1 < -0x5dc) { pcVar4 = "e >= -1500"; uVar5 = 0x43e4; } else if (param_1 < 0x5dd) { iVar1 = (-0x3d - param_1) * 0x13441; iVar2 = iVar1 + 0x3ffff; if (-1 < iVar1) { iVar2 = iVar1; } iVar2 = (uint)(0 < -0x3d - param_1) + (iVar2 >> 0x12); if (iVar2 < -0x13a) { pcVar4 = "index >= 0"; uVar5 = 0x43ea; } else { iVar1 = iVar2 + 0x13a; if (-1 < iVar2 + 0x133) { iVar1 = iVar2 + 0x133; } if ((uint)(iVar1 >> 3) < 0x4f) { lVar3 = (ulong)(uint)(iVar1 >> 3) * 0x10; iVar2 = param_1 + (int)*(int8 *) (get_cached_power_for_binary_exponent(int)::kCachedPowers + lVar3 + 8); if (iVar2 < -0x7c) { pcVar4 = "kAlpha <= cached.e + e + 64"; uVar5 = 0x43ee; } else { if (iVar2 < -0x5f) { return *(int8 *)(get_cached_power_for_binary_exponent(int)::kCachedPowers + lVar3) ; } pcVar4 = "kGamma >= cached.e + e + 64"; uVar5 = 0x43ef; } } else { pcVar4 = "static_cast<std::size_t>(index) < kCachedPowers.size()"; uVar5 = 0x43eb; } } } else { pcVar4 = "e <= 1500"; uVar5 = 0x43e5; } /* WARNING: Subroutine does not return */ ggml_abort("/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp",uVar5, "GGML_ASSERT(%s) failed",pcVar4); }
2,989
nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)
monkey531[P]llama/common/json.hpp
inline cached_power get_cached_power_for_binary_exponent(int e) { // Now // // alpha <= e_c + e + q <= gamma (1) // ==> f_c * 2^alpha <= c * 2^e * 2^q // // and since the c's are normalized, 2^(q-1) <= f_c, // // ==> 2^(q - 1 + alpha) <= c * 2^(e + q) // ==> 2^(alpha - e - 1) <= c // // If c were an exact power of ten, i.e. c = 10^k, one may determine k as // // k = ceil( log_10( 2^(alpha - e - 1) ) ) // = ceil( (alpha - e - 1) * log_10(2) ) // // From the paper: // "In theory the result of the procedure could be wrong since c is rounded, // and the computation itself is approximated [...]. In practice, however, // this simple function is sufficient." // // For IEEE double precision floating-point numbers converted into // normalized diyfp's w = f * 2^e, with q = 64, // // e >= -1022 (min IEEE exponent) // -52 (p - 1) // -52 (p - 1, possibly normalize denormal IEEE numbers) // -11 (normalize the diyfp) // = -1137 // // and // // e <= +1023 (max IEEE exponent) // -52 (p - 1) // -11 (normalize the diyfp) // = 960 // // This binary exponent range [-1137,960] results in a decimal exponent // range [-307,324]. One does not need to store a cached power for each // k in this range. For each such k it suffices to find a cached power // such that the exponent of the product lies in [alpha,gamma]. // This implies that the difference of the decimal exponents of adjacent // table entries must be less than or equal to // // floor( (gamma - alpha) * log_10(2) ) = 8. // // (A smaller distance gamma-alpha would require a larger table.) // NB: // Actually this function returns c, such that -60 <= e_c + e + 64 <= -34. constexpr int kCachedPowersMinDecExp = -300; constexpr int kCachedPowersDecStep = 8; static constexpr std::array<cached_power, 79> kCachedPowers = { { { 0xAB70FE17C79AC6CA, -1060, -300 }, { 0xFF77B1FCBEBCDC4F, -1034, -292 }, { 0xBE5691EF416BD60C, -1007, -284 }, { 0x8DD01FAD907FFC3C, -980, -276 }, { 0xD3515C2831559A83, -954, -268 }, { 0x9D71AC8FADA6C9B5, -927, -260 }, { 0xEA9C227723EE8BCB, -901, -252 }, { 0xAECC49914078536D, -874, -244 }, { 0x823C12795DB6CE57, -847, -236 }, { 0xC21094364DFB5637, -821, -228 }, { 0x9096EA6F3848984F, -794, -220 }, { 0xD77485CB25823AC7, -768, -212 }, { 0xA086CFCD97BF97F4, -741, -204 }, { 0xEF340A98172AACE5, -715, -196 }, { 0xB23867FB2A35B28E, -688, -188 }, { 0x84C8D4DFD2C63F3B, -661, -180 }, { 0xC5DD44271AD3CDBA, -635, -172 }, { 0x936B9FCEBB25C996, -608, -164 }, { 0xDBAC6C247D62A584, -582, -156 }, { 0xA3AB66580D5FDAF6, -555, -148 }, { 0xF3E2F893DEC3F126, -529, -140 }, { 0xB5B5ADA8AAFF80B8, -502, -132 }, { 0x87625F056C7C4A8B, -475, -124 }, { 0xC9BCFF6034C13053, -449, -116 }, { 0x964E858C91BA2655, -422, -108 }, { 0xDFF9772470297EBD, -396, -100 }, { 0xA6DFBD9FB8E5B88F, -369, -92 }, { 0xF8A95FCF88747D94, -343, -84 }, { 0xB94470938FA89BCF, -316, -76 }, { 0x8A08F0F8BF0F156B, -289, -68 }, { 0xCDB02555653131B6, -263, -60 }, { 0x993FE2C6D07B7FAC, -236, -52 }, { 0xE45C10C42A2B3B06, -210, -44 }, { 0xAA242499697392D3, -183, -36 }, { 0xFD87B5F28300CA0E, -157, -28 }, { 0xBCE5086492111AEB, -130, -20 }, { 0x8CBCCC096F5088CC, -103, -12 }, { 0xD1B71758E219652C, -77, -4 }, { 0x9C40000000000000, -50, 4 }, { 0xE8D4A51000000000, -24, 12 }, { 0xAD78EBC5AC620000, 3, 20 }, { 0x813F3978F8940984, 30, 28 }, { 0xC097CE7BC90715B3, 56, 36 }, { 0x8F7E32CE7BEA5C70, 83, 44 }, { 0xD5D238A4ABE98068, 109, 52 }, { 0x9F4F2726179A2245, 136, 60 }, { 0xED63A231D4C4FB27, 162, 68 }, { 0xB0DE65388CC8ADA8, 189, 76 }, { 0x83C7088E1AAB65DB, 216, 84 }, { 0xC45D1DF942711D9A, 242, 92 }, { 0x924D692CA61BE758, 269, 100 }, { 0xDA01EE641A708DEA, 295, 108 }, { 0xA26DA3999AEF774A, 322, 116 }, { 0xF209787BB47D6B85, 348, 124 }, { 0xB454E4A179DD1877, 375, 132 }, { 0x865B86925B9BC5C2, 402, 140 }, { 0xC83553C5C8965D3D, 428, 148 }, { 0x952AB45CFA97A0B3, 455, 156 }, { 0xDE469FBD99A05FE3, 481, 164 }, { 0xA59BC234DB398C25, 508, 172 }, { 0xF6C69A72A3989F5C, 534, 180 }, { 0xB7DCBF5354E9BECE, 561, 188 }, { 0x88FCF317F22241E2, 588, 196 }, { 0xCC20CE9BD35C78A5, 614, 204 }, { 0x98165AF37B2153DF, 641, 212 }, { 0xE2A0B5DC971F303A, 667, 220 }, { 0xA8D9D1535CE3B396, 694, 228 }, { 0xFB9B7CD9A4A7443C, 720, 236 }, { 0xBB764C4CA7A44410, 747, 244 }, { 0x8BAB8EEFB6409C1A, 774, 252 }, { 0xD01FEF10A657842C, 800, 260 }, { 0x9B10A4E5E9913129, 827, 268 }, { 0xE7109BFBA19C0C9D, 853, 276 }, { 0xAC2820D9623BF429, 880, 284 }, { 0x80444B5E7AA7CF85, 907, 292 }, { 0xBF21E44003ACDD2D, 933, 300 }, { 0x8E679C2F5E44FF8F, 960, 308 }, { 0xD433179D9C8CB841, 986, 316 }, { 0x9E19DB92B4E31BA9, 1013, 324 }, } }; // This computation gives exactly the same results for k as // k = ceil((kAlpha - e - 1) * 0.30102999566398114) // for |e| <= 1500, but doesn't require floating-point operations. // NB: log_10(2) ~= 78913 / 2^18 JSON_ASSERT(e >= -1500); JSON_ASSERT(e <= 1500); const int f = kAlpha - e - 1; const int k = (f * 78913) / (1 << 18) + static_cast<int>(f > 0); const int index = (-kCachedPowersMinDecExp + k + (kCachedPowersDecStep - 1)) / kCachedPowersDecStep; JSON_ASSERT(index >= 0); JSON_ASSERT(static_cast<std::size_t>(index) < kCachedPowers.size()); const cached_power cached = kCachedPowers[static_cast<std::size_t>(index)]; JSON_ASSERT(kAlpha <= cached.e + e + 64); JSON_ASSERT(kGamma >= cached.e + e + 64); return cached; }
O3
cpp
nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int): pushq %rax cmpl $0xfffffa23, %edi # imm = 0xFFFFFA23 jle 0xb7482 cmpl $0x5dd, %edi # imm = 0x5DD jge 0xb74a1 xorl %eax, %eax movl %edi, %ecx subl $-0x3d, %ecx setl %al negl %ecx imull $0x13441, %ecx, %ecx # imm = 0x13441 leal 0x3ffff(%rcx), %edx testl %ecx, %ecx cmovnsl %ecx, %edx sarl $0x12, %edx addl %edx, %eax cmpl $0xfffffec5, %eax # imm = 0xFFFFFEC5 jle 0xb74bd leal 0x133(%rax), %ecx addl $0x13a, %eax # imm = 0x13A testw %cx, %cx cmovnsl %ecx, %eax cwtl shrl $0x3, %eax cmpw $0x4f, %ax jae 0xb74d9 movzwl %ax, %eax shll $0x4, %eax leaq 0x3b675(%rip), %rcx # 0xf2ad8 movq 0x8(%rcx,%rax), %rdx addl %edx, %edi cmpl $-0x7d, %edi jle 0xb74f5 cmpl $-0x5f, %edi jge 0xb7511 movq (%rcx,%rax), %rax popq %rcx retq leaq 0x3396a(%rip), %rdi # 0xeadf3 leaq 0x339ad(%rip), %rdx # 0xeae3d leaq 0x390a1(%rip), %rcx # 0xf0538 movl $0x43e4, %esi # imm = 0x43E4 jmp 0xb752b leaq 0x3394b(%rip), %rdi # 0xeadf3 leaq 0x3398e(%rip), %rdx # 0xeae3d leaq 0x3908d(%rip), %rcx # 0xf0543 movl $0x43e5, %esi # imm = 0x43E5 jmp 0xb752b leaq 0x3392f(%rip), %rdi # 0xeadf3 leaq 0x33972(%rip), %rdx # 0xeae3d leaq 0x3907b(%rip), %rcx # 0xf054d movl $0x43ea, %esi # imm = 0x43EA jmp 0xb752b leaq 0x33913(%rip), %rdi # 0xeadf3 leaq 0x33956(%rip), %rdx # 0xeae3d leaq 0x3906a(%rip), %rcx # 0xf0558 movl $0x43eb, %esi # imm = 0x43EB jmp 0xb752b leaq 0x338f7(%rip), %rdi # 0xeadf3 leaq 0x3393a(%rip), %rdx # 0xeae3d leaq 0x39085(%rip), %rcx # 0xf058f movl $0x43ee, %esi # imm = 0x43EE jmp 0xb752b leaq 0x338db(%rip), %rdi # 0xeadf3 leaq 0x3391e(%rip), %rdx # 0xeae3d leaq 0x39085(%rip), %rcx # 0xf05ab movl $0x43ef, %esi # imm = 0x43EF xorl %eax, %eax callq 0x1aeb0
_ZN8nlohmann16json_abi_v3_11_36detail9dtoa_impl36get_cached_power_for_binary_exponentEi: push rax cmp edi, 0FFFFFA23h jle loc_B7482 cmp edi, 5DDh jge loc_B74A1 xor eax, eax mov ecx, edi sub ecx, 0FFFFFFC3h setl al neg ecx imul ecx, 13441h lea edx, [rcx+3FFFFh] test ecx, ecx cmovns edx, ecx sar edx, 12h add eax, edx cmp eax, 0FFFFFEC5h jle loc_B74BD lea ecx, [rax+133h] add eax, 13Ah test cx, cx cmovns eax, ecx cwde shr eax, 3 cmp ax, 4Fh ; 'O' jnb loc_B74D9 movzx eax, ax shl eax, 4 lea rcx, _ZZN8nlohmann16json_abi_v3_11_36detail9dtoa_impl36get_cached_power_for_binary_exponentEiE13kCachedPowers; nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers mov rdx, [rcx+rax+8] add edi, edx cmp edi, 0FFFFFF83h jle loc_B74F5 cmp edi, 0FFFFFFA1h jge loc_B7511 mov rax, [rcx+rax] pop rcx retn loc_B7482: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aE1500; "e >= -1500" mov esi, 43E4h jmp loc_B752B loc_B74A1: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aE1500_0; "e <= 1500" mov esi, 43E5h jmp short loc_B752B loc_B74BD: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aIndex0; "index >= 0" mov esi, 43EAh jmp short loc_B752B loc_B74D9: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aStaticCastStdS; "static_cast<std::size_t>(index) < kCach"... mov esi, 43EBh jmp short loc_B752B loc_B74F5: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aKalphaCachedEE; "kAlpha <= cached.e + e + 64" mov esi, 43EEh jmp short loc_B752B loc_B7511: lea rdi, aWorkspaceLlm4b_0; "/workspace/llm4binary/github/2025_star3"... lea rdx, aGgmlAssertSFai; "GGML_ASSERT(%s) failed" lea rcx, aKgammaCachedEE; "kGamma >= cached.e + e + 64" mov esi, 43EFh loc_B752B: xor eax, eax call _ggml_abort
long long nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent( nlohmann::json_abi_v3_11_3::detail::dtoa_impl *this) { int v1; // eax __int16 v2; // cx __int16 v3; // ax unsigned int v4; // eax long long v5; // rax int v6; // edi long long v8; // rsi if ( (int)this <= -1501 ) { v8 = 17380LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17380LL, "GGML_ASSERT(%s) failed", "e >= -1500"); } else if ( (int)this >= 1501 ) { v8 = 17381LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17381LL, "GGML_ASSERT(%s) failed", "e <= 1500"); } else { v1 = -78913 * ((int)this + 61) / 0x40000 + ((int)this < -61); if ( v1 <= -315 ) { v8 = 17386LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17386LL, "GGML_ASSERT(%s) failed", "index >= 0"); } else { v2 = v1 + 307; v3 = v1 + 314; if ( v2 >= 0 ) v3 = v2; v4 = (unsigned int)v3 >> 3; if ( (unsigned __int16)v4 >= 0x4Fu ) { v8 = 17387LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17387LL, "GGML_ASSERT(%s) failed", "static_cast<std::size_t>(index) < kCachedPowers.size()"); } else { v5 = 16 * (unsigned int)(unsigned __int16)v4; v6 = *(_QWORD *)((char *)&nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers + v5 + 8) + (_DWORD)this; if ( v6 <= -125 ) { v8 = 17390LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17390LL, "GGML_ASSERT(%s) failed", "kAlpha <= cached.e + e + 64"); } else { if ( v6 < -95 ) return *(_QWORD *)((char *)&nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int)::kCachedPowers + v5); v8 = 17391LL; ggml_abort( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", 17391LL, "GGML_ASSERT(%s) failed", "kGamma >= cached.e + e + 64"); } } } } return nlohmann::json_abi_v3_11_3::detail::dtoa_impl::diyfp::mul( "/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp", v8); }
get_cached_power_for_binary_exponent: PUSH RAX CMP EDI,0xfffffa23 JLE 0x001b7482 CMP EDI,0x5dd JGE 0x001b74a1 XOR EAX,EAX MOV ECX,EDI SUB ECX,-0x3d SETL AL NEG ECX IMUL ECX,ECX,0x13441 LEA EDX,[RCX + 0x3ffff] TEST ECX,ECX CMOVNS EDX,ECX SAR EDX,0x12 ADD EAX,EDX CMP EAX,0xfffffec5 JLE 0x001b74bd LEA ECX,[RAX + 0x133] ADD EAX,0x13a TEST CX,CX CMOVNS EAX,ECX CWDE SHR EAX,0x3 CMP AX,0x4f JNC 0x001b74d9 MOVZX EAX,AX SHL EAX,0x4 LEA RCX,[0x1f2ad8] MOV RDX,qword ptr [RCX + RAX*0x1 + 0x8] ADD EDI,EDX CMP EDI,-0x7d JLE 0x001b74f5 CMP EDI,-0x5f JGE 0x001b7511 MOV RAX,qword ptr [RCX + RAX*0x1] POP RCX RET LAB_001b7482: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f0538] MOV ESI,0x43e4 JMP 0x001b752b LAB_001b74a1: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f0543] MOV ESI,0x43e5 JMP 0x001b752b LAB_001b74bd: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f054d] MOV ESI,0x43ea JMP 0x001b752b LAB_001b74d9: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f0558] MOV ESI,0x43eb JMP 0x001b752b LAB_001b74f5: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f058f] MOV ESI,0x43ee JMP 0x001b752b LAB_001b7511: LEA RDI,[0x1eadf3] LEA RDX,[0x1eae3d] LEA RCX,[0x1f05ab] MOV ESI,0x43ef LAB_001b752b: XOR EAX,EAX CALL 0x0011aeb0
/* nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int) */ int8 nlohmann::json_abi_v3_11_3::detail::dtoa_impl::get_cached_power_for_binary_exponent(int param_1) { short sVar1; int iVar2; ulong uVar3; short sVar4; int iVar5; char *pcVar6; int8 uVar7; if (param_1 < -0x5dc) { pcVar6 = "e >= -1500"; uVar7 = 0x43e4; } else if (param_1 < 0x5dd) { iVar5 = (param_1 + 0x3d) * -0x13441; iVar2 = iVar5 + 0x3ffff; if (-1 < iVar5) { iVar2 = iVar5; } iVar2 = (uint)(param_1 < -0x3d) + (iVar2 >> 0x12); if (iVar2 < -0x13a) { pcVar6 = "index >= 0"; uVar7 = 0x43ea; } else { sVar1 = (short)iVar2; sVar4 = sVar1 + 0x133; sVar1 = sVar1 + 0x13a; if (-1 < sVar4) { sVar1 = sVar4; } if ((ushort)((uint)(int)sVar1 >> 3) < 0x4f) { uVar3 = (ulong)(((uint)(int)sVar1 >> 3 & 0xffff) << 4); iVar2 = param_1 + (int)*(int8 *) (get_cached_power_for_binary_exponent(int)::kCachedPowers + uVar3 + 8); if (iVar2 < -0x7c) { pcVar6 = "kAlpha <= cached.e + e + 64"; uVar7 = 0x43ee; } else { if (iVar2 < -0x5f) { return *(int8 *)(get_cached_power_for_binary_exponent(int)::kCachedPowers + uVar3) ; } pcVar6 = "kGamma >= cached.e + e + 64"; uVar7 = 0x43ef; } } else { pcVar6 = "static_cast<std::size_t>(index) < kCachedPowers.size()"; uVar7 = 0x43eb; } } } else { pcVar6 = "e <= 1500"; uVar7 = 0x43e5; } /* WARNING: Subroutine does not return */ ggml_abort("/workspace/llm4binary/github/2025_star3/monkey531[P]llama/common/json.hpp",uVar7, "GGML_ASSERT(%s) failed",pcVar6); }
2,990
common_chat_params_init_mistral_nemo(minja::chat_template const&, common_chat_inputs const&)
monkey531[P]llama/common/chat.cpp
static common_chat_params common_chat_params_init_mistral_nemo(const common_chat_template & tmpl, const struct common_chat_inputs & inputs) { common_chat_params data; data.grammar_lazy = inputs.tool_choice != "required"; data.grammar = build_grammar([&](const common_grammar_builder & builder) { auto schemas = json::array(); foreach_function(inputs.tools, [&](const json & tool) { const auto & function = tool["function"]; schemas.push_back({ {"type", "object"}, {"properties", { // Important note: the model is probably trained to take a JSON stringified arguments value. // It's hard to constrain that for now (while reusing the JSON schema conversion), so we're just expecting a plain object. {"name", { {"type", "string"}, {"const", function["name"]}, }}, {"arguments", function["parameters"]}, {"id", { {"type", "string"}, // Nemo's template expects a 9-character alphanumeric ID. {"pattern", "^[a-zA-Z0-9]{9}$"}, }}, }}, {"required", json::array({"name", "arguments", "id"})}, }); }); auto schema = json { {"type", "array"}, {"items", schemas.size() == 1 ? schemas[0] : json {{"anyOf", schemas}}}, {"minItems", 1}, }; if (!inputs.parallel_tool_calls) { schema["maxItems"] = 1; } builder.add_rule("root", "\"[TOOL_CALLS]\" " + builder.add_schema("tool_calls", schema)); }, grammar_options); data.grammar_triggers.push_back({"[TOOL_CALLS]", /* .at_start = */ true}); data.prompt = tmpl.apply(inputs.messages, inputs.tools.empty() ? json() : inputs.tools, inputs.add_generation_prompt); data.format = COMMON_CHAT_FORMAT_MISTRAL_NEMO; return data; }
O1
cpp
common_chat_params_init_mistral_nemo(minja::chat_template const&, common_chat_inputs const&): pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movl $0x0, (%rdi) xorl %eax, %eax movb %al, 0x8(%rdi) movq %rax, 0x10(%rdi) leaq 0x28(%rdi), %rcx movq %rcx, 0x18(%rdi) movq %rax, 0x20(%rdi) movb %al, 0x28(%rdi) movb %al, 0x38(%rdi) xorps %xmm0, %xmm0 movups %xmm0, 0x40(%rdi) movups %xmm0, 0x50(%rdi) movups %xmm0, 0x60(%rdi) movups %xmm0, 0x70(%rdi) movq %rax, 0x80(%rdi) leaq 0x20(%rdx), %rdi leaq 0x20a92(%rip), %rsi # 0xf78bd callq 0xaac5d movb %al, 0x38(%rbx) leaq 0x30(%rsp), %rsi xorps %xmm0, %xmm0 movaps %xmm0, (%rsi) movaps %xmm0, 0x10(%rsi) movq %r14, (%rsi) leaq 0xddd0(%rip), %rax # 0xe4c1c movq %rax, 0x18(%rsi) leaq 0xe6a9(%rip), %rax # 0xe5500 movq %rax, 0x10(%rsi) leaq 0x2696a(%rip), %rdx # 0xfd7cc leaq 0x8(%rsp), %rdi callq 0xc08f6 leaq 0x18(%rbx), %rdi leaq 0x8(%rsp), %r12 movq %r12, %rsi callq 0x1bae0 movq (%r12), %rdi leaq 0x18(%rsp), %r12 cmpq %r12, %rdi je 0xd6e98 movq 0x18(%rsp), %rsi incq %rsi callq 0x1b910 movq 0x40(%rsp), %rax testq %rax, %rax je 0xd6eb1 leaq 0x30(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax leaq 0x8(%rsp), %rdi movq %r12, (%rdi) leaq 0x279db(%rip), %rsi # 0xfe89b leaq 0x279e0(%rip), %rdx # 0xfe8a7 callq 0x28a68 leaq 0x40(%rbx), %rdi leaq 0x8(%rsp), %rsi movb $0x1, 0x20(%rsi) callq 0xeaf5e movq 0x8(%rsp), %rdi cmpq %r12, %rdi je 0xd6ef5 movq 0x18(%rsp), %rsi incq %rsi callq 0x1b910 movzbl 0x10(%r14), %eax leal -0x1(%rax), %ecx cmpl $0x2, %ecx jae 0xd6f1f movq 0x18(%r14), %rax movq (%rax), %rcx cmpq 0x8(%rax), %rcx je 0xd6f23 leaq 0x10(%r14), %rsi leaq 0x30(%rsp), %rdi callq 0x6ff00 jmp 0xd6f31 testl %eax, %eax jne 0xd6f0f movb $0x0, 0x30(%rsp) movq $0x0, 0x38(%rsp) movzbl 0x68(%r14), %r8d leaq 0x58(%rsp), %r9 movb $0x0, (%r9) movq $0x0, 0x8(%r9) movl $0x1, (%rsp) leaq 0x8(%rsp), %rdi leaq 0x30(%rsp), %rcx movq %r15, %rsi movq %r14, %rdx callq 0xa731c leaq 0x68(%rsp), %rdi leaq 0x8(%rsp), %rsi callq 0x8586c movb 0x8(%rbx), %al leaq 0x68(%rsp), %rdi movb (%rdi), %cl movb %cl, 0x8(%rbx) movb %al, (%rdi) movq 0x10(%rbx), %rax movq 0x8(%rdi), %rcx movq %rcx, 0x10(%rbx) movq %rax, 0x8(%rdi) callq 0x70460 movq 0x8(%rsp), %rdi cmpq %r12, %rdi je 0xd6fad movq 0x18(%rsp), %rsi incq %rsi callq 0x1b910 leaq 0x58(%rsp), %rdi callq 0x70460 leaq 0x30(%rsp), %rdi callq 0x70460 movl $0x2, (%rbx) movq %rbx, %rax addq $0x78, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq jmp 0xd702e jmp 0xd705f movq %rax, %r14 movq 0x8(%rsp), %rdi cmpq %r12, %rdi je 0xd6ffc movq 0x18(%rsp), %rsi incq %rsi callq 0x1b910 jmp 0xd6ffc movq %rax, %r14 leaq 0x58(%rsp), %rdi callq 0x70460 leaq 0x30(%rsp), %rdi callq 0x70460 jmp 0xd704f movq %rax, %r14 movq 0x8(%rsp), %rdi cmpq %r12, %rdi je 0xd704f movq 0x18(%rsp), %rsi incq %rsi callq 0x1b910 jmp 0xd704f movq %rax, %r14 jmp 0xd704f movq %rax, %r14 movq 0x40(%rsp), %rax testq %rax, %rax je 0xd704f leaq 0x30(%rsp), %rdi movq %rdi, %rsi movl $0x3, %edx callq *%rax movq %rbx, %rdi callq 0x8433a movq %r14, %rdi callq 0x1bff0 movq %rax, %rdi callq 0x25a95
_ZL36common_chat_params_init_mistral_nemoRKN5minja13chat_templateERK18common_chat_inputs: push r15 push r14 push r12 push rbx sub rsp, 78h mov r14, rdx mov r15, rsi mov rbx, rdi mov dword ptr [rdi], 0 xor eax, eax mov [rdi+8], al mov [rdi+10h], rax lea rcx, [rdi+28h] mov [rdi+18h], rcx mov [rdi+20h], rax mov [rdi+28h], al mov [rdi+38h], al xorps xmm0, xmm0 movups xmmword ptr [rdi+40h], xmm0 movups xmmword ptr [rdi+50h], xmm0 movups xmmword ptr [rdi+60h], xmm0 movups xmmword ptr [rdi+70h], xmm0 mov [rdi+80h], rax lea rdi, [rdx+20h] lea rsi, aRequired; "required" call _ZN8nlohmann16json_abi_v3_11_3neIPKcTnNSt9enable_ifIXsr3std9is_scalarIT_EE5valueEiE4typeELi0EEEbRKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerESA_IhSaIhEEvEES5_ mov [rbx+38h], al lea rsi, [rsp+98h+var_68] xorps xmm0, xmm0 movaps xmmword ptr [rsi], xmm0 movaps xmmword ptr [rsi+10h], xmm0 mov [rsi], r14 lea rax, _ZNSt17_Function_handlerIFvRK22common_grammar_builderEZL36common_chat_params_init_mistral_nemoRKN5minja13chat_templateERK18common_chat_inputsE3$_0E9_M_invokeERKSt9_Any_dataS2_; std::_Function_handler<void ()(common_grammar_builder const&),common_chat_params_init_mistral_nemo(minja::chat_template const&,common_chat_inputs const&)::$_0>::_M_invoke(std::_Any_data const&,common_grammar_builder const&) mov [rsi+18h], rax lea rax, _ZNSt17_Function_handlerIFvRK22common_grammar_builderEZL36common_chat_params_init_mistral_nemoRKN5minja13chat_templateERK18common_chat_inputsE3$_0E10_M_managerERSt9_Any_dataRKSD_St18_Manager_operation; std::_Function_handler<void ()(common_grammar_builder const&),common_chat_params_init_mistral_nemo(minja::chat_template const&,common_chat_inputs const&)::$_0>::_M_manager(std::_Any_data &,std::_Any_data const&,std::_Manager_operation) mov [rsi+10h], rax lea rdx, _ZL15grammar_options; grammar_options lea rdi, [rsp+98h+var_90] call _Z13build_grammarB5cxx11RKSt8functionIFvRK22common_grammar_builderEERK22common_grammar_options; build_grammar(std::function<void ()(common_grammar_builder const&)> const&,common_grammar_options const&) lea rdi, [rbx+18h] lea r12, [rsp+98h+var_90] mov rsi, r12 call __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_; std::string::operator=(std::string&&) mov rdi, [r12]; void * lea r12, [rsp+98h+var_80] cmp rdi, r12 jz short loc_D6E98 mov rsi, [rsp+98h+var_80] inc rsi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_D6E98: mov rax, [rsp+98h+var_58] test rax, rax jz short loc_D6EB1 lea rdi, [rsp+98h+var_68] mov rsi, rdi mov edx, 3 call rax loc_D6EB1: lea rdi, [rsp+98h+var_90] mov [rdi], r12 lea rsi, aToolCalls_0; "[TOOL_CALLS]" lea rdx, aToolCalls_0+0Ch; "" call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag; std::string::_M_construct<char const*>(char const*,char const*,std::forward_iterator_tag) lea rdi, [rbx+40h] lea rsi, [rsp+98h+var_90] mov byte ptr [rsi+20h], 1 call _ZNSt6vectorI22common_grammar_triggerSaIS0_EE12emplace_backIJS0_EEERS0_DpOT_; std::vector<common_grammar_trigger>::emplace_back<common_grammar_trigger>(common_grammar_trigger &&) mov rdi, [rsp+98h+var_90]; void * cmp rdi, r12 jz short loc_D6EF5 mov rsi, [rsp+98h+var_80] inc rsi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_D6EF5: movzx eax, byte ptr [r14+10h] lea ecx, [rax-1] cmp ecx, 2 jnb short loc_D6F1F mov rax, [r14+18h] mov rcx, [rax] cmp rcx, [rax+8] jz short loc_D6F23 loc_D6F0F: lea rsi, [r14+10h] lea rdi, [rsp+98h+var_68] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvEC2ERKSD_; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::basic_json(nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void> const&) jmp short loc_D6F31 loc_D6F1F: test eax, eax jnz short loc_D6F0F loc_D6F23: mov [rsp+98h+var_68], 0 mov [rsp+98h+var_60], 0 loc_D6F31: movzx r8d, byte ptr [r14+68h] lea r9, [rsp+98h+var_40] mov byte ptr [r9], 0 mov qword ptr [r9+8], 0 mov [rsp+98h+var_98], 1 lea rdi, [rsp+98h+var_90] lea rcx, [rsp+98h+var_68] mov rsi, r15 mov rdx, r14 call _ZNK5minja13chat_template5applyERKN8nlohmann16json_abi_v3_11_310basic_jsonINS2_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS2_14adl_serializerES5_IhSaIhEEvEESH_bSH_b; minja::chat_template::apply(nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void> const&,nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void> const&,bool,nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void> const&,bool) lea rdi, [rsp+98h+var_30] lea rsi, [rsp+98h+var_90] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvEC2IS9_S9_TnNSt9enable_ifIXaantsr6detail13is_basic_jsonIT0_EE5valuesr6detail18is_compatible_typeISD_SG_EE5valueEiE4typeELi0EEEOT_ mov al, [rbx+8] lea rdi, [rsp+98h+var_30] mov cl, [rdi] mov [rbx+8], cl mov [rdi], al mov rax, [rbx+10h] mov rcx, [rdi+8] mov [rbx+10h], rcx mov [rdi+8], rax call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4dataD2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::data::~data() mov rdi, [rsp+98h+var_90]; void * cmp rdi, r12 jz short loc_D6FAD mov rsi, [rsp+98h+var_80] inc rsi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) loc_D6FAD: lea rdi, [rsp+98h+var_40] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4dataD2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::data::~data() lea rdi, [rsp+98h+var_68] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4dataD2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::data::~data() mov dword ptr [rbx], 2 mov rax, rbx add rsp, 78h pop rbx pop r12 pop r14 pop r15 retn jmp short loc_D702E jmp loc_D705F mov r14, rax mov rdi, [rsp+98h+var_90]; void * cmp rdi, r12 jz short loc_D6FFC mov rsi, [rsp+98h+var_80] inc rsi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) jmp short loc_D6FFC mov r14, rax loc_D6FFC: lea rdi, [rsp+98h+var_40] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4dataD2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::data::~data() lea rdi, [rsp+98h+var_68] call _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvE4dataD2Ev; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,ulong,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<uchar>,void>::data::~data() jmp short loc_D704F mov r14, rax mov rdi, [rsp+98h+var_90]; void * cmp rdi, r12 jz short loc_D704F mov rsi, [rsp+98h+var_80] inc rsi; unsigned __int64 call __ZdlPvm; operator delete(void *,ulong) jmp short loc_D704F loc_D702E: mov r14, rax jmp short loc_D704F mov r14, rax mov rax, [rsp+98h+var_58] test rax, rax jz short loc_D704F lea rdi, [rsp+98h+var_68] mov rsi, rdi mov edx, 3 call rax loc_D704F: mov rdi, rbx; this call _ZN18common_chat_paramsD2Ev; common_chat_params::~common_chat_params() mov rdi, r14 call __Unwind_Resume loc_D705F: mov rdi, rax call __clang_call_terminate
const minja::chat_template * common_chat_params_init_mistral_nemo( const minja::chat_template *a1, const common_chat_inputs *a2, long long a3) { long long v4; // rcx int v5; // r8d int v6; // r9d int v7; // r8d char v8; // al long long v9; // rax void *v11[2]; // [rsp+8h] [rbp-90h] BYREF _QWORD v12[2]; // [rsp+18h] [rbp-80h] BYREF char v13; // [rsp+28h] [rbp-70h] __int128 v14; // [rsp+30h] [rbp-68h] BYREF long long ( *v15)(); // [rsp+40h] [rbp-58h] long long ( *v16)(); // [rsp+48h] [rbp-50h] unsigned __int8 v17[8]; // [rsp+58h] [rbp-40h] BYREF long long v18; // [rsp+60h] [rbp-38h] char v19[8]; // [rsp+68h] [rbp-30h] BYREF long long v20; // [rsp+70h] [rbp-28h] *(_DWORD *)a1 = 0; *((_BYTE *)a1 + 8) = 0; *((_QWORD *)a1 + 2) = 0LL; *((_QWORD *)a1 + 3) = (char *)a1 + 40; *((_QWORD *)a1 + 4) = 0LL; *((_BYTE *)a1 + 40) = 0; *((_BYTE *)a1 + 56) = 0; *((_OWORD *)a1 + 4) = 0LL; *((_OWORD *)a1 + 5) = 0LL; *((_OWORD *)a1 + 6) = 0LL; *((_OWORD *)a1 + 7) = 0LL; *((_QWORD *)a1 + 16) = 0LL; *((_BYTE *)a1 + 56) = ZN8nlohmann16json_abi_v3_11_3neIPKcTnNSt9enable_ifIXsr3std9is_scalarIT_EE5valueEiE4typeELi0EEEbRKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerESA_IhSaIhEEvEES5_( a3 + 32, (long long)"required"); v14 = 0LL; *(_QWORD *)&v14 = a3; v16 = std::_Function_handler<void ()(common_grammar_builder const&),common_chat_params_init_mistral_nemo(minja::chat_template const&,common_chat_inputs const&)::$_0>::_M_invoke; v15 = std::_Function_handler<void ()(common_grammar_builder const&),common_chat_params_init_mistral_nemo(minja::chat_template const&,common_chat_inputs const&)::$_0>::_M_manager; build_grammar[abi:cxx11]((long long)v11, (long long)&v14, grammar_options, v4, v5, v6); std::string::operator=((char *)a1 + 24, v11); if ( v11[0] != v12 ) operator delete(v11[0], v12[0] + 1LL); if ( v15 ) ((void ( *)(__int128 *, __int128 *, long long))v15)(&v14, &v14, 3LL); v11[0] = v12; std::string::_M_construct<char const*>(v11, "[TOOL_CALLS]", (long long)""); v13 = 1; std::vector<common_grammar_trigger>::emplace_back<common_grammar_trigger>((char *)a1 + 64); if ( v11[0] != v12 ) operator delete(v11[0], v12[0] + 1LL); if ( (unsigned int)*(unsigned __int8 *)(a3 + 16) - 1 >= 2 ) { if ( *(_BYTE *)(a3 + 16) ) goto LABEL_9; } else if ( **(_QWORD **)(a3 + 24) != *(_QWORD *)(*(_QWORD *)(a3 + 24) + 8LL) ) { LABEL_9: nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::basic_json( (unsigned __int8 *)&v14, (unsigned __int8 *)(a3 + 16)); goto LABEL_12; } LOBYTE(v14) = 0; *((_QWORD *)&v14 + 1) = 0LL; LABEL_12: v7 = *(unsigned __int8 *)(a3 + 104); v17[0] = 0; v18 = 0LL; minja::chat_template::apply((long long)v11, a2, (unsigned __int8 *)a3, (unsigned __int8 *)&v14, v7, v17, 1); ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvEC2IS9_S9_TnNSt9enable_ifIXaantsr6detail13is_basic_jsonIT0_EE5valuesr6detail18is_compatible_typeISD_SG_EE5valueEiE4typeELi0EEEOT_(v19); v8 = *((_BYTE *)a1 + 8); *((_BYTE *)a1 + 8) = v19[0]; v19[0] = v8; v9 = *((_QWORD *)a1 + 2); *((_QWORD *)a1 + 2) = v20; v20 = v9; nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::data::~data(v19); if ( v11[0] != v12 ) operator delete(v11[0], v12[0] + 1LL); nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::data::~data(v17); nlohmann::json_abi_v3_11_3::basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::string,bool,long,unsigned long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned char>,void>::data::~data(&v14); *(_DWORD *)a1 = 2; return a1; }
common_chat_params_init_mistral_nemo: PUSH R15 PUSH R14 PUSH R12 PUSH RBX SUB RSP,0x78 MOV R14,RDX MOV R15,RSI MOV RBX,RDI MOV dword ptr [RDI],0x0 XOR EAX,EAX MOV byte ptr [RDI + 0x8],AL MOV qword ptr [RDI + 0x10],RAX LEA RCX,[RDI + 0x28] MOV qword ptr [RDI + 0x18],RCX MOV qword ptr [RDI + 0x20],RAX MOV byte ptr [RDI + 0x28],AL MOV byte ptr [RDI + 0x38],AL XORPS XMM0,XMM0 MOVUPS xmmword ptr [RDI + 0x40],XMM0 MOVUPS xmmword ptr [RDI + 0x50],XMM0 MOVUPS xmmword ptr [RDI + 0x60],XMM0 MOVUPS xmmword ptr [RDI + 0x70],XMM0 MOV qword ptr [RDI + 0x80],RAX LEA RDI,[RDX + 0x20] LEA RSI,[0x1f78bd] CALL 0x001aac5d MOV byte ptr [RBX + 0x38],AL LEA RSI,[RSP + 0x30] XORPS XMM0,XMM0 MOVAPS xmmword ptr [RSI],XMM0 MOVAPS xmmword ptr [RSI + 0x10],XMM0 MOV qword ptr [RSI],R14 LEA RAX,[0x1e4c1c] MOV qword ptr [RSI + 0x18],RAX LEA RAX,[0x1e5500] MOV qword ptr [RSI + 0x10],RAX LAB_001d6e5b: LEA RDX,[0x1fd7cc] LEA RDI,[RSP + 0x8] CALL 0x001c08f6 LEA RDI,[RBX + 0x18] LEA R12,[RSP + 0x8] MOV RSI,R12 CALL 0x0011bae0 MOV RDI,qword ptr [R12] LEA R12,[RSP + 0x18] CMP RDI,R12 JZ 0x001d6e98 MOV RSI,qword ptr [RSP + 0x18] INC RSI CALL 0x0011b910 LAB_001d6e98: MOV RAX,qword ptr [RSP + 0x40] TEST RAX,RAX JZ 0x001d6eb1 LAB_001d6ea2: LEA RDI,[RSP + 0x30] MOV RSI,RDI MOV EDX,0x3 CALL RAX LAB_001d6eb1: LEA RDI,[RSP + 0x8] MOV qword ptr [RDI],R12 LAB_001d6eb9: LEA RSI,[0x1fe89b] LEA RDX,[0x1fe8a7] CALL 0x00128a68 LEA RDI,[RBX + 0x40] LEA RSI,[RSP + 0x8] MOV byte ptr [RSI + 0x20],0x1 LAB_001d6ed9: CALL 0x001eaf5e MOV RDI,qword ptr [RSP + 0x8] CMP RDI,R12 JZ 0x001d6ef5 MOV RSI,qword ptr [RSP + 0x18] INC RSI CALL 0x0011b910 LAB_001d6ef5: MOVZX EAX,byte ptr [R14 + 0x10] LEA ECX,[RAX + -0x1] CMP ECX,0x2 JNC 0x001d6f1f MOV RAX,qword ptr [R14 + 0x18] MOV RCX,qword ptr [RAX] CMP RCX,qword ptr [RAX + 0x8] JZ 0x001d6f23 LAB_001d6f0f: LEA RSI,[R14 + 0x10] LEA RDI,[RSP + 0x30] CALL 0x0016ff00 JMP 0x001d6f31 LAB_001d6f1f: TEST EAX,EAX JNZ 0x001d6f0f LAB_001d6f23: MOV byte ptr [RSP + 0x30],0x0 MOV qword ptr [RSP + 0x38],0x0 LAB_001d6f31: MOVZX R8D,byte ptr [R14 + 0x68] LEA R9,[RSP + 0x58] MOV byte ptr [R9],0x0 MOV qword ptr [R9 + 0x8],0x0 LAB_001d6f47: MOV dword ptr [RSP],0x1 LEA RDI,[RSP + 0x8] LEA RCX,[RSP + 0x30] MOV RSI,R15 MOV RDX,R14 CALL 0x001a731c LAB_001d6f63: LEA RDI,[RSP + 0x68] LEA RSI,[RSP + 0x8] CALL 0x0018586c MOV AL,byte ptr [RBX + 0x8] LEA RDI,[RSP + 0x68] MOV CL,byte ptr [RDI] MOV byte ptr [RBX + 0x8],CL MOV byte ptr [RDI],AL MOV RAX,qword ptr [RBX + 0x10] MOV RCX,qword ptr [RDI + 0x8] MOV qword ptr [RBX + 0x10],RCX MOV qword ptr [RDI + 0x8],RAX CALL 0x00170460 MOV RDI,qword ptr [RSP + 0x8] CMP RDI,R12 JZ 0x001d6fad MOV RSI,qword ptr [RSP + 0x18] INC RSI CALL 0x0011b910 LAB_001d6fad: LEA RDI,[RSP + 0x58] CALL 0x00170460 LEA RDI,[RSP + 0x30] CALL 0x00170460 MOV dword ptr [RBX],0x2 MOV RAX,RBX ADD RSP,0x78 POP RBX POP R12 POP R14 POP R15 RET
/* common_chat_params_init_mistral_nemo(minja::chat_template const&, common_chat_inputs const&) */ chat_template * common_chat_params_init_mistral_nemo(chat_template *param_1,common_chat_inputs *param_2) { int8 uVar1; chat_template cVar2; ulong in_RDX; long *local_90 [2]; long local_80 [2]; int1 local_70; ulong local_68 [2]; code *local_58; code *pcStack_50; data local_40 [8]; int8 local_38; chat_template local_30 [8]; int8 local_28; *(int4 *)param_1 = 0; param_1[8] = (chat_template)0x0; *(int8 *)(param_1 + 0x10) = 0; *(chat_template **)(param_1 + 0x18) = param_1 + 0x28; *(int8 *)(param_1 + 0x20) = 0; param_1[0x28] = (chat_template)0x0; param_1[0x38] = (chat_template)0x0; *(int8 *)(param_1 + 0x40) = 0; *(int8 *)(param_1 + 0x48) = 0; *(int8 *)(param_1 + 0x50) = 0; *(int8 *)(param_1 + 0x58) = 0; *(int8 *)(param_1 + 0x60) = 0; *(int8 *)(param_1 + 0x68) = 0; *(int8 *)(param_1 + 0x70) = 0; *(int8 *)(param_1 + 0x78) = 0; *(int8 *)(param_1 + 0x80) = 0; cVar2 = (chat_template) _ZN8nlohmann16json_abi_v3_11_3neIPKcTnNSt9enable_ifIXsr3std9is_scalarIT_EE5valueEiE4typeELi0EEEbRKNS0_10basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerESA_IhSaIhEEvEES5_ (in_RDX + 0x20,"required"); param_1[0x38] = cVar2; local_68[1] = 0; pcStack_50 = std:: _Function_handler<void(common_grammar_builder_const&),common_chat_params_init_mistral_nemo(minja::chat_template_const&,common_chat_inputs_const&)::$_0> ::_M_invoke; local_58 = std:: _Function_handler<void(common_grammar_builder_const&),common_chat_params_init_mistral_nemo(minja::chat_template_const&,common_chat_inputs_const&)::$_0> ::_M_manager; /* try { // try from 001d6e5b to 001d6e6b has its CatchHandler @ 001d7033 */ local_68[0] = in_RDX; build_grammar_abi_cxx11_((function *)local_90,(common_grammar_options *)local_68); std::__cxx11::string::operator=((string *)(param_1 + 0x18),(string *)local_90); if (local_90[0] != local_80) { operator_delete(local_90[0],local_80[0] + 1); } if (local_58 != (code *)0x0) { /* try { // try from 001d6ea2 to 001d6eb0 has its CatchHandler @ 001d6fd8 */ (*local_58)(local_68,local_68,3); } local_90[0] = local_80; /* try { // try from 001d6eb9 to 001d6ecb has its CatchHandler @ 001d702e */ std::__cxx11::string::_M_construct<char_const*>(local_90,"[TOOL_CALLS]",""); local_70 = 1; /* try { // try from 001d6ed9 to 001d6edd has its CatchHandler @ 001d7012 */ std::vector<common_grammar_trigger,std::allocator<common_grammar_trigger>>:: emplace_back<common_grammar_trigger> ((vector<common_grammar_trigger,std::allocator<common_grammar_trigger>> *) (param_1 + 0x40),(common_grammar_trigger *)local_90); if (local_90[0] != local_80) { operator_delete(local_90[0],local_80[0] + 1); } if (*(byte *)(in_RDX + 0x10) - 1 < 2) { if (**(long **)(in_RDX + 0x18) == (*(long **)(in_RDX + 0x18))[1]) { LAB_001d6f23: local_68[0] = local_68[0] & 0xffffffffffffff00; local_68[1] = 0; goto LAB_001d6f31; } } else if (*(byte *)(in_RDX + 0x10) == 0) goto LAB_001d6f23; /* try { // try from 001d6f0f to 001d6f1c has its CatchHandler @ 001d6fd6 */ nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::basic_json((basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> *)local_68,(basic_json *)(in_RDX + 0x10)); LAB_001d6f31: local_40[0] = (data)0x0; local_38 = 0; /* try { // try from 001d6f47 to 001d6f62 has its CatchHandler @ 001d6ff9 */ minja::chat_template::apply ((basic_json *)local_90,(basic_json *)param_2,SUB81(in_RDX,0),(basic_json *)local_68, *(bool *)(in_RDX + 0x68)); /* try { // try from 001d6f63 to 001d6f71 has its CatchHandler @ 001d6fdd */ _ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapESt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS0_14adl_serializerES3_IhSaIhEEvEC2IS9_S9_TnNSt9enable_ifIXaantsr6detail13is_basic_jsonIT0_EE5valuesr6detail18is_compatible_typeISD_SG_EE5valueEiE4typeELi0EEEOT_ (local_30,local_90); cVar2 = param_1[8]; param_1[8] = local_30[0]; uVar1 = *(int8 *)(param_1 + 0x10); *(int8 *)(param_1 + 0x10) = local_28; local_30[0] = cVar2; local_28 = uVar1; nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::data::~data((data *)local_30); if (local_90[0] != local_80) { operator_delete(local_90[0],local_80[0] + 1); } nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::data::~data(local_40); nlohmann::json_abi_v3_11_3:: basic_json<nlohmann::json_abi_v3_11_3::ordered_map,std::vector,std::__cxx11::string,bool,long,unsigned_long,double,std::allocator,nlohmann::json_abi_v3_11_3::adl_serializer,std::vector<unsigned_char,std::allocator<unsigned_char>>,void> ::data::~data((data *)local_68); *(int4 *)param_1 = 2; return param_1; }
2,991
google::protobuf::DescriptorPoolDatabase::FindFileContainingExtension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, google::protobuf::FileDescriptorProto*)
aimrt_mujoco_sim/_deps/protobuf-src/src/google/protobuf/descriptor_database.cc
bool DescriptorPoolDatabase::FindFileContainingExtension( const std::string& containing_type, int field_number, FileDescriptorProto* output) { const Descriptor* extendee = pool_.FindMessageTypeByName(containing_type); if (extendee == nullptr) return false; const FieldDescriptor* extension = pool_.FindExtensionByNumber(extendee, field_number); if (extension == nullptr) return false; output->Clear(); extension->file()->CopyTo(output); return true; }
O3
cpp
google::protobuf::DescriptorPoolDatabase::FindFileContainingExtension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, google::protobuf::FileDescriptorProto*): pushq %rbp pushq %r14 pushq %rbx movq %rcx, %rbx movl %edx, %ebp movq %rdi, %r14 movq 0x8(%rdi), %rdi callq 0x1e2e4 testq %rax, %rax je 0x5b8ca movq 0x8(%r14), %rdi movq %rax, %rsi movl %ebp, %edx callq 0x1e408 testq %rax, %rax je 0x5b8ca movq %rax, %r14 movq %rbx, %rdi callq 0x4831c movq 0x10(%r14), %rdi movq %rbx, %rsi callq 0x1fb44 movb $0x1, %al jmp 0x5b8cc xorl %eax, %eax popq %rbx popq %r14 popq %rbp retq nop
_ZN6google8protobuf22DescriptorPoolDatabase27FindFileContainingExtensionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiPNS0_19FileDescriptorProtoE: push rbp push r14 push rbx mov rbx, rcx mov ebp, edx mov r14, rdi mov rdi, [rdi+8] call _ZNK6google8protobuf14DescriptorPool21FindMessageTypeByNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE; google::protobuf::DescriptorPool::FindMessageTypeByName(std::string const&) test rax, rax jz short loc_5B8CA mov rdi, [r14+8]; this mov rsi, rax; google::protobuf::Descriptor * mov edx, ebp; int call _ZNK6google8protobuf14DescriptorPool21FindExtensionByNumberEPKNS0_10DescriptorEi; google::protobuf::DescriptorPool::FindExtensionByNumber(google::protobuf::Descriptor const*,int) test rax, rax jz short loc_5B8CA mov r14, rax mov rdi, rbx; this call _ZN6google8protobuf19FileDescriptorProto5ClearEv; google::protobuf::FileDescriptorProto::Clear(void) mov rdi, [r14+10h]; this mov rsi, rbx; google::protobuf::FileDescriptorProto * call _ZNK6google8protobuf14FileDescriptor6CopyToEPNS0_19FileDescriptorProtoE; google::protobuf::FileDescriptor::CopyTo(google::protobuf::FileDescriptorProto *) mov al, 1 jmp short loc_5B8CC loc_5B8CA: xor eax, eax loc_5B8CC: pop rbx pop r14 pop rbp retn
char google::protobuf::DescriptorPoolDatabase::FindFileContainingExtension( long long a1, long long *a2, int a3, google::protobuf::FileDescriptorProto *a4) { const google::protobuf::Descriptor *MessageTypeByName; // rax long long ExtensionByNumber; // rax long long v8; // r14 MessageTypeByName = (const google::protobuf::Descriptor *)google::protobuf::DescriptorPool::FindMessageTypeByName( *(_QWORD *)(a1 + 8), a2); if ( !MessageTypeByName ) return 0; ExtensionByNumber = google::protobuf::DescriptorPool::FindExtensionByNumber( *(google::protobuf::DescriptorPool **)(a1 + 8), MessageTypeByName, a3); if ( !ExtensionByNumber ) return 0; v8 = ExtensionByNumber; google::protobuf::FileDescriptorProto::Clear(a4); google::protobuf::FileDescriptor::CopyTo(*(google::protobuf::FileDescriptor **)(v8 + 16), a4); return 1; }
FindFileContainingExtension: PUSH RBP PUSH R14 PUSH RBX MOV RBX,RCX MOV EBP,EDX MOV R14,RDI MOV RDI,qword ptr [RDI + 0x8] CALL 0x0011e2e4 TEST RAX,RAX JZ 0x0015b8ca MOV RDI,qword ptr [R14 + 0x8] MOV RSI,RAX MOV EDX,EBP CALL 0x0011e408 TEST RAX,RAX JZ 0x0015b8ca MOV R14,RAX MOV RDI,RBX CALL 0x0014831c MOV RDI,qword ptr [R14 + 0x10] MOV RSI,RBX CALL 0x0011fb44 MOV AL,0x1 JMP 0x0015b8cc LAB_0015b8ca: XOR EAX,EAX LAB_0015b8cc: POP RBX POP R14 POP RBP RET
/* google::protobuf::DescriptorPoolDatabase::FindFileContainingExtension(std::__cxx11::string const&, int, google::protobuf::FileDescriptorProto*) */ int8 __thiscall google::protobuf::DescriptorPoolDatabase::FindFileContainingExtension (DescriptorPoolDatabase *this,string *param_1,int param_2,FileDescriptorProto *param_3) { Descriptor *pDVar1; long lVar2; pDVar1 = (Descriptor *) DescriptorPool::FindMessageTypeByName(*(DescriptorPool **)(this + 8),param_1); if ((pDVar1 != (Descriptor *)0x0) && (lVar2 = DescriptorPool::FindExtensionByNumber(*(DescriptorPool **)(this + 8),pDVar1,param_2), lVar2 != 0)) { FileDescriptorProto::Clear(param_3); FileDescriptor::CopyTo(*(FileDescriptor **)(lVar2 + 0x10),param_3); return 1; } return 0; }
2,992
minja::Value::to_bool() const
monkey531[P]llama/common/minja.hpp
bool to_bool() const { if (is_null()) return false; if (is_boolean()) return get<bool>(); if (is_number()) return get<double>() != 0; if (is_string()) return !get<std::string>().empty(); if (is_array()) return !empty(); return true; }
O2
cpp
minja::Value::to_bool() const: pushq %r14 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx callq 0x6390a testb %al, %al je 0x63097 xorl %ebx, %ebx movl %ebx, %eax addq $0x28, %rsp popq %rbx popq %r14 retq movb 0x40(%rbx), %al cmpb $0x4, %al jne 0x630ad movq %rbx, %rdi addq $0x28, %rsp popq %rbx popq %r14 jmp 0x63c9e leal -0x5(%rax), %ecx cmpb $0x2, %cl ja 0x630d0 movq %rbx, %rdi callq 0x6323c xorpd %xmm1, %xmm1 cmpneqsd %xmm0, %xmm1 movq %xmm1, %rbx andl $0x1, %ebx jmp 0x6308d cmpb $0x3, %al jne 0x630f6 leaq 0x8(%rsp), %r14 movq %r14, %rdi movq %rbx, %rsi callq 0x63d54 cmpq $0x0, 0x8(%r14) setne %bl movq %r14, %rdi callq 0x251b8 jmp 0x6308d cmpq $0x0, 0x10(%rbx) je 0x6310c movq %rbx, %rdi callq 0x63e18 movl %eax, %ebx xorb $0x1, %bl jmp 0x6308d movb $0x1, %bl jmp 0x6308d nop
_ZNK5minja5Value7to_boolEv: push r14 push rbx sub rsp, 28h mov rbx, rdi call _ZNK5minja5Value7is_nullEv; minja::Value::is_null(void) test al, al jz short loc_63097 xor ebx, ebx loc_6308D: mov eax, ebx add rsp, 28h pop rbx pop r14 retn loc_63097: mov al, [rbx+40h] cmp al, 4 jnz short loc_630AD mov rdi, rbx add rsp, 28h pop rbx pop r14 jmp _ZNK5minja5Value3getIbEET_v; minja::Value::get<bool>(void) loc_630AD: lea ecx, [rax-5] cmp cl, 2 ja short loc_630D0 mov rdi, rbx call _ZNK5minja5Value3getIdEET_v; minja::Value::get<double>(void) xorpd xmm1, xmm1 cmpneqsd xmm1, xmm0 movq rbx, xmm1 and ebx, 1 jmp short loc_6308D loc_630D0: cmp al, 3 jnz short loc_630F6 lea r14, [rsp+38h+var_30] mov rdi, r14 mov rsi, rbx call _ZNK5minja5Value3getINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v; minja::Value::get<std::string>(void) cmp qword ptr [r14+8], 0 setnz bl mov rdi, r14; void * call _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev; std::string::~string() jmp short loc_6308D loc_630F6: cmp qword ptr [rbx+10h], 0 jz short loc_6310C mov rdi, rbx; this call _ZNK5minja5Value5emptyEv; minja::Value::empty(void) mov ebx, eax xor bl, 1 jmp short loc_6308D loc_6310C: mov bl, 1 jmp loc_6308D
long long minja::Value::to_bool(minja::Value *this) { unsigned int v1; // ebx char v3; // al __m128d v4; // xmm0 _BYTE v5[8]; // [rsp+8h] [rbp-30h] BYREF long long v6; // [rsp+10h] [rbp-28h] v1 = (unsigned int)this; if ( (unsigned __int8)minja::Value::is_null(this) ) return 0; v3 = *((_BYTE *)this + 64); if ( v3 != 4 ) { if ( (unsigned __int8)(v3 - 5) > 2u ) { if ( v3 == 3 ) { minja::Value::get<std::string>(v5, this); LOBYTE(v1) = v6 != 0; std::string::~string(v5); } else if ( *((_QWORD *)this + 2) ) { v1 = minja::Value::empty(this); LOBYTE(v1) = v1 ^ 1; } else { LOBYTE(v1) = 1; } } else { v4.m128d_f64[0] = minja::Value::get<double>(this); return *(_OWORD *)&_mm_cmpneq_sd((__m128d)0LL, v4) & 1; } return v1; } return minja::Value::get<bool>(this); }
to_bool: PUSH R14 PUSH RBX SUB RSP,0x28 MOV RBX,RDI CALL 0x0016390a TEST AL,AL JZ 0x00163097 XOR EBX,EBX LAB_0016308d: MOV EAX,EBX ADD RSP,0x28 POP RBX POP R14 RET LAB_00163097: MOV AL,byte ptr [RBX + 0x40] CMP AL,0x4 JNZ 0x001630ad MOV RDI,RBX ADD RSP,0x28 POP RBX POP R14 JMP 0x00163c9e LAB_001630ad: LEA ECX,[RAX + -0x5] CMP CL,0x2 JA 0x001630d0 MOV RDI,RBX CALL 0x0016323c XORPD XMM1,XMM1 CMPNEQSD XMM1,XMM0 MOVQ RBX,XMM1 AND EBX,0x1 JMP 0x0016308d LAB_001630d0: CMP AL,0x3 JNZ 0x001630f6 LEA R14,[RSP + 0x8] MOV RDI,R14 MOV RSI,RBX CALL 0x00163d54 CMP qword ptr [R14 + 0x8],0x0 SETNZ BL MOV RDI,R14 CALL 0x001251b8 JMP 0x0016308d LAB_001630f6: CMP qword ptr [RBX + 0x10],0x0 JZ 0x0016310c MOV RDI,RBX CALL 0x00163e18 MOV EBX,EAX XOR BL,0x1 JMP 0x0016308d LAB_0016310c: MOV BL,0x1 JMP 0x0016308d
/* minja::Value::to_bool() const */ byte __thiscall minja::Value::to_bool(Value *this) { Value VVar1; char cVar2; bool bVar3; byte bVar4; double dVar5; string local_30 [8]; long local_28; cVar2 = is_null(this); if (cVar2 == '\0') { VVar1 = this[0x40]; if (VVar1 == (Value)0x4) { bVar3 = get<bool>(this); return bVar3; } if ((byte)((char)VVar1 - 5U) < 3) { dVar5 = get<double>(this); bVar4 = -(dVar5 != 0.0) & 1; } else if (VVar1 == (Value)0x3) { get<std::__cxx11::string>(); bVar4 = local_28 != 0; std::__cxx11::string::~string(local_30); } else if (*(long *)(this + 0x10) == 0) { bVar4 = 1; } else { bVar4 = empty(this); bVar4 = bVar4 ^ 1; } } else { bVar4 = 0; } return bVar4; }
2,993
stbiw__sbgrowf(void**, int, int)
7CodeWizard[P]stablediffusion/thirdparty/stb_image_write.h
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) { int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); STBIW_ASSERT(p); if (p) { if (!*arr) ((int *) p)[1] = 0; *arr = (void *) ((int *) p + 2); stbiw__sbm(*arr) = m; } return *arr; }
O0
c
stbiw__sbgrowf(void**, int, int): subq $0x38, %rsp movq %rdi, 0x30(%rsp) movl %esi, 0x2c(%rsp) movl %edx, 0x28(%rsp) movq 0x30(%rsp), %rax cmpq $0x0, (%rax) je 0x2fec3 movq 0x30(%rsp), %rax movq (%rax), %rax movl -0x8(%rax), %eax shll %eax addl 0x2c(%rsp), %eax movl %eax, 0x14(%rsp) jmp 0x2fece movl 0x2c(%rsp), %eax addl $0x1, %eax movl %eax, 0x14(%rsp) movl 0x14(%rsp), %eax movl %eax, 0x24(%rsp) movq 0x30(%rsp), %rax cmpq $0x0, (%rax) je 0x2fef4 movq 0x30(%rsp), %rax movq (%rax), %rax addq $-0x8, %rax movq %rax, 0x8(%rsp) jmp 0x2fefd xorl %eax, %eax movq %rax, 0x8(%rsp) jmp 0x2fefd movq 0x8(%rsp), %rdi movl 0x28(%rsp), %eax imull 0x24(%rsp), %eax movslq %eax, %rsi addq $0x8, %rsi callq 0xbc50 movq %rax, 0x18(%rsp) cmpq $0x0, 0x18(%rsp) je 0x2ff5b movq 0x30(%rsp), %rax cmpq $0x0, (%rax) jne 0x2ff3b movq 0x18(%rsp), %rax movl $0x0, 0x4(%rax) movq 0x18(%rsp), %rcx addq $0x8, %rcx movq 0x30(%rsp), %rax movq %rcx, (%rax) movl 0x24(%rsp), %ecx movq 0x30(%rsp), %rax movq (%rax), %rax movl %ecx, -0x8(%rax) movq 0x30(%rsp), %rax movq (%rax), %rax addq $0x38, %rsp retq nopl (%rax,%rax)
_ZL14stbiw__sbgrowfPPvii: sub rsp, 38h mov [rsp+38h+var_8], rdi mov [rsp+38h+var_C], esi mov [rsp+38h+var_10], edx mov rax, [rsp+38h+var_8] cmp qword ptr [rax], 0 jz short loc_2FEC3 mov rax, [rsp+38h+var_8] mov rax, [rax] mov eax, [rax-8] shl eax, 1 add eax, [rsp+38h+var_C] mov [rsp+38h+var_24], eax jmp short loc_2FECE loc_2FEC3: mov eax, [rsp+38h+var_C] add eax, 1 mov [rsp+38h+var_24], eax loc_2FECE: mov eax, [rsp+38h+var_24] mov [rsp+38h+var_14], eax mov rax, [rsp+38h+var_8] cmp qword ptr [rax], 0 jz short loc_2FEF4 mov rax, [rsp+38h+var_8] mov rax, [rax] add rax, 0FFFFFFFFFFFFFFF8h mov [rsp+38h+var_30], rax jmp short loc_2FEFD loc_2FEF4: xor eax, eax mov [rsp+38h+var_30], rax jmp short $+2 loc_2FEFD: mov rdi, [rsp+38h+var_30] mov eax, [rsp+38h+var_10] imul eax, [rsp+38h+var_14] movsxd rsi, eax add rsi, 8 call _realloc mov [rsp+38h+var_20], rax cmp [rsp+38h+var_20], 0 jz short loc_2FF5B mov rax, [rsp+38h+var_8] cmp qword ptr [rax], 0 jnz short loc_2FF3B mov rax, [rsp+38h+var_20] mov dword ptr [rax+4], 0 loc_2FF3B: mov rcx, [rsp+38h+var_20] add rcx, 8 mov rax, [rsp+38h+var_8] mov [rax], rcx mov ecx, [rsp+38h+var_14] mov rax, [rsp+38h+var_8] mov rax, [rax] mov [rax-8], ecx loc_2FF5B: mov rax, [rsp+38h+var_8] mov rax, [rax] add rsp, 38h retn
_DWORD * stbiw__sbgrowf(void **a1, int a2, int a3) { long long v3; // rax int v5; // [rsp+14h] [rbp-24h] if ( *a1 ) v5 = a2 + 2 * *((_DWORD *)*a1 - 2); else v5 = a2 + 1; if ( *a1 ) v3 = realloc((char *)*a1 - 8, v5 * a3 + 8LL); else v3 = realloc(0LL, v5 * a3 + 8LL); if ( v3 ) { if ( !*a1 ) *(_DWORD *)(v3 + 4) = 0; *a1 = (void *)(v3 + 8); *((_DWORD *)*a1 - 2) = v5; } return *a1; }
stbiw__sbgrowf: SUB RSP,0x38 MOV qword ptr [RSP + 0x30],RDI MOV dword ptr [RSP + 0x2c],ESI MOV dword ptr [RSP + 0x28],EDX MOV RAX,qword ptr [RSP + 0x30] CMP qword ptr [RAX],0x0 JZ 0x0012fec3 MOV RAX,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RAX] MOV EAX,dword ptr [RAX + -0x8] SHL EAX,0x1 ADD EAX,dword ptr [RSP + 0x2c] MOV dword ptr [RSP + 0x14],EAX JMP 0x0012fece LAB_0012fec3: MOV EAX,dword ptr [RSP + 0x2c] ADD EAX,0x1 MOV dword ptr [RSP + 0x14],EAX LAB_0012fece: MOV EAX,dword ptr [RSP + 0x14] MOV dword ptr [RSP + 0x24],EAX MOV RAX,qword ptr [RSP + 0x30] CMP qword ptr [RAX],0x0 JZ 0x0012fef4 MOV RAX,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RAX] ADD RAX,-0x8 MOV qword ptr [RSP + 0x8],RAX JMP 0x0012fefd LAB_0012fef4: XOR EAX,EAX MOV qword ptr [RSP + 0x8],RAX JMP 0x0012fefd LAB_0012fefd: MOV RDI,qword ptr [RSP + 0x8] MOV EAX,dword ptr [RSP + 0x28] IMUL EAX,dword ptr [RSP + 0x24] MOVSXD RSI,EAX ADD RSI,0x8 CALL 0x0010bc50 MOV qword ptr [RSP + 0x18],RAX CMP qword ptr [RSP + 0x18],0x0 JZ 0x0012ff5b MOV RAX,qword ptr [RSP + 0x30] CMP qword ptr [RAX],0x0 JNZ 0x0012ff3b MOV RAX,qword ptr [RSP + 0x18] MOV dword ptr [RAX + 0x4],0x0 LAB_0012ff3b: MOV RCX,qword ptr [RSP + 0x18] ADD RCX,0x8 MOV RAX,qword ptr [RSP + 0x30] MOV qword ptr [RAX],RCX MOV ECX,dword ptr [RSP + 0x24] MOV RAX,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RAX] MOV dword ptr [RAX + -0x8],ECX LAB_0012ff5b: MOV RAX,qword ptr [RSP + 0x30] MOV RAX,qword ptr [RAX] ADD RSP,0x38 RET
/* stbiw__sbgrowf(void**, int, int) */ void * stbiw__sbgrowf(void **param_1,int param_2,int param_3) { void *pvVar1; int8 local_30; int4 local_24; if (*param_1 == (void *)0x0) { local_24 = param_2 + 1; } else { local_24 = *(int *)((long)*param_1 + -8) * 2 + param_2; } if (*param_1 == (void *)0x0) { local_30 = (void *)0x0; } else { local_30 = (void *)((long)*param_1 + -8); } pvVar1 = realloc(local_30,(long)(param_3 * local_24) + 8); if (pvVar1 != (void *)0x0) { if (*param_1 == (void *)0x0) { *(int4 *)((long)pvVar1 + 4) = 0; } *param_1 = (void *)((long)pvVar1 + 8); *(int *)((long)*param_1 + -8) = local_24; } return *param_1; }
2,994
stbiw__sbgrowf(void**, int, int)
7CodeWizard[P]stablediffusion/thirdparty/stb_image_write.h
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) { int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); STBIW_ASSERT(p); if (p) { if (!*arr) ((int *) p)[1] = 0; *arr = (void *) ((int *) p + 2); stbiw__sbm(*arr) = m; } return *arr; }
O2
c
stbiw__sbgrowf(void**, int, int): pushq %rbp pushq %rbx pushq %rax movq %rdi, %rbx movq (%rdi), %rax testq %rax, %rax je 0x19de5 movl -0x8(%rax), %ecx leal 0x1(,%rcx,2), %ebp jmp 0x19de8 pushq $0x2 popq %rbp leaq -0x8(%rax), %rdi testq %rax, %rax cmoveq %rax, %rdi imull %ebp, %esi movslq %esi, %rsi addq $0x8, %rsi callq 0xaa20 testq %rax, %rax je 0x19e1d cmpq $0x0, (%rbx) jne 0x19e11 andl $0x0, 0x4(%rax) movq %rax, %rcx addq $0x8, %rcx movq %rcx, (%rbx) movl %ebp, (%rax) addq $0x8, %rsp popq %rbx popq %rbp retq
_ZL14stbiw__sbgrowfPPvii: push rbp push rbx push rax mov rbx, rdi mov rax, [rdi] test rax, rax jz short loc_19DE5 mov ecx, [rax-8] lea ebp, ds:1[rcx*2] jmp short loc_19DE8 loc_19DE5: push 2 pop rbp loc_19DE8: lea rdi, [rax-8] test rax, rax cmovz rdi, rax imul esi, ebp movsxd rsi, esi add rsi, 8 call _realloc test rax, rax jz short loc_19E1D cmp qword ptr [rbx], 0 jnz short loc_19E11 and dword ptr [rax+4], 0 loc_19E11: mov rcx, rax add rcx, 8 mov [rbx], rcx mov [rax], ebp loc_19E1D: add rsp, 8 pop rbx pop rbp retn
int * stbiw__sbgrowf(void **a1, int a2) { long long v3; // rax int v4; // ebp long long v5; // rdi int *result; // rax v3 = (long long)*a1; if ( *a1 ) v4 = 2 * *(_DWORD *)(v3 - 8) + 1; else v4 = 2; v5 = v3 - 8; if ( !v3 ) v5 = 0LL; result = (int *)realloc(v5, v4 * a2 + 8LL); if ( result ) { if ( !*a1 ) result[1] = 0; *a1 = result + 2; *result = v4; } return result; }
stbiw__sbgrowf: PUSH RBP PUSH RBX PUSH RAX MOV RBX,RDI MOV RAX,qword ptr [RDI] TEST RAX,RAX JZ 0x00119de5 MOV ECX,dword ptr [RAX + -0x8] LEA EBP,[0x1 + RCX*0x2] JMP 0x00119de8 LAB_00119de5: PUSH 0x2 POP RBP LAB_00119de8: LEA RDI,[RAX + -0x8] TEST RAX,RAX CMOVZ RDI,RAX IMUL ESI,EBP MOVSXD RSI,ESI ADD RSI,0x8 CALL 0x0010aa20 TEST RAX,RAX JZ 0x00119e1d CMP qword ptr [RBX],0x0 JNZ 0x00119e11 AND dword ptr [RAX + 0x4],0x0 LAB_00119e11: MOV RCX,RAX ADD RCX,0x8 MOV qword ptr [RBX],RCX MOV dword ptr [RAX],EBP LAB_00119e1d: ADD RSP,0x8 POP RBX POP RBP RET
/* stbiw__sbgrowf(void**, int, int) */ void stbiw__sbgrowf(void **param_1,int param_2,int param_3) { void *pvVar1; int *piVar2; int iVar3; void *__ptr; pvVar1 = *param_1; if (pvVar1 == (void *)0x0) { iVar3 = 2; } else { iVar3 = *(int *)((long)pvVar1 + -8) * 2 + 1; } __ptr = (void *)((long)pvVar1 + -8); if (pvVar1 == (void *)0x0) { __ptr = (void *)0x0; } piVar2 = (int *)realloc(__ptr,(long)(param_2 * iVar3) + 8); if (piVar2 != (int *)0x0) { if (*param_1 == (void *)0x0) { piVar2[1] = 0; } *param_1 = piVar2 + 2; *piVar2 = iVar3; } return; }
2,995
stbiw__sbgrowf(void**, int, int)
7CodeWizard[P]stablediffusion/thirdparty/stb_image_write.h
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) { int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); STBIW_ASSERT(p); if (p) { if (!*arr) ((int *) p)[1] = 0; *arr = (void *) ((int *) p + 2); stbiw__sbm(*arr) = m; } return *arr; }
O3
c
stbiw__sbgrowf(void**, int, int): pushq %rbp pushq %rbx pushq %rax movq %rdi, %rbx movq (%rdi), %rax testq %rax, %rax je 0x2e1b2 movl -0x8(%rax), %ecx leal 0x1(,%rcx,2), %ebp jmp 0x2e1b7 movl $0x2, %ebp leaq -0x8(%rax), %rdi testq %rax, %rax cmoveq %rax, %rdi imull %ebp, %esi movslq %esi, %rsi addq $0x8, %rsi callq 0xaa30 testq %rax, %rax je 0x2e1ef cmpq $0x0, (%rbx) jne 0x2e1e3 movl $0x0, 0x4(%rax) movq %rax, %rcx addq $0x8, %rcx movq %rcx, (%rbx) movl %ebp, (%rax) addq $0x8, %rsp popq %rbx popq %rbp retq
_ZL14stbiw__sbgrowfPPvii: push rbp push rbx push rax mov rbx, rdi mov rax, [rdi] test rax, rax jz short loc_2E1B2 mov ecx, [rax-8] lea ebp, ds:1[rcx*2] jmp short loc_2E1B7 loc_2E1B2: mov ebp, 2 loc_2E1B7: lea rdi, [rax-8] test rax, rax cmovz rdi, rax imul esi, ebp movsxd rsi, esi add rsi, 8 call _realloc test rax, rax jz short loc_2E1EF cmp qword ptr [rbx], 0 jnz short loc_2E1E3 mov dword ptr [rax+4], 0 loc_2E1E3: mov rcx, rax add rcx, 8 mov [rbx], rcx mov [rax], ebp loc_2E1EF: add rsp, 8 pop rbx pop rbp retn
int * stbiw__sbgrowf(void **a1, int a2) { long long v3; // rax int v4; // ebp long long v5; // rdi int *result; // rax v3 = (long long)*a1; if ( *a1 ) v4 = 2 * *(_DWORD *)(v3 - 8) + 1; else v4 = 2; v5 = v3 - 8; if ( !v3 ) v5 = 0LL; result = (int *)realloc(v5, v4 * a2 + 8LL); if ( result ) { if ( !*a1 ) result[1] = 0; *a1 = result + 2; *result = v4; } return result; }
2,996
codegen_generate_sequence
tsotchke[P]eshkol/src/backend/codegen/blocks.c
bool codegen_generate_sequence(CodegenContext* context, const AstNode* node) { assert(context != NULL); assert(node != NULL); assert(node->type == AST_SEQUENCE); // Get output file FILE* output = codegen_context_get_output(context); // Generate code fprintf(output, "({ "); // Generate expressions for (size_t i = 0; i < node->as.sequence.expr_count; i++) { if (i > 0) { fprintf(output, "; "); } // Generate expression if (!codegen_generate_expression(context, node->as.sequence.exprs[i])) { return false; } } // Close sequence fprintf(output, "; })"); return true; }
O2
c
codegen_generate_sequence: pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax testq %rdi, %rdi je 0x1275e movq %rsi, %rbx testq %rsi, %rsi je 0x1277d cmpl $0x1a, (%rbx) jne 0x1279c movq %rdi, %r14 callq 0xa5d5 movq %rax, %r15 leaq 0xaa2f(%rip), %rdi # 0x1d10f pushq $0x3 popq %rsi pushq $0x1 popq %rdx movq %rax, %rcx callq 0x22c0 xorl %ecx, %ecx pushq $0x2 popq %rbp movq %rcx, %r12 movq 0x50(%rbx), %r13 cmpq %r13, %rcx jae 0x12734 testq %r12, %r12 je 0x12719 leaq 0xbd2c(%rip), %rdi # 0x1e437 movq %rbp, %rsi pushq $0x1 popq %rdx movq %r15, %rcx callq 0x22c0 movq 0x48(%rbx), %rax movq (%rax,%r12,8), %rsi movq %r14, %rdi callq 0xf7f8 leaq 0x1(%r12), %rcx testb %al, %al jne 0x126f3 jmp 0x12749 leaq 0xbe84(%rip), %rdi # 0x1e5bf pushq $0x4 popq %rsi pushq $0x1 popq %rdx movq %r15, %rcx callq 0x22c0 cmpq %r13, %r12 setae %al addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x55fa(%rip), %rdi # 0x17d5f leaq 0xc2ce(%rip), %rsi # 0x1ea3a leaq 0xc4ce(%rip), %rcx # 0x1ec41 movl $0xf6, %edx callq 0x2180 leaq 0x714b(%rip), %rdi # 0x198cf leaq 0xc2af(%rip), %rsi # 0x1ea3a leaq 0xc4af(%rip), %rcx # 0x1ec41 movl $0xf7, %edx callq 0x2180 leaq 0xc4e1(%rip), %rdi # 0x1ec84 leaq 0xc290(%rip), %rsi # 0x1ea3a leaq 0xc490(%rip), %rcx # 0x1ec41 movl $0xf8, %edx callq 0x2180
codegen_generate_sequence: push rbp push r15 push r14 push r13 push r12 push rbx push rax test rdi, rdi jz loc_1275E mov rbx, rsi test rsi, rsi jz loc_1277D cmp dword ptr [rbx], 1Ah jnz loc_1279C mov r14, rdi call codegen_context_get_output mov r15, rax lea rdi, asc_1D10F; "({ " push 3 pop rsi push 1 pop rdx mov rcx, rax call _fwrite xor ecx, ecx push 2 pop rbp loc_126F3: mov r12, rcx mov r13, [rbx+50h] cmp rcx, r13 jnb short loc_12734 test r12, r12 jz short loc_12719 lea rdi, aCharBuffer1024+19h; "; " mov rsi, rbp push 1 pop rdx mov rcx, r15 call _fwrite loc_12719: mov rax, [rbx+48h] mov rsi, [rax+r12*8] mov rdi, r14 call codegen_generate_expression lea rcx, [r12+1] test al, al jnz short loc_126F3 jmp short loc_12749 loc_12734: lea rdi, aVectorFGetComp_0+4Eh; "; })" push 4 pop rsi push 1 pop rdx mov rcx, r15 call _fwrite loc_12749: cmp r12, r13 setnb al add rsp, 8 pop rbx pop r12 pop r13 pop r14 pop r15 pop rbp retn loc_1275E: lea rdi, aContextNull; "context != NULL" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F6h call ___assert_fail loc_1277D: lea rdi, aNodeNull; "node != NULL" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F7h call ___assert_fail loc_1279C: lea rdi, aNodeTypeAstSeq; "node->type == AST_SEQUENCE" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F8h call ___assert_fail
bool codegen_generate_sequence(long long a1, long long a2) { long long output; // r15 unsigned long long v3; // rcx unsigned long long v4; // r12 unsigned long long v5; // r13 char expression; // al if ( !a1 ) __assert_fail( "context != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 246LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); if ( !a2 ) __assert_fail( "node != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 247LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); if ( *(_DWORD *)a2 != 26 ) __assert_fail( "node->type == AST_SEQUENCE", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 248LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); output = codegen_context_get_output(a1); fwrite("({ ", 3LL, 1LL, output); v3 = 0LL; while ( 1 ) { v4 = v3; v5 = *(_QWORD *)(a2 + 80); if ( v3 >= v5 ) break; if ( v3 ) fwrite("; ", 2LL, 1LL, output); expression = codegen_generate_expression(a1, *(_DWORD **)(*(_QWORD *)(a2 + 72) + 8 * v4)); v3 = v4 + 1; if ( !expression ) return v4 >= v5; } fwrite("; })", 4LL, 1LL, output); return v4 >= v5; }
codegen_generate_sequence: PUSH RBP PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX PUSH RAX TEST RDI,RDI JZ 0x0011275e MOV RBX,RSI TEST RSI,RSI JZ 0x0011277d CMP dword ptr [RBX],0x1a JNZ 0x0011279c MOV R14,RDI CALL 0x0010a5d5 MOV R15,RAX LEA RDI,[0x11d10f] PUSH 0x3 POP RSI PUSH 0x1 POP RDX MOV RCX,RAX CALL 0x001022c0 XOR ECX,ECX PUSH 0x2 POP RBP LAB_001126f3: MOV R12,RCX MOV R13,qword ptr [RBX + 0x50] CMP RCX,R13 JNC 0x00112734 TEST R12,R12 JZ 0x00112719 LEA RDI,[0x11e437] MOV RSI,RBP PUSH 0x1 POP RDX MOV RCX,R15 CALL 0x001022c0 LAB_00112719: MOV RAX,qword ptr [RBX + 0x48] MOV RSI,qword ptr [RAX + R12*0x8] MOV RDI,R14 CALL 0x0010f7f8 LEA RCX,[R12 + 0x1] TEST AL,AL JNZ 0x001126f3 JMP 0x00112749 LAB_00112734: LEA RDI,[0x11e5bf] PUSH 0x4 POP RSI PUSH 0x1 POP RDX MOV RCX,R15 CALL 0x001022c0 LAB_00112749: CMP R12,R13 SETNC AL ADD RSP,0x8 POP RBX POP R12 POP R13 POP R14 POP R15 POP RBP RET LAB_0011275e: LEA RDI,[0x117d5f] LEA RSI,[0x11ea3a] LEA RCX,[0x11ec41] MOV EDX,0xf6 CALL 0x00102180 LAB_0011277d: LEA RDI,[0x1198cf] LEA RSI,[0x11ea3a] LEA RCX,[0x11ec41] MOV EDX,0xf7 CALL 0x00102180 LAB_0011279c: LEA RDI,[0x11ec84] LEA RSI,[0x11ea3a] LEA RCX,[0x11ec41] MOV EDX,0xf8 CALL 0x00102180
bool codegen_generate_sequence(long param_1,int *param_2) { ulong uVar1; ulong uVar2; char cVar3; FILE *__s; ulong uVar4; if (param_1 == 0) { /* WARNING: Subroutine does not return */ __assert_fail("context != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf6,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); } if (param_2 == (int *)0x0) { /* WARNING: Subroutine does not return */ __assert_fail("node != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf7,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); } if (*param_2 != 0x1a) { /* WARNING: Subroutine does not return */ __assert_fail("node->type == AST_SEQUENCE", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf8,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); } __s = (FILE *)codegen_context_get_output(); fwrite(&DAT_0011d10f,3,1,__s); uVar2 = 0; do { uVar4 = uVar2; uVar1 = *(ulong *)(param_2 + 0x14); if (uVar1 <= uVar4) { fwrite("; })",4,1,__s); break; } if (uVar4 != 0) { fwrite("; ",2,1,__s); } cVar3 = codegen_generate_expression (param_1,*(int8 *)(*(long *)(param_2 + 0x12) + uVar4 * 8)); uVar2 = uVar4 + 1; } while (cVar3 != '\0'); return uVar1 <= uVar4; }
2,997
codegen_generate_sequence
tsotchke[P]eshkol/src/backend/codegen/blocks.c
bool codegen_generate_sequence(CodegenContext* context, const AstNode* node) { assert(context != NULL); assert(node != NULL); assert(node->type == AST_SEQUENCE); // Get output file FILE* output = codegen_context_get_output(context); // Generate code fprintf(output, "({ "); // Generate expressions for (size_t i = 0; i < node->as.sequence.expr_count; i++) { if (i > 0) { fprintf(output, "; "); } // Generate expression if (!codegen_generate_expression(context, node->as.sequence.exprs[i])) { return false; } } // Close sequence fprintf(output, "; })"); return true; }
O3
c
codegen_generate_sequence: pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx testq %rdi, %rdi je 0x140a4 movq %rsi, %rbx testq %rsi, %rsi je 0x140c3 cmpl $0x1a, (%rbx) jne 0x140e2 movq %rdi, %r14 callq 0xb394 movq %rax, %r15 leaq 0xb088(%rip), %rdi # 0x1f0a9 movl $0x3, %esi movl $0x1, %edx movq %rax, %rcx callq 0x22c0 cmpq $0x0, 0x50(%rbx) je 0x1407b xorl %r13d, %r13d leaq 0xc38b(%rip), %r12 # 0x203cf testq %r13, %r13 je 0x1405e movl $0x2, %esi movl $0x1, %edx movq %r12, %rdi movq %r15, %rcx callq 0x22c0 movq 0x48(%rbx), %rax movq (%rax,%r13,8), %rsi movq %r14, %rdi callq 0x10f0c testb %al, %al je 0x14098 incq %r13 cmpq 0x50(%rbx), %r13 jb 0x14044 leaq 0xc4d5(%rip), %rdi # 0x20557 movl $0x4, %esi movl $0x1, %edx movq %r15, %rcx callq 0x22c0 movb $0x1, %al jmp 0x1409a xorl %eax, %eax popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq leaq 0x5cb4(%rip), %rdi # 0x19d5f leaq 0xc920(%rip), %rsi # 0x209d2 leaq 0xcb20(%rip), %rcx # 0x20bd9 movl $0xf6, %edx callq 0x2180 leaq 0x7805(%rip), %rdi # 0x1b8cf leaq 0xc901(%rip), %rsi # 0x209d2 leaq 0xcb01(%rip), %rcx # 0x20bd9 movl $0xf7, %edx callq 0x2180 leaq 0xcb33(%rip), %rdi # 0x20c1c leaq 0xc8e2(%rip), %rsi # 0x209d2 leaq 0xcae2(%rip), %rcx # 0x20bd9 movl $0xf8, %edx callq 0x2180
codegen_generate_sequence: push r15 push r14 push r13 push r12 push rbx test rdi, rdi jz loc_140A4 mov rbx, rsi test rsi, rsi jz loc_140C3 cmp dword ptr [rbx], 1Ah jnz loc_140E2 mov r14, rdi call codegen_context_get_output mov r15, rax lea rdi, asc_1F0A9; "({ " mov esi, 3 mov edx, 1 mov rcx, rax call _fwrite cmp qword ptr [rbx+50h], 0 jz short loc_1407B xor r13d, r13d lea r12, aCharBuffer1024+19h; "; " loc_14044: test r13, r13 jz short loc_1405E mov esi, 2 mov edx, 1 mov rdi, r12 mov rcx, r15 call _fwrite loc_1405E: mov rax, [rbx+48h] mov rsi, [rax+r13*8] mov rdi, r14 call codegen_generate_expression test al, al jz short loc_14098 inc r13 cmp r13, [rbx+50h] jb short loc_14044 loc_1407B: lea rdi, aVectorFGetComp_0+4Eh; "; })" mov esi, 4 mov edx, 1 mov rcx, r15 call _fwrite mov al, 1 jmp short loc_1409A loc_14098: xor eax, eax loc_1409A: pop rbx pop r12 pop r13 pop r14 pop r15 retn loc_140A4: lea rdi, aContextNull; "context != NULL" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F6h call ___assert_fail loc_140C3: lea rdi, aNodeNull; "node != NULL" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F7h call ___assert_fail loc_140E2: lea rdi, aNodeTypeAstSeq; "node->type == AST_SEQUENCE" lea rsi, aWorkspaceLlm4b_20; "/workspace/llm4binary/github/2025_star3"... lea rcx, aBoolCodegenGen_25; "_Bool codegen_generate_sequence(Codegen"... mov edx, 0F8h call ___assert_fail
char codegen_generate_sequence(long long a1, long long a2) { long long output; // r15 long long v3; // r13 if ( !a1 ) __assert_fail( "context != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 246LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); if ( !a2 ) __assert_fail( "node != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 247LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); if ( *(_DWORD *)a2 != 26 ) __assert_fail( "node->type == AST_SEQUENCE", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c", 248LL, "_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); output = codegen_context_get_output(a1); fwrite("({ ", 3LL, 1LL, output); if ( *(_QWORD *)(a2 + 80) ) { v3 = 0LL; while ( 1 ) { if ( v3 ) fwrite("; ", 2LL, 1LL, output); if ( !(unsigned __int8)codegen_generate_expression(a1, *(_DWORD **)(*(_QWORD *)(a2 + 72) + 8 * v3)) ) return 0; if ( (unsigned long long)++v3 >= *(_QWORD *)(a2 + 80) ) goto LABEL_10; } } else { LABEL_10: fwrite("; })", 4LL, 1LL, output); return 1; } }
codegen_generate_sequence: PUSH R15 PUSH R14 PUSH R13 PUSH R12 PUSH RBX TEST RDI,RDI JZ 0x001140a4 MOV RBX,RSI TEST RSI,RSI JZ 0x001140c3 CMP dword ptr [RBX],0x1a JNZ 0x001140e2 MOV R14,RDI CALL 0x0010b394 MOV R15,RAX LEA RDI,[0x11f0a9] MOV ESI,0x3 MOV EDX,0x1 MOV RCX,RAX CALL 0x001022c0 CMP qword ptr [RBX + 0x50],0x0 JZ 0x0011407b XOR R13D,R13D LEA R12,[0x1203cf] LAB_00114044: TEST R13,R13 JZ 0x0011405e MOV ESI,0x2 MOV EDX,0x1 MOV RDI,R12 MOV RCX,R15 CALL 0x001022c0 LAB_0011405e: MOV RAX,qword ptr [RBX + 0x48] MOV RSI,qword ptr [RAX + R13*0x8] MOV RDI,R14 CALL 0x00110f0c TEST AL,AL JZ 0x00114098 INC R13 CMP R13,qword ptr [RBX + 0x50] JC 0x00114044 LAB_0011407b: LEA RDI,[0x120557] MOV ESI,0x4 MOV EDX,0x1 MOV RCX,R15 CALL 0x001022c0 MOV AL,0x1 JMP 0x0011409a LAB_00114098: XOR EAX,EAX LAB_0011409a: POP RBX POP R12 POP R13 POP R14 POP R15 RET LAB_001140a4: LEA RDI,[0x119d5f] LEA RSI,[0x1209d2] LEA RCX,[0x120bd9] MOV EDX,0xf6 CALL 0x00102180 LAB_001140c3: LEA RDI,[0x11b8cf] LEA RSI,[0x1209d2] LEA RCX,[0x120bd9] MOV EDX,0xf7 CALL 0x00102180 LAB_001140e2: LEA RDI,[0x120c1c] LEA RSI,[0x1209d2] LEA RCX,[0x120bd9] MOV EDX,0xf8 CALL 0x00102180
int8 codegen_generate_sequence(long param_1,int *param_2) { char cVar1; FILE *__s; ulong uVar2; if (param_1 == 0) { /* WARNING: Subroutine does not return */ __assert_fail("context != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf6,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); } if (param_2 != (int *)0x0) { if (*param_2 != 0x1a) { /* WARNING: Subroutine does not return */ __assert_fail("node->type == AST_SEQUENCE", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf8,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); } __s = (FILE *)codegen_context_get_output(); fwrite(&DAT_0011f0a9,3,1,__s); if (*(long *)(param_2 + 0x14) != 0) { uVar2 = 0; do { if (uVar2 != 0) { fwrite("; ",2,1,__s); } cVar1 = codegen_generate_expression (param_1,*(int8 *)(*(long *)(param_2 + 0x12) + uVar2 * 8)); if (cVar1 == '\0') { return 0; } uVar2 = uVar2 + 1; } while (uVar2 < *(ulong *)(param_2 + 0x14)); } fwrite("; })",4,1,__s); return 1; } /* WARNING: Subroutine does not return */ __assert_fail("node != NULL", "/workspace/llm4binary/github/2025_star3/tsotchke[P]eshkol/src/backend/codegen/blocks.c" ,0xf7,"_Bool codegen_generate_sequence(CodegenContext *, const AstNode *)"); }
2,998
ma_keylength
eloqsql/storage/maria/ma_search.c
uint _ma_keylength(MARIA_KEYDEF *keyinfo, const uchar *key) { reg1 HA_KEYSEG *keyseg; const uchar *start; if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) return (keyinfo->keylength); start= key; for (keyseg=keyinfo->seg ; keyseg->type ; keyseg++) { if (keyseg->flag & HA_NULL_PART) if (!*key++) continue; if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH_PART)) { uint length; get_key_length(length,key); key+=length; } else key+= keyseg->length; } return((uint) (key-start)+keyseg->length); }
O3
c
ma_keylength: testb $0x28, 0xa2(%rdi) je 0x3e882 pushq %rbp movq %rsp, %rbp movq 0xc0(%rdi), %rax cmpb $0x0, 0x18(%rax) je 0x3e88a movq %rsi, %rcx movzwl 0x12(%rax), %edx testb $0x10, %dl je 0x3e83f cmpb $0x0, (%rcx) leaq 0x1(%rcx), %rcx je 0x3e873 testb $0x29, %dl je 0x3e857 movzbl (%rcx), %edx cmpq $0xff, %rdx je 0x3e85d movl $0x1, %edi jmp 0x3e86d movzwl 0x14(%rax), %edx jmp 0x3e870 movzwl 0x1(%rcx), %edx rolw $0x8, %dx movzwl %dx, %edx movl $0x3, %edi addq %rdi, %rcx addq %rdx, %rcx leaq 0x20(%rax), %rdx cmpb $0x0, 0x38(%rax) movq %rdx, %rax jne 0x3e82d jmp 0x3e890 movzwl 0xaa(%rdi), %eax retq movq %rsi, %rcx movq %rax, %rdx subl %esi, %ecx movzwl 0x14(%rdx), %eax addl %ecx, %eax popq %rbp retq
_ma_keylength: test byte ptr [rdi+0A2h], 28h jz short loc_3E882 push rbp mov rbp, rsp mov rax, [rdi+0C0h] cmp byte ptr [rax+18h], 0 jz short loc_3E88A mov rcx, rsi loc_3E82D: movzx edx, word ptr [rax+12h] test dl, 10h jz short loc_3E83F cmp byte ptr [rcx], 0 lea rcx, [rcx+1] jz short loc_3E873 loc_3E83F: test dl, 29h jz short loc_3E857 movzx edx, byte ptr [rcx] cmp rdx, 0FFh jz short loc_3E85D mov edi, 1 jmp short loc_3E86D loc_3E857: movzx edx, word ptr [rax+14h] jmp short loc_3E870 loc_3E85D: movzx edx, word ptr [rcx+1] rol dx, 8 movzx edx, dx mov edi, 3 loc_3E86D: add rcx, rdi loc_3E870: add rcx, rdx loc_3E873: lea rdx, [rax+20h] cmp byte ptr [rax+38h], 0 mov rax, rdx jnz short loc_3E82D jmp short loc_3E890 loc_3E882: movzx eax, word ptr [rdi+0AAh] retn loc_3E88A: mov rcx, rsi mov rdx, rax loc_3E890: sub ecx, esi movzx eax, word ptr [rdx+14h] add eax, ecx pop rbp retn
long long ma_keylength(long long a1, unsigned __int8 *a2) { long long v2; // rax unsigned __int8 *v3; // rcx __int16 v4; // dx bool v5; // zf long long v6; // rdx long long v7; // rdi long long v8; // rdx if ( (*(_BYTE *)(a1 + 162) & 0x28) == 0 ) return *(unsigned __int16 *)(a1 + 170); v2 = *(_QWORD *)(a1 + 192); if ( *(_BYTE *)(v2 + 24) ) { v3 = a2; do { v4 = *(_WORD *)(v2 + 18); if ( (v4 & 0x10) == 0 || (v5 = *v3 == 0, ++v3, !v5) ) { if ( (v4 & 0x29) != 0 ) { v6 = *v3; if ( v6 == 255 ) { v6 = (unsigned __int16)__ROL2__(*(_WORD *)(v3 + 1), 8); v7 = 3LL; } else { v7 = 1LL; } v3 += v7; } else { v6 = *(unsigned __int16 *)(v2 + 20); } v3 += v6; } v8 = v2 + 32; v5 = *(_BYTE *)(v2 + 56) == 0; v2 += 32LL; } while ( !v5 ); } else { LODWORD(v3) = (_DWORD)a2; v8 = *(_QWORD *)(a1 + 192); } return (_DWORD)v3 - (_DWORD)a2 + (unsigned int)*(unsigned __int16 *)(v8 + 20); }
_ma_keylength: TEST byte ptr [RDI + 0xa2],0x28 JZ 0x0013e882 PUSH RBP MOV RBP,RSP MOV RAX,qword ptr [RDI + 0xc0] CMP byte ptr [RAX + 0x18],0x0 JZ 0x0013e88a MOV RCX,RSI LAB_0013e82d: MOVZX EDX,word ptr [RAX + 0x12] TEST DL,0x10 JZ 0x0013e83f CMP byte ptr [RCX],0x0 LEA RCX,[RCX + 0x1] JZ 0x0013e873 LAB_0013e83f: TEST DL,0x29 JZ 0x0013e857 MOVZX EDX,byte ptr [RCX] CMP RDX,0xff JZ 0x0013e85d MOV EDI,0x1 JMP 0x0013e86d LAB_0013e857: MOVZX EDX,word ptr [RAX + 0x14] JMP 0x0013e870 LAB_0013e85d: MOVZX EDX,word ptr [RCX + 0x1] ROL DX,0x8 MOVZX EDX,DX MOV EDI,0x3 LAB_0013e86d: ADD RCX,RDI LAB_0013e870: ADD RCX,RDX LAB_0013e873: LEA RDX,[RAX + 0x20] CMP byte ptr [RAX + 0x38],0x0 MOV RAX,RDX JNZ 0x0013e82d JMP 0x0013e890 LAB_0013e882: MOVZX EAX,word ptr [RDI + 0xaa] RET LAB_0013e88a: MOV RCX,RSI MOV RDX,RAX LAB_0013e890: SUB ECX,ESI MOVZX EAX,word ptr [RDX + 0x14] ADD EAX,ECX POP RBP RET
uint _ma_keylength(long param_1,byte *param_2) { char cVar1; byte bVar2; long lVar3; ulong uVar4; int iVar5; long lVar6; iVar5 = (int)param_2; if ((*(byte *)(param_1 + 0xa2) & 0x28) == 0) { return (uint)*(ushort *)(param_1 + 0xaa); } cVar1 = *(char *)(*(long *)(param_1 + 0xc0) + 0x18); lVar3 = *(long *)(param_1 + 0xc0); while (cVar1 != '\0') { if (((*(ushort *)(lVar3 + 0x12) & 0x10) == 0) || (bVar2 = *param_2, param_2 = param_2 + 1, bVar2 != 0)) { if ((*(ushort *)(lVar3 + 0x12) & 0x29) == 0) { uVar4 = (ulong)*(ushort *)(lVar3 + 0x14); } else { uVar4 = (ulong)*param_2; if (uVar4 == 0xff) { uVar4 = (ulong)(ushort)(*(ushort *)(param_2 + 1) << 8 | *(ushort *)(param_2 + 1) >> 8); lVar6 = 3; } else { lVar6 = 1; } param_2 = param_2 + lVar6; } param_2 = param_2 + uVar4; } cVar1 = *(char *)(lVar3 + 0x38); lVar3 = lVar3 + 0x20; } return (uint)*(ushort *)(lVar3 + 0x14) + ((int)param_2 - iVar5); }
2,999
my_convert_using_func
eloqsql/strings/ctype.c
uint32 my_convert_using_func(char *to, size_t to_length, CHARSET_INFO *to_cs, my_charset_conv_wc_mb wc_mb, const char *from, size_t from_length, CHARSET_INFO *from_cs, my_charset_conv_mb_wc mb_wc, uint *errors) { int cnvres; my_wc_t wc; const uchar *from_end= (const uchar*) from + from_length; char *to_start= to; uchar *to_end= (uchar*) to + to_length; uint error_count= 0; while (1) { if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from, from_end)) > 0) from+= cnvres; else if (cnvres == MY_CS_ILSEQ) { error_count++; from++; wc= '?'; } else if (cnvres > MY_CS_TOOSMALL) { /* A correct multibyte sequence detected But it doesn't have Unicode mapping. */ error_count++; from+= (-cnvres); wc= '?'; } else { if ((uchar *) from >= from_end) break; /* End of line */ /* Incomplete byte sequence */ error_count++; from++; wc= '?'; } outp: if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0) to+= cnvres; else if (cnvres == MY_CS_ILUNI && wc != '?') { error_count++; wc= '?'; goto outp; } else break; } *errors= error_count; return (uint32) (to - to_start); }
O0
c
my_convert_using_func: pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq 0x20(%rbp), %rax movq 0x18(%rbp), %rax movq 0x10(%rbp), %rax movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movq %rcx, -0x20(%rbp) movq %r8, -0x28(%rbp) movq %r9, -0x30(%rbp) movq -0x28(%rbp), %rax addq -0x30(%rbp), %rax movq %rax, -0x48(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x50(%rbp) movq -0x8(%rbp), %rax addq -0x10(%rbp), %rax movq %rax, -0x58(%rbp) movl $0x0, -0x5c(%rbp) movq 0x18(%rbp), %rax movq 0x10(%rbp), %rdi movq -0x28(%rbp), %rdx movq -0x48(%rbp), %rcx leaq -0x40(%rbp), %rsi callq *%rax movl %eax, -0x34(%rbp) cmpl $0x0, %eax jle 0x81de4 movl -0x34(%rbp), %ecx movq -0x28(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -0x28(%rbp) jmp 0x81e62 cmpl $0x0, -0x34(%rbp) jne 0x81e09 movl -0x5c(%rbp), %eax addl $0x1, %eax movl %eax, -0x5c(%rbp) movq -0x28(%rbp), %rax addq $0x1, %rax movq %rax, -0x28(%rbp) movq $0x3f, -0x40(%rbp) jmp 0x81e60 cmpl $-0x65, -0x34(%rbp) jle 0x81e35 movl -0x5c(%rbp), %eax addl $0x1, %eax movl %eax, -0x5c(%rbp) xorl %ecx, %ecx subl -0x34(%rbp), %ecx movq -0x28(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -0x28(%rbp) movq $0x3f, -0x40(%rbp) jmp 0x81e5e movq -0x28(%rbp), %rax cmpq -0x48(%rbp), %rax jb 0x81e41 jmp 0x81ebc movl -0x5c(%rbp), %eax addl $0x1, %eax movl %eax, -0x5c(%rbp) movq -0x28(%rbp), %rax addq $0x1, %rax movq %rax, -0x28(%rbp) movq $0x3f, -0x40(%rbp) jmp 0x81e60 jmp 0x81e62 jmp 0x81e64 movq -0x20(%rbp), %rax movq -0x18(%rbp), %rdi movq -0x40(%rbp), %rsi movq -0x8(%rbp), %rdx movq -0x58(%rbp), %rcx callq *%rax movl %eax, -0x34(%rbp) cmpl $0x0, %eax jle 0x81e95 movl -0x34(%rbp), %ecx movq -0x8(%rbp), %rax movslq %ecx, %rcx addq %rcx, %rax movq %rax, -0x8(%rbp) jmp 0x81eb7 cmpl $0x0, -0x34(%rbp) jne 0x81eb5 cmpq $0x3f, -0x40(%rbp) je 0x81eb5 movl -0x5c(%rbp), %eax addl $0x1, %eax movl %eax, -0x5c(%rbp) movq $0x3f, -0x40(%rbp) jmp 0x81e64 jmp 0x81ebc jmp 0x81db3 movl -0x5c(%rbp), %ecx movq 0x20(%rbp), %rax movl %ecx, (%rax) movq -0x8(%rbp), %rax movq -0x50(%rbp), %rcx subq %rcx, %rax addq $0x60, %rsp popq %rbp retq nopw %cs:(%rax,%rax)
my_convert_using_func: push rbp mov rbp, rsp sub rsp, 60h mov rax, [rbp+arg_10] mov rax, [rbp+arg_8] mov rax, [rbp+arg_0] mov [rbp+var_8], rdi mov [rbp+var_10], rsi mov [rbp+var_18], rdx mov [rbp+var_20], rcx mov [rbp+var_28], r8 mov [rbp+var_30], r9 mov rax, [rbp+var_28] add rax, [rbp+var_30] mov [rbp+var_48], rax mov rax, [rbp+var_8] mov [rbp+var_50], rax mov rax, [rbp+var_8] add rax, [rbp+var_10] mov [rbp+var_58], rax mov [rbp+var_5C], 0 loc_81DB3: mov rax, [rbp+arg_8] mov rdi, [rbp+arg_0] mov rdx, [rbp+var_28] mov rcx, [rbp+var_48] lea rsi, [rbp+var_40] call rax mov [rbp+var_34], eax cmp eax, 0 jle short loc_81DE4 mov ecx, [rbp+var_34] mov rax, [rbp+var_28] movsxd rcx, ecx add rax, rcx mov [rbp+var_28], rax jmp short loc_81E62 loc_81DE4: cmp [rbp+var_34], 0 jnz short loc_81E09 mov eax, [rbp+var_5C] add eax, 1 mov [rbp+var_5C], eax mov rax, [rbp+var_28] add rax, 1 mov [rbp+var_28], rax mov [rbp+var_40], 3Fh ; '?' jmp short loc_81E60 loc_81E09: cmp [rbp+var_34], 0FFFFFF9Bh jle short loc_81E35 mov eax, [rbp+var_5C] add eax, 1 mov [rbp+var_5C], eax xor ecx, ecx sub ecx, [rbp+var_34] mov rax, [rbp+var_28] movsxd rcx, ecx add rax, rcx mov [rbp+var_28], rax mov [rbp+var_40], 3Fh ; '?' jmp short loc_81E5E loc_81E35: mov rax, [rbp+var_28] cmp rax, [rbp+var_48] jb short loc_81E41 jmp short loc_81EBC loc_81E41: mov eax, [rbp+var_5C] add eax, 1 mov [rbp+var_5C], eax mov rax, [rbp+var_28] add rax, 1 mov [rbp+var_28], rax mov [rbp+var_40], 3Fh ; '?' loc_81E5E: jmp short $+2 loc_81E60: jmp short $+2 loc_81E62: jmp short $+2 loc_81E64: mov rax, [rbp+var_20] mov rdi, [rbp+var_18] mov rsi, [rbp+var_40] mov rdx, [rbp+var_8] mov rcx, [rbp+var_58] call rax mov [rbp+var_34], eax cmp eax, 0 jle short loc_81E95 mov ecx, [rbp+var_34] mov rax, [rbp+var_8] movsxd rcx, ecx add rax, rcx mov [rbp+var_8], rax jmp short loc_81EB7 loc_81E95: cmp [rbp+var_34], 0 jnz short loc_81EB5 cmp [rbp+var_40], 3Fh ; '?' jz short loc_81EB5 mov eax, [rbp+var_5C] add eax, 1 mov [rbp+var_5C], eax mov [rbp+var_40], 3Fh ; '?' jmp short loc_81E64 loc_81EB5: jmp short loc_81EBC loc_81EB7: jmp loc_81DB3 loc_81EBC: mov ecx, [rbp+var_5C] mov rax, [rbp+arg_10] mov [rax], ecx mov rax, [rbp+var_8] mov rcx, [rbp+var_50] sub rax, rcx add rsp, 60h pop rbp retn
long long my_convert_using_func( long long a1, long long a2, long long a3, long long ( *a4)(long long, long long, long long, long long), unsigned long long a5, long long a6, long long a7, long long ( *a8)(long long, long long *, unsigned long long, unsigned long long), _DWORD *a9) { int v10; // [rsp+4h] [rbp-5Ch] unsigned long long v11; // [rsp+18h] [rbp-48h] long long v12; // [rsp+20h] [rbp-40h] BYREF int v13; // [rsp+2Ch] [rbp-34h] long long v14; // [rsp+30h] [rbp-30h] unsigned long long v15; // [rsp+38h] [rbp-28h] long long ( *v16)(long long, long long, long long, long long); // [rsp+40h] [rbp-20h] long long v17; // [rsp+48h] [rbp-18h] long long v18; // [rsp+50h] [rbp-10h] long long v19; // [rsp+58h] [rbp-8h] v19 = a1; v18 = a2; v17 = a3; v16 = a4; v15 = a5; v14 = a6; v11 = a6 + a5; v10 = 0; while ( 1 ) { v13 = a8(a7, &v12, v15, v11); if ( v13 > 0 ) { v15 += v13; goto LABEL_10; } if ( !v13 ) { ++v10; ++v15; v12 = 63LL; goto LABEL_10; } if ( v13 > -101 ) { ++v10; v15 += -v13; v12 = 63LL; goto LABEL_10; } if ( v15 >= v11 ) break; ++v10; ++v15; v12 = 63LL; LABEL_10: while ( 1 ) { v13 = v16(v17, v12, v19, a2 + a1); if ( v13 > 0 ) break; if ( v13 || v12 == 63 ) goto LABEL_15; ++v10; v12 = 63LL; } v19 += v13; } LABEL_15: *a9 = v10; return v19 - a1; }
my_convert_using_func: PUSH RBP MOV RBP,RSP SUB RSP,0x60 MOV RAX,qword ptr [RBP + 0x20] MOV RAX,qword ptr [RBP + 0x18] MOV RAX,qword ptr [RBP + 0x10] MOV qword ptr [RBP + -0x8],RDI MOV qword ptr [RBP + -0x10],RSI MOV qword ptr [RBP + -0x18],RDX MOV qword ptr [RBP + -0x20],RCX MOV qword ptr [RBP + -0x28],R8 MOV qword ptr [RBP + -0x30],R9 MOV RAX,qword ptr [RBP + -0x28] ADD RAX,qword ptr [RBP + -0x30] MOV qword ptr [RBP + -0x48],RAX MOV RAX,qword ptr [RBP + -0x8] MOV qword ptr [RBP + -0x50],RAX MOV RAX,qword ptr [RBP + -0x8] ADD RAX,qword ptr [RBP + -0x10] MOV qword ptr [RBP + -0x58],RAX MOV dword ptr [RBP + -0x5c],0x0 LAB_00181db3: MOV RAX,qword ptr [RBP + 0x18] MOV RDI,qword ptr [RBP + 0x10] MOV RDX,qword ptr [RBP + -0x28] MOV RCX,qword ptr [RBP + -0x48] LEA RSI,[RBP + -0x40] CALL RAX MOV dword ptr [RBP + -0x34],EAX CMP EAX,0x0 JLE 0x00181de4 MOV ECX,dword ptr [RBP + -0x34] MOV RAX,qword ptr [RBP + -0x28] MOVSXD RCX,ECX ADD RAX,RCX MOV qword ptr [RBP + -0x28],RAX JMP 0x00181e62 LAB_00181de4: CMP dword ptr [RBP + -0x34],0x0 JNZ 0x00181e09 MOV EAX,dword ptr [RBP + -0x5c] ADD EAX,0x1 MOV dword ptr [RBP + -0x5c],EAX MOV RAX,qword ptr [RBP + -0x28] ADD RAX,0x1 MOV qword ptr [RBP + -0x28],RAX MOV qword ptr [RBP + -0x40],0x3f JMP 0x00181e60 LAB_00181e09: CMP dword ptr [RBP + -0x34],-0x65 JLE 0x00181e35 MOV EAX,dword ptr [RBP + -0x5c] ADD EAX,0x1 MOV dword ptr [RBP + -0x5c],EAX XOR ECX,ECX SUB ECX,dword ptr [RBP + -0x34] MOV RAX,qword ptr [RBP + -0x28] MOVSXD RCX,ECX ADD RAX,RCX MOV qword ptr [RBP + -0x28],RAX MOV qword ptr [RBP + -0x40],0x3f JMP 0x00181e5e LAB_00181e35: MOV RAX,qword ptr [RBP + -0x28] CMP RAX,qword ptr [RBP + -0x48] JC 0x00181e41 JMP 0x00181ebc LAB_00181e41: MOV EAX,dword ptr [RBP + -0x5c] ADD EAX,0x1 MOV dword ptr [RBP + -0x5c],EAX MOV RAX,qword ptr [RBP + -0x28] ADD RAX,0x1 MOV qword ptr [RBP + -0x28],RAX MOV qword ptr [RBP + -0x40],0x3f LAB_00181e5e: JMP 0x00181e60 LAB_00181e60: JMP 0x00181e62 LAB_00181e62: JMP 0x00181e64 LAB_00181e64: MOV RAX,qword ptr [RBP + -0x20] MOV RDI,qword ptr [RBP + -0x18] MOV RSI,qword ptr [RBP + -0x40] MOV RDX,qword ptr [RBP + -0x8] MOV RCX,qword ptr [RBP + -0x58] CALL RAX MOV dword ptr [RBP + -0x34],EAX CMP EAX,0x0 JLE 0x00181e95 MOV ECX,dword ptr [RBP + -0x34] MOV RAX,qword ptr [RBP + -0x8] MOVSXD RCX,ECX ADD RAX,RCX MOV qword ptr [RBP + -0x8],RAX JMP 0x00181eb7 LAB_00181e95: CMP dword ptr [RBP + -0x34],0x0 JNZ 0x00181eb5 CMP qword ptr [RBP + -0x40],0x3f JZ 0x00181eb5 MOV EAX,dword ptr [RBP + -0x5c] ADD EAX,0x1 MOV dword ptr [RBP + -0x5c],EAX MOV qword ptr [RBP + -0x40],0x3f JMP 0x00181e64 LAB_00181eb5: JMP 0x00181ebc LAB_00181eb7: JMP 0x00181db3 LAB_00181ebc: MOV ECX,dword ptr [RBP + -0x5c] MOV RAX,qword ptr [RBP + 0x20] MOV dword ptr [RAX],ECX MOV RAX,qword ptr [RBP + -0x8] MOV RCX,qword ptr [RBP + -0x50] SUB RAX,RCX ADD RSP,0x60 POP RBP RET
long my_convert_using_func (long param_1,long param_2,int8 param_3,code *param_4,ulong param_5, long param_6,int8 param_7,code *param_8,int *param_9) { int local_64; long local_48; int local_3c; long local_38; ulong local_30; code *local_28; int8 local_20; long local_18; long local_10; local_64 = 0; local_38 = param_6; local_30 = param_5; local_28 = param_4; local_20 = param_3; local_18 = param_2; local_10 = param_1; do { local_3c = (*param_8)(param_7,&local_48,local_30); if (local_3c < 1) { if (local_3c == 0) { local_30 = local_30 + 1; } else if (local_3c < -100) { if (param_5 + param_6 <= local_30) { LAB_00181ebc: *param_9 = local_64; return local_10 - param_1; } local_30 = local_30 + 1; } else { local_30 = local_30 + (long)-local_3c; } local_64 = local_64 + 1; local_48 = 0x3f; } else { local_30 = local_30 + (long)local_3c; } while (local_3c = (*local_28)(local_20,local_48,local_10,param_1 + param_2), local_3c < 1) { if ((local_3c != 0) || (local_48 == 0x3f)) goto LAB_00181ebc; local_64 = local_64 + 1; local_48 = 0x3f; local_3c = 0; } local_10 = local_10 + local_3c; } while( true ); }