============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined V_FillRect8() PUSH R14 MOVSXD RSI,ESI MOVSXD R14,ECX PUSH R13 PUSH R12 PUSH RBP LEA RBP,[.bss:screens] PUSH RBX MOVSXD RBX,EDI SHL RBX,0x5 LEA RAX,[RBP + RBX*0x1] IMUL EDX,dword ptr [RAX + 0x14]=>.bss:screens[20] MOVSXD RDX,EDX LEA RCX,[RDX + RSI*0x1] ADD RCX,qword ptr [RAX]=>.bss:screens TEST R8D,R8D JZ LAB_001f36cf LEA R12D,[R8 + -0x1] MOVZX R13D,R9B NOP dword ptr [RAX] LAB_001f36b0: MOV RDI,RCX MOV RDX,R14 MOV ESI,R13D CALL .plt:::memset ;void * memset(void * __s, int __c, s... MOV RCX,RAX MOVSXD RAX,dword ptr [RBP + RBX*0x1 + 0x14]=>.bss:screens[20] ADD RCX,RAX SUB R12D,0x1 JNC LAB_001f36b0 LAB_001f36cf: POP RBX POP RBP POP R12 POP R13 POP R14 RET ?? 0Fh Actual src: static void V_FillRect8(int scrn, int x, int y, int width, int height, byte colour) { byte* dest = screens[scrn].data + x + y*screens[scrn].byte_pitch; while (height--) { memset(dest, colour, width); dest += screens[scrn].byte_pitch; } } Predicted src: void my_s(int x, int y, int width, int height) { int i; for (i = 0; i < width; i++) { for (i = 0; i < width; i++) { x[i] = x[i]; } } } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined op_edc0_22_ff() PUSH RBX MOV EBX,EDI MOV EDI,0x2 MOV dword ptr [.bss:OpcodeFamily],0x5d AND EBX,0x7 MOV dword ptr [.bss:CurrentInstrCycles],0x8 CALL get_word_030_prefetch ;undefined get_word_030_prefetch() MOV ESI,EAX TEST AH,0x8 JZ LAB_009bbe18 SAR AX,0x6 LEA R9,[.bss:regs] AND EAX,0x7 MOV EDX,dword ptr [R9 + RAX*0x4]=>.bss:regs MOV ECX,EDX AND ECX,0x1f LAB_009bbd46: TEST SIL,0x20 JZ LAB_009bbe00 MOV EAX,ESI AND EAX,0x7 MOV R8D,dword ptr [R9 + RAX*0x4]=>.bss:regs SUB R8D,0x1 AND R8D,0x1f ADD R8D,0x1 LAB_009bbd65: MOV EAX,dword ptr [R9 + RBX*0x4]=>.bss:regs ROL EAX,CL MOV ECX,0x20 MOV EDI,EAX SHR EAX,0x1f SUB ECX,R8D SHL EAX,0xf SHR EDI,CL MOV ECX,EAX MOV EAX,dword ptr [.bss:regflags] AND AH,0x3f OR EAX,ECX XOR ECX,ECX TEST EDI,EDI SETZ CL SHL ECX,0xe OR EAX,ECX LEA ECX,[R8 + -0x1] AND EAX,0xfffffefe MOV dword ptr [.bss:regflags],EAX MOV EAX,0x1 SHL EAX,CL TEST EAX,EAX JNZ LAB_009bbdbf JMP LAB_009bbdc3 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_009bbdb8: ADD EDX,0x1 SHR EAX,1 JZ LAB_009bbdc3 LAB_009bbdbf: TEST EDI,EAX JZ LAB_009bbdb8 LAB_009bbdc3: SAR SI,0xc MOV EAX,dword ptr [.bss:regs[188]] MOV EDI,0x4 AND ESI,0x7 MOV dword ptr [R9 + RSI*0x4]=>.bss:regs,EDX MOV dword ptr [.bss:regs[184]],EAX CALL get_word_030_prefetch ;undefined get_word_030_prefetch() ADD dword ptr [.bss:regs[64]],0x4 POP RBX MOV word ptr [.bss:regs[104]],AX MOV EAX,0x1000 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_009bbe00: LEA R8D,[RSI + 0x1f] AND R8D,0x1f ADD R8D,0x1 JMP LAB_009bbd65 ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_009bbe18: MOV ECX,EAX LEA R9,[.bss:regs] SAR CX,0x6 AND ECX,0x1f MOV EDX,ECX JMP LAB_009bbd46 ?? 90h Actual src: uae_u32 REGPARAM2 op_edc0_22_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 dstreg = real_opcode & 7; OpcodeFamily = 93; CurrentInstrCycles = 8; uae_s16 extra = get_word_030_prefetch(2); uae_u32 bdata[2]; uae_s32 offset = extra & 0x800? m68k_dreg(regs, (extra >> 6) & 7) : (extra >> 6) & 0x1f; int width = (((extra & 0x20? m68k_dreg(regs, extra & 7) : extra) - 1) & 0x1f) + 1; uae_u32 offset2 = offset; uae_u32 tmp = m68k_dreg(regs, dstreg); offset &= 0x1f; tmp = (tmp << offset) | (tmp >> (32 - offset)); bdata[0] = tmp & ((1 << (32 - width)) - 1); SET_ALWAYS_NFLG(((uae_s32)tmp) < 0? 1 : 0); tmp >>= (32 - width); SET_ZFLG(tmp == 0); SET_VFLG(0); SET_CFLG(0); { uae_u32 mask = 1 << (width - 1); while (mask) { if (tmp & mask) break; mask >>= 1; offset2++; }} m68k_dreg(regs, (extra >> 12) & 7) = offset2; ipl_fetch(); regs.irc = get_word_030_prefetch(4); m68k_incpci(4); return (1 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } Predicted src: uae_u32 REGPARAM2 op_22_22_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 srcreg = (real_opcode & 7); uae_u32 dstreg = (real_opcode >> 9) & 7; OpcodeFamily = 30; CurrentInstrCycles = 12; uaecptr srca; m68k_incpci(2); srca = x_get_disp_ea_020(m68k_areg(regs, srcreg), 0); uae_s16 src = x_get_word(srca); uae_s16 dst = m68k_dreg(regs, dstreg); uae_u32 newv = ((uae_u16)(dst)) - ((uae_u16)(src)); int flgs = ((uae_s16)(src)) < 0; int flgo = ((uae_s16)(dst)) < 0; int flgn = ((uae_s16)(newv)) < 0; SET_ZFLG(((uae_s16)(newv)) == 0); SET_VFLG((flgs ^ flgo) & (flgn ^ flgo)); SET_CFLG(((uae_u16)(src)) > ((uae_u16)(dst))); COPY_CARRY(); SET_NFLG(flgn!= 0); ipl_fetch(); regs.irc = get_word_030_prefetch(0); m68k_dreg(regs, dstreg) = (m68k_dreg(regs, dstreg) & ~0xffff) | ((newv) & 0xffff); return (1 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined e_google_book_chooser_button_init() MOVSXD RAX,dword ptr [.bss:EGoogleBookChooserButton_private_offset] ;=?? ADD RAX,RDI MOV qword ptr [RDI + 0x38],RAX RET ?? 90h Actual src: static void e_google_book_chooser_button_init (EGoogleBookChooserButton *button) { button->priv = e_google_book_chooser_button_get_instance_private (button); } Predicted src: static void e_button_button_button_init (EButtonButton *button) { button->priv = e_button_button_get_instance_private (button); } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;double _nrrdUnaryOpAcos(double __x) ;__x double XMM0_Qa JMP .plt:::acos ?? 66h f Actual src: static double _nrrdUnaryOpAcos(double a) {return acos(a);} Predicted src: double _exp(double x) { return _exp(x); } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined symb_destroy() TEST RDI,RDI JZ LAB_00133930 SUB RSP,0x8 MOV EAX,dword ptr [RDI] MOV R8,RDI LEA R9D,[RAX + -0x1] MOV dword ptr [RDI],R9D MOV EAX,R9D TEST R9D,R9D JG LAB_001338c0 TEST EAX,EAX JZ LAB_00133917 LAB_001338b5: MOV dword ptr [R8],R9D XOR EAX,EAX ADD RSP,0x8 RET ?? 90h LAB_001338c0: CALL reset_done_flag.isra.0 ;undefined reset_done_flag.isra.0() MOV RAX,qword ptr [R8 + 0x10] LEA R10,[.data:symb_class] MOV RCX,qword ptr [RAX] TEST RCX,RCX JNZ LAB_001338e8 JMP LAB_00133910 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001338e0: MOV RCX,qword ptr [RCX] TEST RCX,RCX JZ LAB_00133910 LAB_001338e8: MOV RAX,qword ptr [RCX + 0x30] TEST RAX,RAX JZ LAB_001338e0 CMP qword ptr [RAX],R10 JNZ LAB_001338e0 MOV RDI,qword ptr [RAX + 0x8] TEST RDI,RDI JZ LAB_001338e0 MOV RSI,R8 CALL test_unlink_symtab_item.isra.0 ;undefined test_unlink_symtab_item.is... MOV RCX,qword ptr [RCX] TEST RCX,RCX JNZ LAB_001338e8 NOP LAB_00133910: MOV EAX,dword ptr [R8] TEST EAX,EAX JNZ LAB_001338b5 LAB_00133917: MOV RDI,R8 CALL delete_symtab_item ;undefined delete_symtab_item() XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00133930: XOR EAX,EAX RET ?? 66h f Actual src: static int symb_destroy (void *item) { SYMTAB_ITEM *symtab_item = item; int save_links; SYMBOL *symbol; CLASS_ITEM *class_item; if (symtab_item) { /* If all links are gone then delete now. */ symtab_item-> links--; save_links = symtab_item-> links; if (symtab_item-> links > 0) { /* Try to find a loop that will remove all links */ reset_done_flag (symtab_item); for (symbol = symtab_item-> symtab-> symbols; symbol; symbol = symbol-> next) { class_item = symbol-> data; if (class_item && class_item-> class == & symb_class && class_item-> item) test_unlink_symtab_item (class_item-> item, symtab_item); } } if (symtab_item-> links == 0) delete_symtab_item (symtab_item); else symtab_item-> links = save_links; } return 0; } Predicted src: static int test_item_done(void *arg) { struct t_test_item *t = arg; struct t_test_item *item = arg; int ret; for (item = t->item; item; item = item->next) { if (item->name) continue; if (item->name) continue; if (item->name) continue; ret = t->next; } return ret; }