; assembly | /* r2dec pseudo code output */ | /* bdlpcre_regex.t/none @ 0x42bdb0 */ | #include | ; (fcn) method.int_BloombergLP::bdlpcre::RegEx::replaceImp_std::__1::basic_string_char__std::__1::char_traits_char___std::__1.allocator_char______std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char_____int__std::__1::basic_string () | uint64_t method_int_BloombergLP::bdlpcre::RegEx::replaceImp_std::_1::basic_string_char_std::_1::char_traits_char_std::_1_allocator_char_std::_1::basic_string_char_std::_1::char_traits_char_std::_1::allocator_char_int_std::_1::basic_string (int64_t arg6, int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, int64_t arg1) { | int64_t var_8h_2; | int64_t var_ch; | int64_t var_10h; | int64_t var_18h_2; | int64_t var_20h_2; | int64_t var_28h_2; | int64_t var_30h_2; | int64_t var_38h_2; | int64_t var_40h_2; | int64_t var_48h_2; | int64_t var_50h_2; | int64_t var_8h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* int BloombergLP::bdlpcre::RegEx::replaceImp, std::__1::allocator > >(std::__1::basic_string, std::__1::allocator >*, int*, std::__1::basic_string_view > const&, std::__1::basic_string_view > const&, unsigned long, bool) const */ 0x0042bdb0 push rbp | 0x0042bdb1 push r15 | 0x0042bdb3 push r14 | 0x0042bdb5 push r13 | 0x0042bdb7 push r12 | 0x0042bdb9 push rbx | 0x0042bdba sub rsp, 0x58 | 0x0042bdbe mov rbx, r9 | rbx = r9; 0x0042bdc1 mov r13, r8 | r13 = r8; 0x0042bdc4 mov r12, rcx | r12 = rcx; 0x0042bdc7 mov qword [rsp + 0x48], rdx | *((rsp + 0x48)) = rdx; 0x0042bdcc mov r14, rsi | r14 = rsi; 0x0042bdcf mov qword [rsp + 0x28], rdi | *((rsp + 0x28)) = rdi; 0x0042bdd4 mov r15, qword [rdi + 0x60] | r15 = *((rdi + 0x60)); 0x0042bdd8 call 0x403cb0 | rax = pthread_self (); 0x0042bddd mov rbp, rax | 0x0042bde0 cmp qword [r15 + 0x20], rax | | if (*((r15 + 0x20)) == rax) { 0x0042bde4 jne 0x42bdfb | 0x0042bde6 mov rax, qword [r15 + 0x38] | rax = *((r15 + 0x38)); 0x0042bdea mov qword [rsp + 0x40], rax | *((rsp + 0x40)) = rax; 0x0042bdef movups xmm0, xmmword [r15 + 0x28] | __asm ("movups xmm0, xmmword [r15 + 0x28]"); 0x0042bdf4 movaps xmmword [rsp + 0x30], xmm0 | *((rsp + 0x30)) = xmm0; 0x0042bdf9 jmp 0x42be16 | | } else { 0x0042bdfb lea rsi, [rsp + 0x30] | 0x0042be00 mov rdi, r15 | 0x0042be03 call 0x42a600 | eax = BloombergLP::bdlpcre::RegEx_MatchContext::allocateMatchContext(BloombergLP::bdlpcre::RegEx_MatchContextData*)const (r15, rsp + 0x30); 0x0042be08 mov r15d, 0xffffffff | r15d = 0xffffffff; 0x0042be0e test eax, eax | | if (eax != 0) { 0x0042be10 jne 0x42bfa0 | goto label_0; | } | } 0x0042be16 mov eax, ebx | eax = ebx; 0x0042be18 shl eax, 0xf | eax <<= 0xf; 0x0042be1b movzx eax, ax | eax = (int32_t) ax; 0x0042be1e mov edx, ebx | edx = ebx; 0x0042be20 shl edx, 7 | edx <<= 7; 0x0042be23 mov esi, edx | esi = edx; 0x0042be25 and esi, 0x100 | esi &= 0x100; 0x0042be2b and edx, 0x200 | edx &= 0x200; 0x0042be31 mov edi, ebx | edi = ebx; 0x0042be33 and edi, 8 | edi &= 8; 0x0042be36 shl edi, 8 | edi <<= 8; 0x0042be39 and ebx, 0x10 | ebx &= 0x10; 0x0042be3c shl ebx, 6 | ebx <<= 6; 0x0042be3f movzx ecx, byte [rsp + 0x90] | ecx = *((rsp + 0x90)); 0x0042be47 shl ecx, 0x1e | ecx <<= 0x1e; 0x0042be4a or ecx, esi | ecx |= esi; 0x0042be4c or ecx, eax | ecx |= eax; 0x0042be4e or ecx, edx | ecx |= edx; 0x0042be50 or ecx, edi | ecx |= edi; 0x0042be52 mov al, byte [r14] | al = *(r14); 0x0042be55 test al, 1 | 0x0042be57 mov qword [rsp + 0x10], rbp | *((rsp + 0x10)) = rbp; | if ((al & 1) == 0) { 0x0042be5c jne 0x42be66 | 0x0042be5e movzx esi, al | esi = (int32_t) al; 0x0042be61 shr rsi, 1 | rsi >>= 1; 0x0042be64 jmp 0x42be6a | | } else { 0x0042be66 mov rsi, qword [r14 + 8] | rsi = *((r14 + 8)); | } 0x0042be6a lea ecx, [rbx + rcx + 0x1000] | ecx = rbx + rcx + 0x1000; 0x0042be71 mov dword [rsp + 0xc], ecx | *((rsp + 0xc)) = ecx; 0x0042be75 mov qword [rsp], rsi | *(rsp) = rsi; 0x0042be79 mov rcx, qword [rsp + 0x30] | rcx = *((rsp + 0x30)); 0x0042be7e mov qword [rsp + 0x20], rcx | *((rsp + 0x20)) = rcx; 0x0042be83 mov rcx, qword [rsp + 0x38] | rcx = *((rsp + 0x38)); 0x0042be88 mov qword [rsp + 0x18], rcx | *((rsp + 0x18)) = rcx; 0x0042be8d lea rcx, [r14 + 1] | rcx = r14 + 1; 0x0042be91 mov qword [rsp + 0x50], rcx | *((rsp + 0x50)) = rcx; 0x0042be96 nop word cs:[rax + rax] | | do { 0x0042bea0 mov ecx, eax | ecx = eax; 0x0042bea2 and cl, 1 | cl &= 1; | if (cl == 0) { 0x0042bea5 jne 0x42bec0 | 0x0042bea7 shr al, 1 | al >>= 1; 0x0042bea9 movzx eax, al | eax = (int32_t) al; 0x0042beac cmp rsi, rax | | if (rsi <= rax) { 0x0042beaf ja 0x42bec9 | 0x0042beb1 jmp 0x42beda | | } else { 0x0042bec0 mov rax, qword [r14 + 8] | rax = *((r14 + 8)); 0x0042bec4 cmp rsi, rax | | if (rsi <= rax) { 0x0042bec7 jbe 0x42beda | goto label_1; | } | } 0x0042bec9 mov rdi, r14 | rdi = r14; 0x0042becc xor edx, edx | edx = 0; 0x0042bece call 0x404120 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042bed3 movzx ecx, byte [r14] | ecx = *(r14); 0x0042bed7 and cl, 1 | cl &= 1; | } | label_1: 0x0042beda mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0042bedf mov rdi, qword [rax + 0x48] | rdi = *((rax + 0x48)); 0x0042bee3 mov rsi, qword [r12] | rsi = *(r12); 0x0042bee7 mov rdx, qword [r12 + 8] | rdx = *((r12 + 8)); 0x0042beec mov r10, qword [r13] | r10 = *(r13); 0x0042bef0 mov rbp, qword [r13 + 8] | rbp = *((r13 + 8)); 0x0042bef4 mov rbx, qword [rsp + 0x50] | rbx = *((rsp + 0x50)); 0x0042bef9 test cl, cl | | if (cl != 0) { 0x0042befb je 0x42bf01 | 0x0042befd mov rbx, qword [r14 + 0x10] | rbx = *((r14 + 0x10)); | } 0x0042bf01 sub rsp, 8 | 0x0042bf05 xor ecx, ecx | ecx = 0; 0x0042bf07 mov r8d, dword [rsp + 0x14] | r8d = *((rsp + 0x14)); 0x0042bf0c mov r9, qword [rsp + 0x20] | r9 = *((rsp + 0x20)); 0x0042bf11 lea rax, [rsp + 8] | rax = rsp + 8; 0x0042bf16 push rax | 0x0042bf17 push rbx | 0x0042bf18 push rbp | 0x0042bf19 push r10 | 0x0042bf1b push qword [rsp + 0x48] | 0x0042bf1f call 0x4d0840 | eax = pcre2_substitute_8 (); 0x0042bf24 add rsp, 0x30 | 0x0042bf28 cmp eax, 0xffffffd0 | | if (eax != 0xffffffd0) { 0x0042bf2b jne 0x42bf3a | goto label_2; | } 0x0042bf2d mov rsi, qword [rsp] | rsi = *(rsp); 0x0042bf31 movzx eax, byte [r14] | eax = *(r14); 0x0042bf35 jmp 0x42bea0 | | } while (1); | label_2: 0x0042bf3a mov r15d, eax | r15d = eax; 0x0042bf3d test eax, eax | | if (eax >= 0) { 0x0042bf3f js 0x42bf56 | 0x0042bf41 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042bf45 mov rdi, r14 | rdi = r14; 0x0042bf48 xor edx, edx | edx = 0; 0x0042bf4a call 0x404120 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042bf4f mov rcx, qword [rsp + 0x10] | rcx = *((rsp + 0x10)); 0x0042bf54 jmp 0x42bf73 | | } else { 0x0042bf56 cmp r15d, 0xffffffff | 0x0042bf5a mov rcx, qword [rsp + 0x10] | rcx = *((rsp + 0x10)); | if (r15d != 0xffffffff) { 0x0042bf5f je 0x42bf65 | 0x0042bf61 mov r15d, dword [rsp] | r15d = *(rsp); | } 0x0042bf65 mov rax, qword [rsp + 0x48] | rax = *((rsp + 0x48)); 0x0042bf6a mov dword [rax], r15d | *(rax) = r15d; 0x0042bf6d mov r15d, 0xffffffff | r15d = 0xffffffff; | } 0x0042bf73 mov rax, qword [rsp + 0x28] | rax = *((rsp + 0x28)); 0x0042bf78 mov rax, qword [rax + 0x60] | rax = *((rax + 0x60)); 0x0042bf7c cmp qword [rax + 0x20], rcx | | if (*((rax + 0x20)) != rcx) { 0x0042bf80 je 0x42bfa0 | 0x0042bf82 mov rdi, qword [rsp + 0x18] | rdi = *((rsp + 0x18)); 0x0042bf87 call 0x4cc220 | pcre2_match_data_free_8 (); 0x0042bf8c mov rdi, qword [rsp + 0x40] | rdi = *((rsp + 0x40)); 0x0042bf91 call 0x47e2a0 | pcre2_jit_stack_free_8 (); 0x0042bf96 mov rdi, qword [rsp + 0x20] | rdi = *((rsp + 0x20)); 0x0042bf9b call 0x462980 | pcre2_match_context_free_8 (); | } | label_0: 0x0042bfa0 mov eax, r15d | eax = r15d; 0x0042bfa3 add rsp, 0x58 | 0x0042bfa7 pop rbx | 0x0042bfa8 pop r12 | 0x0042bfaa pop r13 | 0x0042bfac pop r14 | 0x0042bfae pop r15 | 0x0042bfb0 pop rbp | 0x0042bfb1 ret | return rax; | }