; assembly | /* r2dec pseudo code output */ | /* balber_berutil.t/none @ 0x4772a0 */ | #include | ; (fcn) method.BloombergLP::bdldfp::DecimalImpUtil.round_BloombergLP::bdldfp::DecimalImpUtil_IntelDfp::ValueType32__unsigned_int_ () | uint64_t method_BloombergLP::bdldfp::DecimalImpUtil_round_BloombergLP::bdldfp::DecimalImpUtil_IntelDfp::ValueType32_unsigned_int_ (int64_t arg2, int64_t arg1) { | int64_t var_ch; | int64_t var_10h; | int64_t var_14h; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdldfp::DecimalImpUtil::round(BloombergLP::bdldfp::DecimalImpUtil_IntelDfp::ValueType32, unsigned int) */ 0x004772a0 push rbp | 0x004772a1 push rbx | 0x004772a2 sub rsp, 0x18 | 0x004772a6 mov ebx, esi | ebx = esi; 0x004772a8 mov ebp, edi | 0x004772aa call 0x4857e0 | eax = _bid32_class (); 0x004772af add eax, 0xfffffffd | eax += 0xfffffffd; 0x004772b2 cmp eax, 6 | 0x004772b5 setb cl | cl = (eax < 6) ? 1 : 0; 0x004772b8 mov edx, 0x33 | edx = 0x33; 0x004772bd bt edx, eax | 0x004772c0 setb al | al = (((edx >> eax) & 1) < 0) ? 1 : 0; 0x004772c3 and al, cl | al &= cl; 0x004772c5 mov ecx, ebp | ecx = ebp; 0x004772c7 and ecx, 0x60000000 | ecx &= 0x60000000; 0x004772cd cmp ecx, 0x60000000 | | if (ecx == 0x60000000) { 0x004772d3 jne 0x4772f3 | 0x004772d5 mov edx, ebp | edx = ebp; 0x004772d7 and edx, 0x78000000 | edx &= 0x78000000; 0x004772dd mov ecx, ebp | ecx = ebp; 0x004772df shr ecx, 0x15 | ecx >>= 0x15; 0x004772e2 movzx esi, cl | esi = (int32_t) cl; 0x004772e5 lea ecx, [rsi - 0x65] | ecx = rsi - 0x65; 0x004772e8 cmp edx, 0x78000000 | | if (edx == 0x78000000) { 0x004772ee cmove ecx, esi | ecx = esi; | } 0x004772f1 jmp 0x4772fe | | } else { 0x004772f3 mov ecx, ebp | ecx = ebp; 0x004772f5 shr ecx, 0x17 | ecx >>= 0x17; 0x004772f8 movzx ecx, cl | ecx = (int32_t) cl; 0x004772fb add ecx, 0xffffff9b | ecx += 0xffffff9b; | } 0x004772fe add ecx, ebx | ecx += ebx; 0x00477300 setns cl | __asm ("setns cl"); 0x00477303 xor al, 1 | al ^= 1; 0x00477305 or al, cl | al |= cl; | if (al == 0) { 0x00477307 jne 0x4773b3 | 0x0047730d mov dword [rsp + 0xc], 0 | *((rsp + 0xc)) = 0; 0x00477315 lea rdx, [rsp + 0xc] | rdx = rsp + 0xc; 0x0047731a mov edi, ebp | edi = ebp; 0x0047731c mov esi, ebx | esi = ebx; 0x0047731e call 0x485f10 | eax = _bid32_scalbn (); 0x00477323 mov ebp, eax | 0x00477325 mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); 0x00477329 test al, 1 | | if ((al & 1) != 0) { 0x0047732b je 0x47733c | 0x0047732d call 0x404a50 | errno_location (); 0x00477332 mov dword [rax], 0x21 | *(rax) = 0x21; 0x00477338 mov eax, dword [rsp + 0xc] | eax = *((rsp + 0xc)); | } 0x0047733c test al, 8 | | if ((al & 8) != 0) { 0x0047733e je 0x47734b | 0x00477340 call 0x404a50 | errno_location (); 0x00477345 mov dword [rax], 0x22 | *(rax) = 0x22; | } 0x0047734b mov dword [rsp + 0x14], 0 | *((rsp + 0x14)) = 0; 0x00477353 lea rsi, [rsp + 0x14] | rsi = rsp + 0x14; 0x00477358 mov edi, ebp | edi = ebp; 0x0047735a call 0x485ef0 | eax = _bid32_round_integral_nearest_away (); 0x0047735f mov ebp, eax | 0x00477361 test byte [rsp + 0x14], 1 | | if ((*((rsp + 0x14)) & 1) != 0) { 0x00477366 je 0x477373 | 0x00477368 call 0x404a50 | errno_location (); 0x0047736d mov dword [rax], 0x21 | *(rax) = 0x21; | } 0x00477373 neg ebx | ebx = -ebx; 0x00477375 mov dword [rsp + 0x10], 0 | *((rsp + 0x10)) = 0; 0x0047737d lea rdx, [rsp + 0x10] | rdx = rsp + 0x10; 0x00477382 mov edi, ebp | edi = ebp; 0x00477384 mov esi, ebx | esi = ebx; 0x00477386 call 0x485f10 | eax = _bid32_scalbn (); 0x0047738b mov ebp, eax | 0x0047738d mov eax, dword [rsp + 0x10] | eax = *((rsp + 0x10)); 0x00477391 test al, 1 | | if ((al & 1) != 0) { 0x00477393 je 0x4773a4 | 0x00477395 call 0x404a50 | errno_location (); 0x0047739a mov dword [rax], 0x21 | *(rax) = 0x21; 0x004773a0 mov eax, dword [rsp + 0x10] | eax = *((rsp + 0x10)); | } 0x004773a4 test al, 8 | | if ((al & 8) == 0) { 0x004773a6 je 0x4773b3 | goto label_0; | } 0x004773a8 call 0x404a50 | errno_location (); 0x004773ad mov dword [rax], 0x22 | *(rax) = 0x22; | } | label_0: 0x004773b3 mov eax, ebp | eax = ebp; 0x004773b5 add rsp, 0x18 | 0x004773b9 pop rbx | 0x004773ba pop rbp | 0x004773bb ret | return rax; | }