function_name
stringlengths 3
34
| binary_name
stringlengths 64
64
| author_name
stringlengths 2
36
| project_name
stringlengths 2
48
| opt
stringclasses 1
value | src
stringlengths 82
18.8k
| dbg
stringclasses 1
value | codeart
stringlengths 461
87.8k
| lmpa
stringlengths 492
9.74k
| retrieved_index
sequencelengths 2
2
|
---|---|---|---|---|---|---|---|---|---|
bmp16b_write | 434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff | jfdelnero | HXCFE_file_selector | NA | int bmp16b_write(char * file,bitmap_data * bdata)
{
FILE * f;
int i,j;
unsigned short color;
BITMAPFILEHEADER bitmap_header;
BITMAPINFOHEADER bitmap_info_header;
uint32_t bitmapdatalinesize;
unsigned char * linebuffer;
f = fopen(file,"wb");
if(f)
{
memset(&bitmap_header,0,sizeof(BITMAPFILEHEADER));
bitmap_header.bfType = 19778;
bitmap_header.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
bitmapdatalinesize = bdata->xsize*2;
if(bitmapdatalinesize&0x3)
bitmapdatalinesize = ((bitmapdatalinesize & (~0x3)) + 0x4);
bitmap_header.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (bitmapdatalinesize*bdata->ysize);
fwrite(&bitmap_header,1,sizeof(BITMAPFILEHEADER),f);
memset(&bitmap_info_header,0,sizeof(BITMAPINFOHEADER));
bitmap_info_header.biSize = sizeof(BITMAPINFOHEADER);
bitmap_info_header.biBitCount = 16;
bitmap_info_header.biHeight = bdata->ysize;
bitmap_info_header.biWidth = bdata->xsize;
bitmap_info_header.biPlanes = 1;
bitmap_info_header.biSizeImage = bitmapdatalinesize*bdata->ysize;
fwrite(&bitmap_info_header,1,sizeof(BITMAPINFOHEADER),f);
linebuffer = (unsigned char *)malloc(bitmapdatalinesize);
memset(linebuffer,0,bitmapdatalinesize);
for(i=0;i<bdata->ysize;i++)
{
for(j=0;j<bdata->xsize;j++)
{
color = (unsigned short)( (bdata->data[((((bdata->ysize-1)-i))*bdata->xsize) + j]) & 0xFF)>>3;
color = (color<<5) | (unsigned short)( (bdata->data[((((bdata->ysize-1)-i))*bdata->xsize) + j]>>8) & 0xFF)>>3;
color = (color<<5) | (unsigned short)( (bdata->data[((((bdata->ysize-1)-i))*bdata->xsize) + j]>>16) & 0xFF)>>3;
linebuffer[(j*2)+0] = color & 0xFF;
linebuffer[(j*2)+1] = (color>>8) & 0xFF;
}
fwrite(linebuffer,1,bitmapdatalinesize,f);
}
free(linebuffer);
fclose(f);
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401F19", "function_addr": 4202265, "binary_name": "434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 70h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+var_70], rsi"], [5, "mov rax, [rbp+filename]"], [6, "mov esi, offset aWb"], [7, "mov rdi, rax"], [8, "call _fopen"], [9, "mov [rbp+stream], rax"], [10, "cmp [rbp+stream], 0"], [11, "jz loc_4021D4"], [12, "lea rax, [rbp+s]"], [13, "mov edx, 0Eh"], [14, "mov esi, 0"], [15, "mov rdi, rax"], [16, "call _memset"], [17, "mov [rbp+s], 4D42h"], [18, "mov [rbp+var_26], 36h "], [19, "mov rax, [rbp+var_70]"], [20, "movzx eax, word ptr [rax]"], [21, "cwde"], [22, "add eax, eax"], [23, "mov dword ptr [rbp+size], eax"], [24, "mov eax, dword ptr [rbp+size]"], [25, "and eax, 3"], [26, "test eax, eax"], [27, "jz short loc_401F8F"], [28, "mov eax, dword ptr [rbp+size]"], [29, "and eax, 0FFFFFFFCh"], [30, "add eax, 4"], [31, "mov dword ptr [rbp+size], eax"], [32, "mov rax, [rbp+var_70]"], [33, "movzx eax, word ptr [rax+2]"], [34, "cwde"], [35, "imul eax, dword ptr [rbp+size]"], [36, "add eax, 36h "], [37, "mov [rbp+var_2E], eax"], [38, "mov rdx, [rbp+stream]"], [39, "lea rax, [rbp+s]"], [40, "mov rcx, rdx"], [41, "mov edx, 0Eh"], [42, "mov esi, 1"], [43, "mov rdi, rax"], [44, "call _fwrite"], [45, "lea rax, [rbp+ptr]"], [46, "mov edx, 28h "], [47, "mov esi, 0"], [48, "mov rdi, rax"], [49, "call _memset"], [50, "mov [rbp+ptr], 28h "], [51, "mov [rbp+var_52], 10h"], [52, "mov rax, [rbp+var_70]"], [53, "movzx eax, word ptr [rax+2]"], [54, "cwde"], [55, "mov [rbp+var_58], eax"], [56, "mov rax, [rbp+var_70]"], [57, "movzx eax, word ptr [rax]"], [58, "cwde"], [59, "mov [rbp+var_5C], eax"], [60, "mov [rbp+var_54], 1"], [61, "mov rax, [rbp+var_70]"], [62, "movzx eax, word ptr [rax+2]"], [63, "cwde"], [64, "imul eax, dword ptr [rbp+size]"], [65, "mov [rbp+var_4C], eax"], [66, "mov rdx, [rbp+stream]"], [67, "lea rax, [rbp+ptr]"], [68, "mov rcx, rdx"], [69, "mov edx, 28h "], [70, "mov esi, 1"], [71, "mov rdi, rax"], [72, "call _fwrite"], [73, "mov eax, dword ptr [rbp+size]"], [74, "mov rdi, rax"], [75, "call _malloc"], [76, "mov [rbp+var_20], rax"], [77, "mov edx, dword ptr [rbp+size]"], [78, "mov rax, [rbp+var_20]"], [79, "mov esi, 0"], [80, "mov rdi, rax"], [81, "call _memset"], [82, "mov [rbp+var_4], 0"], [83, "jmp loc_4021AA"], [84, "mov dword ptr [rbp+size+4], 0"], [85, "jmp loc_40217D"], [86, "mov rax, [rbp+var_70]"], [87, "mov rcx, [rax+0Eh]"], [88, "mov rax, [rbp+var_70]"], [89, "movzx eax, word ptr [rax+2]"], [90, "cwde"], [91, "sub eax, 1"], [92, "sub eax, [rbp+var_4]"], [93, "mov edx, eax"], [94, "mov rax, [rbp+var_70]"], [95, "movzx eax, word ptr [rax]"], [96, "cwde"], [97, "imul edx, eax"], [98, "mov eax, dword ptr [rbp+size+4]"], [99, "add eax, edx"], [100, "cdqe"], [101, "shl rax, 2"], [102, "add rax, rcx"], [103, "mov eax, [rax]"], [104, "movzx eax, ax"], [105, "sar eax, 3"], [106, "and eax, 1Fh"], [107, "mov [rbp+var_22], ax"], [108, "movzx eax, [rbp+var_22]"], [109, "shl eax, 5"], [110, "mov esi, eax"], [111, "mov rax, [rbp+var_70]"], [112, "mov rcx, [rax+0Eh]"], [113, "mov rax, [rbp+var_70]"], [114, "movzx eax, word ptr [rax+2]"], [115, "cwde"], [116, "sub eax, 1"], [117, "sub eax, [rbp+var_4]"], [118, "mov edx, eax"], [119, "mov rax, [rbp+var_70]"], [120, "movzx eax, word ptr [rax]"], [121, "cwde"], [122, "imul edx, eax"], [123, "mov eax, dword ptr [rbp+size+4]"], [124, "add eax, edx"], [125, "cdqe"], [126, "shl rax, 2"], [127, "add rax, rcx"], [128, "mov eax, [rax]"], [129, "shr eax, 8"], [130, "movzx eax, ax"], [131, "sar eax, 3"], [132, "and eax, 1Fh"], [133, "or eax, esi"], [134, "mov [rbp+var_22], ax"], [135, "movzx eax, [rbp+var_22]"], [136, "shl eax, 5"], [137, "mov esi, eax"], [138, "mov rax, [rbp+var_70]"], [139, "mov rcx, [rax+0Eh]"], [140, "mov rax, [rbp+var_70]"], [141, "movzx eax, word ptr [rax+2]"], [142, "cwde"], [143, "sub eax, 1"], [144, "sub eax, [rbp+var_4]"], [145, "mov edx, eax"], [146, "mov rax, [rbp+var_70]"], [147, "movzx eax, word ptr [rax]"], [148, "cwde"], [149, "imul edx, eax"], [150, "mov eax, dword ptr [rbp+size+4]"], [151, "add eax, edx"], [152, "cdqe"], [153, "shl rax, 2"], [154, "add rax, rcx"], [155, "mov eax, [rax]"], [156, "shr eax, 10h"], [157, "movzx eax, ax"], [158, "sar eax, 3"], [159, "and eax, 1Fh"], [160, "or eax, esi"], [161, "mov [rbp+var_22], ax"], [162, "mov eax, dword ptr [rbp+size+4]"], [163, "add eax, eax"], [164, "movsxd rdx, eax"], [165, "mov rax, [rbp+var_20]"], [166, "add rax, rdx"], [167, "movzx edx, [rbp+var_22]"], [168, "mov [rax], dl"], [169, "movzx eax, [rbp+var_22]"], [170, "shr ax, 8"], [171, "mov edx, eax"], [172, "mov eax, dword ptr [rbp+size+4]"], [173, "add eax, eax"], [174, "cdqe"], [175, "lea rcx, [rax+1]"], [176, "mov rax, [rbp+var_20]"], [177, "add rax, rcx"], [178, "mov [rax], dl"], [179, "add dword ptr [rbp+size+4], 1"], [180, "mov rax, [rbp+var_70]"], [181, "movzx eax, word ptr [rax]"], [182, "cwde"], [183, "cmp dword ptr [rbp+size+4], eax"], [184, "jl loc_402067"], [185, "mov edx, dword ptr [rbp+size]"], [186, "mov rcx, [rbp+stream]"], [187, "mov rax, [rbp+var_20]"], [188, "mov esi, 1"], [189, "mov rdi, rax"], [190, "call _fwrite"], [191, "add [rbp+var_4], 1"], [192, "mov rax, [rbp+var_70]"], [193, "movzx eax, word ptr [rax+2]"], [194, "cwde"], [195, "cmp [rbp+var_4], eax"], [196, "jl loc_40205B"], [197, "mov rax, [rbp+var_20]"], [198, "mov rdi, rax"], [199, "call _free"], [200, "mov rax, [rbp+stream]"], [201, "mov rdi, rax"], [202, "call _fclose"], [203, "mov eax, 0"], [204, "leave"], [205, "retn"]], "data_dep": [[5, 3], [7, 5], [9, 8], [10, 9], [11, 10], [12, 8], [15, 12], [19, 4], [20, 19], [22, 20], [23, 22], [24, 23], [25, 24], [26, 25], [27, 26], [28, 23], [29, 28], [30, 29], [31, 30], [32, 4], [33, 32], [35, 33], [35, 23], [35, 31], [36, 35], [37, 36], [38, 9], [39, 17], [39, 36], [40, 38], [43, 39], [45, 44], [48, 45], [52, 4], [53, 52], [55, 53], [56, 4], [57, 56], [59, 57], [61, 4], [62, 61], [64, 23], [64, 62], [64, 31], [65, 64], [66, 9], [67, 64], [67, 50], [68, 66], [71, 67], [73, 23], [73, 31], [74, 73], [76, 75], [77, 23], [77, 31], [78, 76], [80, 78], [86, 4], [87, 178], [87, 86], [87, 168], [88, 4], [89, 178], [89, 168], [89, 88], [91, 89], [92, 82], [92, 91], [92, 191], [93, 92], [94, 4], [95, 178], [95, 168], [95, 94], [97, 95], [97, 93], [98, 84], [98, 179], [99, 97], [99, 98], [101, 99], [102, 101], [102, 87], [103, 102], [103, 168], [103, 178], [104, 103], [105, 104], [106, 105], [107, 106], [108, 107], [109, 108], [110, 109], [111, 4], [112, 178], [112, 111], [112, 168], [113, 4], [114, 168], [114, 113], [114, 178], [116, 114], [117, 82], [117, 116], [117, 191], [118, 117], [119, 4], [120, 168], [120, 119], [120, 178], [122, 118], [122, 120], [123, 84], [123, 179], [124, 122], [124, 123], [126, 124], [127, 126], [127, 112], [128, 178], [128, 127], [128, 168], [129, 128], [130, 129], [131, 130], [132, 131], [133, 132], [133, 110], [134, 133], [135, 134], [136, 135], [137, 136], [138, 4], [139, 178], [139, 138], [139, 168], [140, 4], [141, 168], [141, 140], [141, 178], [143, 141], [144, 143], [144, 191], [144, 82], [145, 144], [146, 4], [147, 178], [147, 146], [147, 168], [149, 145], [149, 147], [150, 84], [150, 179], [151, 150], [151, 149], [153, 151], [154, 153], [154, 139], [155, 178], [155, 168], [155, 154], [156, 155], [157, 156], [158, 157], [159, 158], [160, 137], [160, 159], [161, 160], [162, 179], [162, 84], [163, 162], [164, 163], [165, 76], [166, 165], [166, 164], [167, 161], [168, 166], [168, 167], [169, 161], [170, 169], [171, 170], [172, 84], [172, 179], [173, 172], [175, 168], [175, 139], [175, 173], [176, 76], [177, 176], [177, 175], [178, 177], [178, 171], [179, 84], [179, 179], [180, 4], [181, 178], [181, 180], [181, 168], [183, 181], [183, 84], [183, 179], [184, 183], [185, 23], [185, 31], [186, 9], [187, 76], [189, 187], [191, 82], [191, 191], [192, 4], [193, 168], [193, 192], [193, 178], [195, 82], [195, 191], [195, 193], [196, 195], [197, 76], [198, 197], [200, 9], [201, 200], [205, 203]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff_434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff.jsonl.gz", "strip_func_name": "sub_401F19", "query": "\n\n\n__int64 __fastcall sub_401F19(const char *a1, __int16 *a2)\n{\nint ptr[3]; // [rsp+10h] [rbp-60h] BYREF\n__int16 v4; // [rsp+1Ch] [rbp-54h]\n__int16 v5; // [rsp+1Eh] [rbp-52h]\nint v6; // [rsp+24h] [rbp-4Ch]\n__int16 s; // [rsp+40h] [rbp-30h] BYREF\nint v8; // [rsp+42h] [rbp-2Eh]\nint v9; // [rsp+4Ah] [rbp-26h]\n__int16 v10; // [rsp+4Eh] [rbp-22h]\nvoid *v11; // [rsp+50h] [rbp-20h]\nFILE *stream; // [rsp+58h] [rbp-18h]\nsize_t size; // [rsp+64h] [rbp-Ch]\nint i; // [rsp+6Ch] [rbp-4h]\n\nstream = fopen(a1, \"wb\");\nif ( stream )\n{\nmemset(&s, 0, 0xEuLL);\ns = 19778;\nv9 = 54;\nLODWORD(size) = 2 * *a2;\nif ( (size & 3) != 0 )\nLODWORD(size) = (size & 0xFFFFFFFC) + 4;\nv8 = size * a2[1] + 54;\nfwrite(&s, 1uLL, 0xEuLL, stream);\nmemset(ptr, 0, 0x28uLL);\nptr[0] = 40;\nv5 = 16;\nptr[2] = a2[1];\nptr[1] = *a2;\nv4 = 1;\nv6 = size * a2[1];\nfwrite(ptr, 1uLL, 0x28uLL, stream);\nv11 = malloc((unsigned int)size);\nmemset(v11, 0, (unsigned int)size);\nfor ( i = 0; i < a2[1]; ++i )\n{\nHIDWORD(size) = 0;\nwhile ( SHIDWORD(size) < *a2 )\n{\nv10 = ((int)(unsigned __int16)*(_DWORD *)(*(_QWORD *)(a2 + 7) + 4LL * (*a2 * (a2[1] - 1 - i) + HIDWORD(size))) >> 3) & 0x1F;\nv10 = (32 * v10) | ((int)(unsigned __int16)(*(_DWORD *)(*(_QWORD *)(a2 + 7)\n+ 4LL * (*a2 * (a2[1] - 1 - i) + HIDWORD(size))) >> 8) >> 3) & 0x1F;\nv10 = (32 * v10) | ((int)(unsigned __int16)HIWORD(*(_DWORD *)(*(_QWORD *)(a2 + 7)\n+ 4LL * (*a2 * (a2[1] - 1 - i) + HIDWORD(size)))) >> 3) & 0x1F;\n*((_WORD *)v11 + HIDWORD(size)++) = v10;\n}\nfwrite(v11, 1uLL, (unsigned int)size, stream);\n}\nfree(v11);\nfclose(stream);\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,ptr,s,v10,v11,stream,size,sub_401F19,]", "hints": "[]", "response": "{'a1': 'file', 'a2': 'bdata', 'ptr': 'bitmap_info_header', 's': 'bitmap_header', 'v10': 'color', 'v11': 'linebuffer', 'stream': 'f', 'size': 'bitmapdatalinesize', 'sub_401F19': 'bmp16b_write'}"} | [
[
0.7464033365249634,
0.7393642663955688,
0.7378036379814148,
0.7371602058410645,
0.7292156219482422,
0.727957010269165,
0.7269014716148376,
0.7168325185775757,
0.716117262840271,
0.7141449451446533,
0.7046025991439819,
0.7026566863059998,
0.7006500363349915,
0.700409471988678,
0.699726402759552,
0.6991285681724548,
0.6989386677742004,
0.6975123882293701,
0.6970105171203613,
0.6949830055236816
],
[
11357,
78943,
40886,
64099,
252762,
170024,
241707,
189783,
215303,
147431,
202979,
182546,
207006,
174130,
77693,
66157,
52291,
149202,
46221,
235813
]
] |
|
max_rows | bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2 | embotech | ecos | NA | void max_rows(pfloat *E, const spmat *mat)
{
/* assumes mat is not null */
idxint i, j, row;
for(i = 0; i < mat->n; i++) { /* cols */
for(j = mat->jc[i]; j < mat->jc[i+1]; j++) {
row = mat->ir[j];
E[row] = MAX(fabs(mat->pr[j]), E[row]);
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41027A", "function_addr": 4260474, "binary_name": "bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_8], 0"], [5, "jmp loc_41038B"], [6, "mov rax, [rbp+var_30]"], [7, "mov rdx, [rax]"], [8, "mov rax, [rbp+var_8]"], [9, "shl rax, 3"], [10, "add rax, rdx"], [11, "mov rax, [rax]"], [12, "mov [rbp+var_10], rax"], [13, "jmp loc_410363"], [14, "mov rax, [rbp+var_30]"], [15, "mov rdx, [rax+8]"], [16, "mov rax, [rbp+var_10]"], [17, "shl rax, 3"], [18, "add rax, rdx"], [19, "mov rax, [rax]"], [20, "mov [rbp+var_18], rax"], [21, "mov rax, [rbp+var_30]"], [22, "mov rdx, [rax+10h]"], [23, "mov rax, [rbp+var_10]"], [24, "shl rax, 3"], [25, "add rax, rdx"], [26, "movsd xmm0, qword ptr [rax]"], [27, "movq xmm1, cs:qword_4187D0"], [28, "andpd xmm1, xmm0"], [29, "mov rax, [rbp+var_18]"], [30, "lea rdx, ds:0[rax*8]"], [31, "mov rax, [rbp+var_28]"], [32, "add rax, rdx"], [33, "movsd xmm0, qword ptr [rax]"], [34, "comisd xmm0, xmm1"], [35, "jbe short loc_410324"], [36, "mov rax, [rbp+var_18]"], [37, "lea rdx, ds:0[rax*8]"], [38, "mov rax, [rbp+var_28]"], [39, "add rax, rdx"], [40, "movsd xmm0, qword ptr [rax]"], [41, "jmp short loc_410347"], [42, "mov rax, [rbp+var_30]"], [43, "mov rdx, [rax+10h]"], [44, "mov rax, [rbp+var_10]"], [45, "shl rax, 3"], [46, "add rax, rdx"], [47, "movsd xmm0, qword ptr [rax]"], [48, "movq xmm1, cs:qword_4187D0"], [49, "andpd xmm0, xmm1"], [50, "mov rax, [rbp+var_18]"], [51, "lea rdx, ds:0[rax*8]"], [52, "mov rax, [rbp+var_28]"], [53, "add rax, rdx"], [54, "movsd qword ptr [rax], xmm0"], [55, "add [rbp+var_10], 1"], [56, "mov rax, [rbp+var_30]"], [57, "mov rdx, [rax]"], [58, "mov rax, [rbp+var_8]"], [59, "add rax, 1"], [60, "shl rax, 3"], [61, "add rax, rdx"], [62, "mov rax, [rax]"], [63, "cmp [rbp+var_10], rax"], [64, "jl loc_4102B1"], [65, "add [rbp+var_8], 1"], [66, "mov rax, [rbp+var_30]"], [67, "mov rax, [rax+18h]"], [68, "cmp [rbp+var_8], rax"], [69, "jl loc_410293"], [70, "nop"], [71, "nop"], [72, "pop rbp"], [73, "retn"]], "data_dep": [[6, 3], [7, 54], [7, 6], [8, 4], [8, 65], [9, 8], [10, 7], [10, 9], [11, 54], [11, 10], [12, 11], [14, 3], [15, 14], [15, 54], [16, 12], [16, 55], [17, 16], [18, 17], [18, 15], [19, 18], [19, 54], [20, 19], [21, 3], [22, 21], [22, 54], [23, 12], [23, 55], [24, 23], [25, 22], [25, 24], [26, 25], [26, 54], [28, 27], [28, 26], [29, 20], [30, 22], [31, 2], [32, 30], [32, 31], [33, 54], [33, 32], [34, 28], [34, 33], [35, 32], [36, 20], [37, 30], [38, 2], [39, 37], [39, 38], [40, 54], [40, 39], [42, 3], [43, 54], [43, 42], [44, 12], [44, 55], [45, 44], [46, 43], [46, 45], [47, 54], [47, 46], [49, 48], [49, 47], [50, 20], [51, 43], [51, 37], [52, 2], [53, 52], [53, 51], [54, 40], [54, 49], [54, 53], [55, 12], [55, 55], [56, 3], [57, 54], [57, 56], [58, 65], [58, 4], [59, 58], [60, 59], [61, 60], [61, 57], [62, 61], [62, 54], [63, 12], [63, 62], [63, 55], [64, 63], [65, 65], [65, 4], [66, 3], [67, 54], [67, 66], [68, 4], [68, 65], [68, 67], [69, 68], [72, 0], [73, 67]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2_bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.jsonl.gz", "strip_func_name": "sub_41027A", "query": "\n\n\n__int64 __fastcall sub_41027A(__int64 a1, _QWORD *a2)\n{\ndouble v2; // xmm0_8\n__int64 result; // rax\n__int64 v4; // [rsp+18h] [rbp-18h]\n__int64 j; // [rsp+20h] [rbp-10h]\n__int64 i; // [rsp+28h] [rbp-8h]\n\nfor ( i = 0LL; ; ++i )\n{\nresult = a2[3];\nif ( i >= result )\nbreak;\nfor ( j = *(_QWORD *)(*a2 + 8 * i); j < *(_QWORD *)(*a2 + 8 * (i + 1)); ++j )\n{\nv4 = *(_QWORD *)(a2[1] + 8 * j);\nif ( *(double *)(8 * v4 + a1) <= fabs(*(double *)(a2[2] + 8 * j)) )\nv2 = fabs(*(double *)(a2[2] + 8 * j));\nelse\nv2 = *(double *)(8 * v4 + a1);\n*(double *)(8 * v4 + a1) = v2;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,sub_41027A,]", "hints": "[]", "response": "{'a1': 'E', 'a2': 'mat', 'v4': 'row', 'sub_41027A': 'max_rows'}"} | [
[
0.7391971349716187,
0.735608696937561,
0.7311331033706665,
0.7281025648117065,
0.7224949598312378,
0.7165691256523132,
0.7100141048431396,
0.705088198184967,
0.7026981115341187,
0.70216965675354,
0.6957747936248779,
0.6896586418151855,
0.6864781379699707,
0.6819579601287842,
0.6798421144485474,
0.6798180341720581,
0.6775635480880737,
0.674569308757782,
0.6741775870323181,
0.6681275963783264
],
[
77669,
147416,
117125,
81578,
246521,
144979,
29007,
100075,
57167,
250384,
84317,
201350,
40155,
26814,
199848,
226812,
200948,
118278,
211995,
134927
]
] |
|
init_log | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | int init_log()
{
if (opt_logging_to_file) {
log_file = fopen(LOG_FILE, "w");
if (log_file == NULL) {
fprintf(stderr, "Failed to open or create log file %s\n", LOG_FILE);
return -1;
}
chmod(LOG_FILE, 0644);
setbuf(log_file, NULL);
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40753D", "function_addr": 4224317, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov eax, cs:dword_42B374"], [3, "test eax, eax"], [4, "jz short loc_4075B5"], [5, "mov esi, offset aW_1"], [6, "mov edi, offset file"], [7, "call _fopen"], [8, "mov cs:stream, rax"], [9, "mov rax, cs:stream"], [10, "test rax, rax"], [11, "jnz short loc_407592"], [12, "mov rax, cs:stderr"], [13, "mov edx, offset file"], [14, "mov esi, offset aFailedToOpenOr"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _fprintf"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp short loc_4075BA"], [20, "mov esi, 1A4h"], [21, "mov edi, offset file"], [22, "call _chmod"], [23, "mov rax, cs:stream"], [24, "mov esi, 0"], [25, "mov rdi, rax"], [26, "call _setbuf"], [27, "mov eax, 0"], [28, "pop rbp"], [29, "retn"]], "data_dep": [[3, 2], [4, 3], [8, 7], [9, 8], [10, 9], [11, 10], [15, 12], [23, 8], [25, 23], [28, 0], [29, 27], [29, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_40753D", "query": "\n\n\n__int64 sub_40753D()\n{\nif ( dword_42B374 )\n{\nstream = fopen(\"/var/log/intangd.log\", \"w\");\nif ( !stream )\n{\nfprintf(stderr, \"Failed to open or create log file %s\\n\", \"/var/log/intangd.log\");\nreturn 0xFFFFFFFFLL;\n}\nchmod(\"/var/log/intangd.log\", 0x1A4u);\nsetbuf(stream, 0LL);\n}\nreturn 0LL;\n}\n\n\n\nQ:[sub_40753D,]", "hints": "[]", "response": "{'sub_40753D': 'init_log'}"} | [
[
0.8804379105567932,
0.8456598520278931,
0.8342059850692749,
0.830363929271698,
0.8271898031234741,
0.8244284987449646,
0.8094682693481445,
0.8020020723342896,
0.7927746772766113,
0.7913370132446289,
0.7906363606452942,
0.777144193649292,
0.7763006687164307,
0.7752058506011963,
0.7711386680603027,
0.7637490034103394,
0.7579681873321533,
0.7576459050178528,
0.7548097372055054,
0.7483153343200684
],
[
225420,
152150,
219918,
224272,
190374,
76414,
77133,
205757,
204983,
189288,
231544,
116669,
53475,
41097,
117656,
247494,
128490,
153231,
12738,
118255
]
] |
|
bmp_create | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | int bmp_create(BMP *pb, int w, int h)
{
pb->width = abs(w);
pb->height = abs(h);
pb->stride = ALIGN(pb->width * 3, 4);
pb->pdata = malloc((size_t)pb->stride * h);
return pb->pdata ? 0 : -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401580", "function_addr": 4199808, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov [rbp+var_10], edx"], [6, "mov eax, [rbp+var_C]"], [7, "cdq"], [8, "mov eax, edx"], [9, "xor eax, [rbp+var_C]"], [10, "sub eax, edx"], [11, "mov rdx, [rbp+var_8]"], [12, "mov [rdx], eax"], [13, "mov eax, [rbp+var_10]"], [14, "cdq"], [15, "mov eax, edx"], [16, "xor eax, [rbp+var_10]"], [17, "sub eax, edx"], [18, "mov rdx, [rbp+var_8]"], [19, "mov [rdx+4], eax"], [20, "mov rax, [rbp+var_8]"], [21, "mov eax, [rax]"], [22, "lea edx, [rax+1]"], [23, "mov eax, edx"], [24, "add eax, eax"], [25, "add eax, edx"], [26, "lea edx, [rax+3]"], [27, "test eax, eax"], [28, "cmovs eax, edx"], [29, "sar eax, 2"], [30, "lea edx, ds:0[rax*4]"], [31, "mov rax, [rbp+var_8]"], [32, "mov [rax+8], edx"], [33, "mov rax, [rbp+var_8]"], [34, "mov eax, [rax+8]"], [35, "movsxd rdx, eax"], [36, "mov eax, [rbp+var_10]"], [37, "cdqe"], [38, "imul rax, rdx"], [39, "mov rdi, rax"], [40, "call _malloc"], [41, "mov rdx, rax"], [42, "mov rax, [rbp+var_8]"], [43, "mov [rax+10h], rdx"], [44, "mov rax, [rbp+var_8]"], [45, "mov rax, [rax+10h]"], [46, "test rax, rax"], [47, "jz short loc_401617"], [48, "mov eax, 0"], [49, "jmp short locret_40161C"], [50, "mov eax, 0FFFFFFFFh"], [51, "leave"], [52, "retn"]], "data_dep": [[6, 4], [9, 8], [9, 4], [10, 9], [11, 3], [12, 10], [12, 11], [13, 5], [15, 11], [16, 15], [16, 5], [17, 11], [17, 16], [18, 3], [19, 18], [19, 17], [20, 3], [21, 19], [21, 20], [22, 19], [22, 18], [22, 21], [23, 22], [24, 23], [25, 22], [25, 24], [26, 25], [26, 19], [26, 22], [27, 25], [28, 27], [28, 26], [29, 28], [30, 26], [31, 3], [32, 31], [32, 30], [33, 3], [34, 33], [34, 32], [35, 34], [36, 5], [38, 35], [38, 36], [39, 38], [41, 40], [42, 3], [43, 42], [43, 41], [44, 3], [45, 43], [45, 44], [46, 45], [47, 46], [52, 48], [52, 50]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea_219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.jsonl.gz", "strip_func_name": "sub_401580", "query": "\n\n\n__int64 __fastcall sub_401580(__int64 a1, int a2, int a3)\n{\n__int64 result; // rax\n\n*(_DWORD *)a1 = abs32(a2);\n*(_DWORD *)(a1 + 4) = abs32(a3);\n*(_DWORD *)(a1 + 8) = 4 * (3 * (*(_DWORD *)a1 + 1) / 4);\n*(_QWORD *)(a1 + 16) = malloc(*(int *)(a1 + 8) * (__int64)a3);\nif ( *(_QWORD *)(a1 + 16) )\nresult = 0LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_401580,]", "hints": "[]", "response": "{'a3': 'h', 'a1': 'pb', 'a2': 'w', 'sub_401580': 'bmp_create'}"} | [
[
0.7888712882995605,
0.7662563323974609,
0.7381270527839661,
0.7350600957870483,
0.7334631681442261,
0.7247055768966675,
0.724420964717865,
0.723919689655304,
0.7231946587562561,
0.7224013209342957,
0.7221538424491882,
0.7212711572647095,
0.717497706413269,
0.7150944471359253,
0.7150468826293945,
0.7136105895042419,
0.7134424448013306,
0.7127895355224609,
0.7123968601226807,
0.7118186354637146
],
[
93407,
28657,
206409,
248685,
64158,
198551,
176655,
193285,
171522,
11624,
210623,
203308,
34559,
40530,
153878,
80459,
29810,
117193,
204701,
131625
]
] |
|
is_init_infinite_loop | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static bool is_init_infinite_loop(gvisitor_t *self, gnode_identifier_expr_t *identifier, gnode_r *list) {
// for example:
// class c1 {
// func init() {
// var a = c1(); // INFINITE LOOP
// var a = self(); // INFINITE LOOP
// }
// }
// conditions for an infinite loop in init:
// 1. there should be at least 2 declarations in the stack
gnode_r *decls = ((semacheck_t *)self->data)->declarations;
size_t len = gnode_array_size(decls);
if (len < 2) return false;
// 2. current function is init
if (!is_init_function(gnode_array_get(decls, len-1))) return false;
// 3. outer declaration is a class
gnode_t *target_node = gnode_array_get(decls, len-2);
if (!ISA(target_node, NODE_CLASS_DECL)) return false;
// 4. identifier is self OR identifier->symbol points to target_node
bool continue_check = false;
if (identifier->symbol) continue_check = target_node == identifier->symbol;
else continue_check = ((identifier->value) && (strcmp(identifier->value, SELF_PARAMETER_NAME) == 0));
if (!continue_check) return false;
// 5. check if next node is a call
size_t count = gnode_array_size(list);
if (count < 1) return false;
gnode_postfix_subexpr_t *subnode = (gnode_postfix_subexpr_t *)gnode_array_get(list, 0);
return (subnode->base.tag == NODE_CALL_EXPR);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4193C2", "function_addr": 4297666, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_48], rdx"], [6, "mov rax, [rbp+var_38]"], [7, "mov rax, [rax+8]"], [8, "mov rax, [rax]"], [9, "mov [rbp+var_10], rax"], [10, "cmp [rbp+var_10], 0"], [11, "jz short loc_4193F5"], [12, "mov rax, [rbp+var_10]"], [13, "mov rax, [rax]"], [14, "jmp short loc_4193FA"], [15, "mov eax, 0"], [16, "mov [rbp+var_18], rax"], [17, "cmp [rbp+var_18], 1"], [18, "ja short loc_41940F"], [19, "mov eax, 0"], [20, "jmp locret_419579"], [21, "mov rax, [rbp+var_18]"], [22, "lea rdx, [rax-1]"], [23, "mov rax, [rbp+var_10]"], [24, "mov rax, [rax]"], [25, "cmp rdx, rax"], [26, "jnb short loc_41943F"], [27, "mov rax, [rbp+var_10]"], [28, "mov rdx, [rax+10h]"], [29, "mov rax, [rbp+var_18]"], [30, "shl rax, 3"], [31, "sub rax, 8"], [32, "add rax, rdx"], [33, "mov rax, [rax]"], [34, "jmp short loc_419444"], [35, "mov eax, 0"], [36, "mov rdi, rax"], [37, "call sub_419363"], [38, "xor eax, 1"], [39, "test al, al"], [40, "jz short loc_41945D"], [41, "mov eax, 0"], [42, "jmp locret_419579"], [43, "mov rax, [rbp+var_18]"], [44, "lea rdx, [rax-2]"], [45, "mov rax, [rbp+var_10]"], [46, "mov rax, [rax]"], [47, "cmp rdx, rax"], [48, "jnb short loc_41948D"], [49, "mov rax, [rbp+var_10]"], [50, "mov rdx, [rax+10h]"], [51, "mov rax, [rbp+var_18]"], [52, "shl rax, 3"], [53, "sub rax, 10h"], [54, "add rax, rdx"], [55, "mov rax, [rax]"], [56, "jmp short loc_419492"], [57, "mov eax, 0"], [58, "mov [rbp+var_20], rax"], [59, "cmp [rbp+var_20], 0"], [60, "jz short loc_4194A8"], [61, "mov rax, [rbp+var_20]"], [62, "mov eax, [rax]"], [63, "cmp eax, 0Ah"], [64, "jz short loc_4194B2"], [65, "mov eax, 0"], [66, "jmp locret_419579"], [67, "mov [rbp+var_1], 0"], [68, "mov rax, [rbp+var_40]"], [69, "mov rax, [rax+58h]"], [70, "test rax, rax"], [71, "jz short loc_4194D7"], [72, "mov rax, [rbp+var_40]"], [73, "mov rax, [rax+58h]"], [74, "cmp [rbp+var_20], rax"], [75, "setz al"], [76, "mov [rbp+var_1], al"], [77, "jmp short loc_419512"], [78, "mov rax, [rbp+var_40]"], [79, "mov rax, [rax+48h]"], [80, "test rax, rax"], [81, "jz short loc_419506"], [82, "mov rax, [rbp+var_40]"], [83, "mov rax, [rax+48h]"], [84, "lea rsi, aSelf_0"], [85, "mov rdi, rax"], [86, "call _strcmp"], [87, "test eax, eax"], [88, "jnz short loc_419506"], [89, "mov eax, 1"], [90, "jmp short loc_41950B"], [91, "mov eax, 0"], [92, "mov [rbp+var_1], al"], [93, "and [rbp+var_1], 1"], [94, "movzx eax, [rbp+var_1]"], [95, "xor eax, 1"], [96, "test al, al"], [97, "jz short loc_419524"], [98, "mov eax, 0"], [99, "jmp short locret_419579"], [100, "cmp [rbp+var_48], 0"], [101, "jz short loc_419534"], [102, "mov rax, [rbp+var_48]"], [103, "mov rax, [rax]"], [104, "jmp short loc_419539"], [105, "mov eax, 0"], [106, "mov [rbp+var_28], rax"], [107, "cmp [rbp+var_28], 0"], [108, "jnz short loc_41954B"], [109, "mov eax, 0"], [110, "jmp short locret_419579"], [111, "mov rax, [rbp+var_48]"], [112, "mov rax, [rax]"], [113, "test rax, rax"], [114, "jz short loc_419564"], [115, "mov rax, [rbp+var_48]"], [116, "mov rax, [rax+10h]"], [117, "mov rax, [rax]"], [118, "jmp short loc_419569"], [119, "mov eax, 0"], [120, "mov [rbp+var_30], rax"], [121, "mov rax, [rbp+var_30]"], [122, "mov eax, [rax]"], [123, "cmp eax, 15h"], [124, "setz al"], [125, "leave"], [126, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 9], [13, 12], [16, 13], [16, 15], [17, 16], [18, 17], [21, 16], [22, 21], [23, 9], [24, 23], [25, 22], [25, 24], [26, 25], [27, 9], [28, 27], [29, 16], [30, 29], [31, 30], [32, 31], [32, 28], [33, 32], [36, 33], [36, 35], [38, 37], [39, 38], [40, 39], [43, 16], [44, 22], [44, 28], [44, 43], [45, 9], [46, 45], [47, 44], [47, 46], [48, 47], [49, 9], [50, 49], [51, 16], [52, 51], [53, 52], [54, 53], [54, 50], [55, 54], [58, 55], [58, 57], [59, 58], [60, 59], [61, 58], [62, 61], [63, 62], [64, 63], [68, 4], [69, 68], [70, 69], [71, 70], [72, 4], [73, 72], [74, 73], [74, 58], [75, 74], [75, 73], [76, 75], [78, 4], [79, 78], [80, 79], [81, 80], [82, 4], [83, 82], [85, 83], [87, 86], [88, 87], [92, 89], [92, 91], [93, 92], [94, 76], [94, 93], [95, 94], [96, 95], [97, 96], [100, 5], [101, 100], [102, 5], [103, 102], [106, 103], [106, 105], [107, 106], [108, 107], [111, 5], [112, 111], [113, 112], [114, 113], [115, 5], [116, 115], [117, 116], [120, 117], [120, 119], [121, 120], [122, 121], [123, 122], [124, 122], [124, 123], [126, 41], [126, 98], [126, 109], [126, 65], [126, 19], [126, 124]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_4193C2", "query": "\n\n\nbool __fastcall sub_4193C2(__int64 a1, __int64 a2, __int64 *a3)\n{\nunsigned __int64 v3; // rax\n__int64 v5; // rax\n_DWORD *v6; // rax\nbool v7; // al\n__int64 v8; // rax\n_DWORD *v9; // rax\nunsigned __int64 v11; // [rsp+38h] [rbp-18h]\nunsigned __int64 *v12; // [rsp+40h] [rbp-10h]\nbool v13; // [rsp+4Fh] [rbp-1h]\n\nv12 = **(unsigned __int64 ***)(a1 + 8);\nif ( v12 )\nv3 = *v12;\nelse\nv3 = 0LL;\nv11 = v3;\nif ( v3 <= 1 )\nreturn 0;\nif ( v3 - 1 >= *v12 )\nv5 = 0LL;\nelse\nv5 = *(_QWORD *)(v12[2] + 8 * v3 - 8);\nif ( !sub_419363(v5) )\nreturn 0;\nif ( v11 - 2 >= *v12 )\nv6 = 0LL;\nelse\nv6 = *(_DWORD **)(v12[2] + 8 * v11 - 16);\nif ( !v6 || *v6 != 10 )\nreturn 0;\nif ( *(_QWORD *)(a2 + 88) )\n{\nv13 = v6 == *(_DWORD **)(a2 + 88);\n}\nelse\n{\nv7 = *(_QWORD *)(a2 + 72) && !strcmp(*(const char **)(a2 + 72), \"self\");\nv13 = v7;\n}\nif ( !v13 )\nreturn 0;\nif ( a3 )\nv8 = *a3;\nelse\nv8 = 0LL;\nif ( !v8 )\nreturn 0;\nif ( *a3 )\nv9 = *(_DWORD **)a3[2];\nelse\nv9 = 0LL;\nreturn *v9 == 21;\n}\n\n\n\nQ:[a3,a1,a2,v11,v12,v13,sub_4193C2,sub_419363,]", "hints": "[]", "response": "{'a3': 'list', 'a1': 'self', 'a2': 'identifier', 'v11': 'len', 'v12': 'decls', 'v13': 'continue_check', 'sub_4193C2': 'is_init_infinite_loop', 'sub_419363': 'is_init_function'}"} | [
[
0.7830562591552734,
0.7534791827201843,
0.7230522632598877,
0.7225323915481567,
0.7207042574882507,
0.7142415046691895,
0.7131375074386597,
0.7106485366821289,
0.7073855400085449,
0.7032148838043213,
0.6976252794265747,
0.6963744759559631,
0.6879127025604248,
0.6862281560897827,
0.6804271936416626,
0.6742391586303711,
0.6736279726028442,
0.6722044944763184,
0.6710056662559509,
0.6699475049972534
],
[
238086,
195668,
92524,
75328,
194472,
246521,
160283,
149256,
84317,
165763,
48036,
84558,
40264,
73165,
260494,
149887,
219560,
137249,
124021,
166516
]
] |
|
set_int | 2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5 | xelerance | xl2tpd | NA | int set_int (char *word, char *value, int *ptr)
{
int val;
#ifdef DEBUG_FILE
l2tp_log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
#endif /* ; */
if ((val = atoi (value)) < 0)
{
snprintf (filerr, sizeof (filerr), "%s must be a number\n", word);
return -1;
}
*ptr = val;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_415305", "function_addr": 4281093, "binary_name": "2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+nptr], rsi"], [5, "mov [rbp+var_28], rdx"], [6, "mov rax, [rbp+nptr]"], [7, "mov rdi, rax"], [8, "call _atoi"], [9, "mov [rbp+var_4], eax"], [10, "cmp [rbp+var_4], 0"], [11, "jns short loc_415355"], [12, "mov rax, [rbp+var_18]"], [13, "mov rcx, rax"], [14, "mov edx, offset aSMustBeANumber"], [15, "mov esi, 64h "], [16, "mov edi, offset byte_426340"], [17, "mov eax, 0"], [18, "call _snprintf"], [19, "mov eax, 0FFFFFFFFh"], [20, "jmp short locret_415363"], [21, "mov rax, [rbp+var_28]"], [22, "mov edx, [rbp+var_4]"], [23, "mov [rax], edx"], [24, "mov eax, 0"], [25, "leave"], [26, "retn"]], "data_dep": [[6, 4], [7, 6], [9, 8], [10, 9], [11, 10], [12, 3], [13, 12], [21, 5], [22, 9], [23, 22], [23, 21], [26, 24], [26, 19]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5_2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.jsonl.gz", "strip_func_name": "sub_415305", "query": "\n\n\n__int64 __fastcall sub_415305(const char *a1, const char *a2, int *a3)\n{\n__int64 result; // rax\nint v5; // [rsp+2Ch] [rbp-4h]\n\nv5 = atoi(a2);\nif ( v5 >= 0 )\n{\n*a3 = v5;\nresult = 0LL;\n}\nelse\n{\nsnprintf(byte_426340, 0x64uLL, \"%s must be a number\\n\", a1);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,sub_415305,]", "hints": "[]", "response": "{'a3': 'ptr', 'a1': 'word', 'a2': 'value', 'v5': 'val', 'sub_415305': 'set_int'}"} | [
[
0.8454185724258423,
0.7759377360343933,
0.7720257043838501,
0.7708805799484253,
0.7639679908752441,
0.7554860711097717,
0.7552157640457153,
0.7487379908561707,
0.7434573173522949,
0.7356786131858826,
0.7320727109909058,
0.7311217188835144,
0.7284021377563477,
0.7233079671859741,
0.7230261564254761,
0.7202635407447815,
0.7201952338218689,
0.7176746129989624,
0.716090202331543,
0.7147778868675232
],
[
198883,
235237,
134798,
257318,
234259,
234556,
158082,
249766,
157917,
119149,
155000,
141768,
144717,
132966,
264354,
207090,
217359,
61130,
12382,
174283
]
] |
|
mei_send_msg | 5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53 | mjg59 | mei-amt-check | NA | static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer,
ssize_t len, unsigned long timeout)
{
struct timeval tv;
ssize_t written;
ssize_t rc;
fd_set set;
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000000;
mei_msg(me, "call write length = %zd\n", len);
written = write(me->fd, buffer, len);
if (written < 0) {
rc = -errno;
mei_err(me, "write failed with status %zd %s\n",
written, strerror(errno));
goto out;
}
FD_ZERO(&set);
FD_SET(me->fd, &set);
rc = select(me->fd + 1 , &set, NULL, NULL, &tv);
if (rc > 0 && FD_ISSET(me->fd, &set)) {
mei_msg(me, "write success\n");
} else if (rc == 0) {
mei_err(me, "write failed on timeout with status\n");
goto out;
} else { /* rc < 0 */
mei_err(me, "write failed on select with status %zd\n", rc);
goto out;
}
rc = written;
out:
if (rc < 0)
mei_deinit(me);
return rc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401589", "function_addr": 4199817, "binary_name": "5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0D0h"], [3, "mov [rbp+var_B8], rdi"], [4, "mov [rbp+buf], rsi"], [5, "mov [rbp+n], rdx"], [6, "mov [rbp+var_D0], rcx"], [7, "mov rax, [rbp+var_D0]"], [8, "shr rax, 3"], [9, "mov rdx, 20C49BA5E353F7CFh"], [10, "mul rdx"], [11, "mov rax, rdx"], [12, "shr rax, 4"], [13, "mov [rbp+timeout.tv_sec], rax"], [14, "mov rcx, [rbp+var_D0]"], [15, "mov rax, rcx"], [16, "shr rax, 3"], [17, "mov rdx, 20C49BA5E353F7CFh"], [18, "mul rdx"], [19, "mov rax, rdx"], [20, "shr rax, 4"], [21, "imul rdx, rax, 3E8h"], [22, "mov rax, rcx"], [23, "sub rax, rdx"], [24, "imul rax, 0F4240h"], [25, "mov [rbp+timeout.tv_usec], rax"], [26, "mov rax, [rbp+var_B8]"], [27, "movzx eax, byte ptr [rax+11h]"], [28, "test al, al"], [29, "jz short loc_40163C"], [30, "mov rax, cs:stderr"], [31, "mov rdx, [rbp+n]"], [32, "mov esi, offset aCallWriteLengt"], [33, "mov rdi, rax"], [34, "mov eax, 0"], [35, "call _fprintf"], [36, "mov rdx, [rbp+n]"], [37, "mov rax, [rbp+var_B8]"], [38, "mov eax, [rax+1Ch]"], [39, "mov rcx, [rbp+buf]"], [40, "mov rsi, rcx"], [41, "mov edi, eax"], [42, "call _write"], [43, "mov [rbp+var_10], rax"], [44, "cmp [rbp+var_10], 0"], [45, "jns short loc_4016AB"], [46, "call ___errno_location"], [47, "mov eax, [rax]"], [48, "neg eax"], [49, "cdqe"], [50, "mov [rbp+var_8], rax"], [51, "call ___errno_location"], [52, "mov eax, [rax]"], [53, "mov edi, eax"], [54, "call _strerror"], [55, "mov rcx, rax"], [56, "mov rax, cs:stderr"], [57, "mov rdx, [rbp+var_10]"], [58, "mov esi, offset aErrorWriteFail"], [59, "mov rdi, rax"], [60, "mov eax, 0"], [61, "call _fprintf"], [62, "jmp loc_401822"], [63, "mov eax, 0"], [64, "mov ecx, 10h"], [65, "lea rdx, [rbp+readfds]"], [66, "mov rdi, rdx"], [67, "cld"], [68, "rep stosq"], [69, "mov eax, edi"], [70, "mov edx, ecx"], [71, "mov [rbp+var_14], edx"], [72, "mov [rbp+var_18], eax"], [73, "mov rax, [rbp+var_B8]"], [74, "mov eax, [rax+1Ch]"], [75, "lea edx, [rax+3Fh]"], [76, "test eax, eax"], [77, "cmovs eax, edx"], [78, "sar eax, 6"], [79, "mov esi, eax"], [80, "movsxd rax, esi"], [81, "mov rdi, [rbp+rax*8+readfds.fds_bits]"], [82, "mov rax, [rbp+var_B8]"], [83, "mov eax, [rax+1Ch]"], [84, "cdq"], [85, "shr edx, 1Ah"], [86, "add eax, edx"], [87, "and eax, 3Fh"], [88, "sub eax, edx"], [89, "mov edx, 1"], [90, "mov ecx, eax"], [91, "shl rdx, cl"], [92, "mov rax, rdx"], [93, "or rdi, rax"], [94, "mov rdx, rdi"], [95, "movsxd rax, esi"], [96, "mov [rbp+rax*8+readfds.fds_bits], rdx"], [97, "mov rax, [rbp+var_B8]"], [98, "mov eax, [rax+1Ch]"], [99, "lea edi, [rax+1]"], [100, "lea rdx, [rbp+timeout]"], [101, "lea rax, [rbp+readfds]"], [102, "mov r8, rdx"], [103, "mov ecx, 0"], [104, "mov edx, 0"], [105, "mov rsi, rax"], [106, "call _select"], [107, "cdqe"], [108, "mov [rbp+var_8], rax"], [109, "cmp [rbp+var_8], 0"], [110, "jle short loc_4017D4"], [111, "mov rax, [rbp+var_B8]"], [112, "mov eax, [rax+1Ch]"], [113, "lea edx, [rax+3Fh]"], [114, "test eax, eax"], [115, "cmovs eax, edx"], [116, "sar eax, 6"], [117, "cdqe"], [118, "mov rsi, [rbp+rax*8+readfds.fds_bits]"], [119, "mov rax, [rbp+var_B8]"], [120, "mov eax, [rax+1Ch]"], [121, "cdq"], [122, "shr edx, 1Ah"], [123, "add eax, edx"], [124, "and eax, 3Fh"], [125, "sub eax, edx"], [126, "mov edx, 1"], [127, "mov ecx, eax"], [128, "shl rdx, cl"], [129, "mov rax, rdx"], [130, "and rax, rsi"], [131, "test rax, rax"], [132, "jz short loc_4017D4"], [133, "mov rax, [rbp+var_B8]"], [134, "movzx eax, byte ptr [rax+11h]"], [135, "test al, al"], [136, "jz short loc_40181A"], [137, "mov rax, cs:stderr"], [138, "mov rcx, rax"], [139, "mov edx, 0Eh"], [140, "mov esi, 1"], [141, "mov edi, offset aWriteSuccess"], [142, "call _fwrite"], [143, "jmp short loc_40181A"], [144, "cmp [rbp+var_8], 0"], [145, "jnz short loc_4017FB"], [146, "mov rax, cs:stderr"], [147, "mov rcx, rax"], [148, "mov edx, 2Bh "], [149, "mov esi, 1"], [150, "mov edi, offset aErrorWriteFail_0"], [151, "call _fwrite"], [152, "jmp short loc_401822"], [153, "mov rax, cs:stderr"], [154, "mov rdx, [rbp+var_8]"], [155, "mov esi, offset aErrorWriteFail_1"], [156, "mov rdi, rax"], [157, "mov eax, 0"], [158, "call _fprintf"], [159, "jmp short loc_401822"], [160, "mov rax, [rbp+var_10]"], [161, "mov [rbp+var_8], rax"], [162, "cmp [rbp+var_8], 0"], [163, "jns short loc_401838"], [164, "mov rax, [rbp+var_B8]"], [165, "mov rdi, rax"], [166, "call sub_401242"], [167, "mov rax, [rbp+var_8]"], [168, "leave"], [169, "retn"]], "data_dep": [[7, 6], [8, 7], [10, 9], [11, 10], [12, 11], [13, 12], [14, 6], [15, 14], [16, 15], [18, 17], [19, 18], [20, 19], [21, 18], [21, 20], [22, 14], [23, 22], [23, 21], [24, 23], [25, 24], [26, 3], [27, 26], [28, 27], [29, 28], [31, 5], [33, 30], [36, 5], [37, 3], [38, 37], [39, 4], [40, 39], [41, 38], [43, 42], [44, 43], [45, 44], [47, 46], [48, 47], [50, 48], [52, 51], [53, 52], [55, 54], [57, 43], [59, 56], [65, 36], [66, 65], [69, 66], [70, 64], [71, 70], [72, 69], [73, 3], [74, 73], [75, 74], [75, 70], [76, 74], [77, 76], [77, 75], [78, 77], [79, 78], [80, 79], [81, 80], [82, 3], [83, 82], [85, 75], [86, 83], [86, 85], [87, 86], [88, 85], [88, 87], [90, 88], [91, 89], [91, 90], [92, 91], [93, 81], [93, 92], [94, 93], [95, 79], [96, 95], [96, 94], [97, 3], [98, 97], [99, 93], [99, 98], [100, 94], [101, 98], [102, 100], [105, 101], [108, 106], [109, 108], [110, 109], [111, 3], [112, 111], [113, 112], [113, 104], [114, 112], [115, 114], [115, 113], [116, 115], [118, 96], [118, 116], [119, 3], [120, 119], [122, 113], [123, 120], [123, 122], [124, 123], [125, 122], [125, 124], [127, 125], [128, 126], [128, 127], [129, 128], [130, 118], [130, 129], [131, 130], [132, 131], [133, 3], [134, 133], [135, 134], [136, 135], [138, 137], [144, 108], [145, 144], [147, 146], [154, 108], [156, 153], [160, 43], [161, 160], [162, 161], [162, 108], [162, 50], [163, 162], [164, 3], [165, 164], [167, 161], [167, 108], [167, 50], [169, 167]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53_5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53.jsonl.gz", "strip_func_name": "sub_401589", "query": "\n\n\n__int64 __fastcall sub_401589(__int64 a1, const void *a2, size_t a3, unsigned __int64 a4)\n{\nint *v4; // rax\nchar *v5; // rax\nint v6; // eax\nfd_set readfds; // [rsp+20h] [rbp-B0h] BYREF\nstruct timeval timeout; // [rsp+A0h] [rbp-30h] BYREF\nunsigned int v11; // [rsp+B8h] [rbp-18h]\nint v12; // [rsp+BCh] [rbp-14h]\nssize_t v13; // [rsp+C0h] [rbp-10h]\n__int64 v14; // [rsp+C8h] [rbp-8h]\n\ntimeout.tv_sec = a4 / 0x3E8;\ntimeout.tv_usec = 1000000 * (a4 % 0x3E8);\nif ( *(_BYTE *)(a1 + 17) )\nfprintf(stderr, \"call write length = %zd\\n\", a3);\nv13 = write(*(_DWORD *)(a1 + 28), a2, a3);\nif ( v13 >= 0 )\n{\nmemset(&readfds, 0, sizeof(readfds));\nv12 = 0;\nv11 = (unsigned int)&timeout;\nreadfds.fds_bits[*(_DWORD *)(a1 + 28) / 64] |= 1LL << (*(_DWORD *)(a1 + 28) % 64);\nv6 = select(*(_DWORD *)(a1 + 28) + 1, &readfds, 0LL, 0LL, &timeout);\nv14 = v6;\nif ( v6 > 0 && (readfds.fds_bits[*(_DWORD *)(a1 + 28) / 64] & (1LL << (*(_DWORD *)(a1 + 28) % 64))) != 0 )\n{\nif ( *(_BYTE *)(a1 + 17) )\nfwrite(\"write success\\n\", 1uLL, 0xEuLL, stderr);\nv14 = v13;\n}\nelse if ( v14 )\n{\nfprintf(stderr, \"Error: write failed on select with status %zd\\n\", v14);\n}\nelse\n{\nfwrite(\"Error: write failed on timeout with status\\n\", 1uLL, 0x2BuLL, stderr);\n}\n}\nelse\n{\nv14 = -*__errno_location();\nv4 = __errno_location();\nv5 = strerror(*v4);\nfprintf(stderr, \"Error: write failed with status %zd %s\\n\", v13, v5);\n}\nif ( v14 < 0 )\nsub_401242(a1);\nreturn v14;\n}\n\n\n\nQ:[a3,a4,a1,a2,readfds,timeout,v11,v12,v13,v14,sub_401589,sub_401242,]", "hints": "[]", "response": "{'a3': 'len', 'a4': 'timeout', 'a1': 'me', 'a2': 'buffer', 'readfds': 'set', 'timeout': 'tv', 'v11': '__d1', 'v12': '__d0', 'v13': 'written', 'v14': 'rc', 'sub_401589': 'mei_send_msg', 'sub_401242': 'mei_deinit'}"} | [
[
0.7832004427909851,
0.749848484992981,
0.7311005592346191,
0.7159184813499451,
0.7101946473121643,
0.7017258405685425,
0.7009149789810181,
0.7003915905952454,
0.6979925632476807,
0.6920126676559448,
0.691525936126709,
0.6894828081130981,
0.6884214878082275,
0.6870568990707397,
0.6867872476577759,
0.6842690706253052,
0.6818997859954834,
0.6780987977981567,
0.6742782592773438,
0.6711855530738831
],
[
129148,
21593,
178326,
97427,
164777,
139039,
103658,
16403,
247910,
46869,
103170,
213380,
142929,
16501,
15042,
24562,
168740,
227082,
201468,
264760
]
] |
|
get_type_tag | 7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53 | kgabis | ape | NA | static uint64_t get_type_tag(object_type_t type) {
switch (type) {
case OBJECT_NONE: return 0;
case OBJECT_BOOL: return 1;
case OBJECT_NULL: return 2;
default: return 4;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_419199", "function_addr": 4297113, "binary_name": "7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "cmp [rbp+var_4], 10h"], [4, "jz short loc_4191C8"], [5, "cmp [rbp+var_4], 10h"], [6, "ja short loc_4191CF"], [7, "cmp [rbp+var_4], 0"], [8, "jz short loc_4191BA"], [9, "cmp [rbp+var_4], 4"], [10, "jz short loc_4191C1"], [11, "jmp short loc_4191CF"], [12, "mov eax, 0"], [13, "jmp short loc_4191D4"], [14, "mov eax, 1"], [15, "jmp short loc_4191D4"], [16, "mov eax, 2"], [17, "jmp short loc_4191D4"], [18, "mov eax, 4"], [19, "pop rbp"], [20, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 2], [6, 5], [7, 2], [8, 7], [9, 2], [10, 9], [19, 0], [20, 14], [20, 16], [20, 12], [20, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53_7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.jsonl.gz", "strip_func_name": "sub_419199", "query": "\n\n\n__int64 __fastcall sub_419199(unsigned int a1)\n{\n__int64 result; // rax\n\nif ( a1 == 16 )\nreturn 2LL;\nif ( a1 > 0x10 )\ngoto LABEL_9;\nif ( !a1 )\nreturn 0LL;\nif ( a1 == 4 )\nresult = 1LL;\nelse\nLABEL_9:\nresult = 4LL;\nreturn result;\n}\n\n\n\nQ:[a1,sub_419199,]", "hints": "[]", "response": "{'a1': 'type', 'sub_419199': 'get_type_tag'}"} | [
[
0.8869409561157227,
0.8855395317077637,
0.8757055997848511,
0.8752440214157104,
0.8718056082725525,
0.8710216283798218,
0.8709859848022461,
0.864273190498352,
0.8626952171325684,
0.8620941638946533,
0.8592347502708435,
0.8589221835136414,
0.858540415763855,
0.8578439950942993,
0.8542189598083496,
0.8539102077484131,
0.8531053066253662,
0.849622905254364,
0.8488030433654785,
0.8486778736114502
],
[
225555,
215357,
261079,
2843,
16518,
262300,
228054,
61186,
76239,
128880,
28684,
237182,
179876,
183989,
16668,
259055,
107906,
115671,
26404,
61966
]
] |
|
set_immutable | a21d0dd014decda4caae0526346b03c963b2444d274a544c9f3e641ededfc3a8 | MarvellEmbeddedProcessors | linux-marvell | NA | static int set_immutable(const char *path, int immutable)
{
unsigned int flags;
int fd;
int rc;
int error;
fd = open(path, O_RDONLY);
if (fd < 0)
return fd;
rc = ioctl(fd, FS_IOC_GETFLAGS, &flags);
if (rc < 0) {
error = errno;
close(fd);
errno = error;
return rc;
}
if (immutable)
flags |= FS_IMMUTABLE_FL;
else
flags &= ~FS_IMMUTABLE_FL;
rc = ioctl(fd, FS_IOC_SETFLAGS, &flags);
error = errno;
close(fd);
errno = error;
return rc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4011B2", "function_addr": 4198834, "binary_name": "a21d0dd014decda4caae0526346b03c963b2444d274a544c9f3e641ededfc3a8.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+file], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov rax, [rbp+file]"], [6, "mov esi, 0"], [7, "mov rdi, rax"], [8, "mov eax, 0"], [9, "call _open"], [10, "mov [rbp+fd], eax"], [11, "cmp [rbp+fd], 0"], [12, "jns short loc_4011E8"], [13, "mov eax, [rbp+fd]"], [14, "jmp locret_401282"], [15, "lea rdx, [rbp+var_10]"], [16, "mov eax, [rbp+fd]"], [17, "mov esi, 80086601h"], [18, "mov edi, eax"], [19, "mov eax, 0"], [20, "call _ioctl"], [21, "mov [rbp+var_8], eax"], [22, "cmp [rbp+var_8], 0"], [23, "jns short loc_40122C"], [24, "call ___errno_location"], [25, "mov eax, [rax]"], [26, "mov [rbp+var_C], eax"], [27, "mov eax, [rbp+fd]"], [28, "mov edi, eax"], [29, "call _close"], [30, "call ___errno_location"], [31, "mov edx, [rbp+var_C]"], [32, "mov [rax], edx"], [33, "mov eax, [rbp+var_8]"], [34, "jmp short locret_401282"], [35, "cmp [rbp+var_1C], 0"], [36, "jz short loc_40123D"], [37, "mov eax, [rbp+var_10]"], [38, "or eax, 10h"], [39, "mov [rbp+var_10], eax"], [40, "jmp short loc_401246"], [41, "mov eax, [rbp+var_10]"], [42, "and eax, 0FFFFFFEFh"], [43, "mov [rbp+var_10], eax"], [44, "lea rdx, [rbp+var_10]"], [45, "mov eax, [rbp+fd]"], [46, "mov esi, 40086602h"], [47, "mov edi, eax"], [48, "mov eax, 0"], [49, "call _ioctl"], [50, "mov [rbp+var_8], eax"], [51, "call ___errno_location"], [52, "mov eax, [rax]"], [53, "mov [rbp+var_C], eax"], [54, "mov eax, [rbp+fd]"], [55, "mov edi, eax"], [56, "call _close"], [57, "call ___errno_location"], [58, "mov edx, [rbp+var_C]"], [59, "mov [rax], edx"], [60, "mov eax, [rbp+var_8]"], [61, "leave"], [62, "retn"]], "data_dep": [[5, 3], [7, 5], [10, 9], [11, 10], [12, 11], [13, 10], [16, 10], [18, 16], [21, 20], [22, 21], [23, 22], [25, 24], [26, 25], [27, 10], [28, 27], [31, 26], [32, 31], [32, 30], [33, 21], [35, 4], [36, 35], [38, 37], [39, 38], [42, 41], [43, 42], [44, 39], [44, 43], [44, 15], [45, 10], [47, 45], [50, 49], [52, 51], [53, 52], [54, 10], [55, 54], [58, 53], [59, 58], [59, 57], [60, 50], [62, 13], [62, 33], [62, 60]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a21d0dd014decda4caae0526346b03c963b2444d274a544c9f3e641ededfc3a8_a21d0dd014decda4caae0526346b03c963b2444d274a544c9f3e641ededfc3a8.jsonl.gz", "strip_func_name": "sub_4011B2", "query": "\n\n\n__int64 __fastcall sub_4011B2(const char *a1, int a2)\n{\n__int64 result; // rax\nint v3; // [rsp+10h] [rbp-10h] BYREF\nint v4; // [rsp+14h] [rbp-Ch]\nunsigned int v5; // [rsp+18h] [rbp-8h]\nint fd; // [rsp+1Ch] [rbp-4h]\n\nfd = open(a1, 0);\nif ( fd < 0 )\nreturn (unsigned int)fd;\nv5 = ioctl(fd, 0x80086601uLL, &v3);\nif ( (v5 & 0x80000000) == 0 )\n{\nif ( a2 )\nv3 |= 0x10u;\nelse\nv3 &= 0xFFFFFFEF;\nv5 = ioctl(fd, 0x40086602uLL, &v3);\nv4 = *__errno_location();\nclose(fd);\n*__errno_location() = v4;\nresult = v5;\n}\nelse\n{\nv4 = *__errno_location();\nclose(fd);\n*__errno_location() = v4;\nresult = v5;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,sub_4011B2,]", "hints": "[]", "response": "{'a1': 'path', 'a2': 'immutable', 'v3': 'flags', 'v4': 'error', 'v5': 'rc', 'sub_4011B2': 'set_immutable'}"} | [
[
0.7754743099212646,
0.7718604803085327,
0.7708159685134888,
0.7625218033790588,
0.7550283670425415,
0.7515079975128174,
0.7511658072471619,
0.7485405206680298,
0.7471038699150085,
0.7451490163803101,
0.7440831065177917,
0.7417119741439819,
0.7402046918869019,
0.7398189306259155,
0.7370550036430359,
0.7356207370758057,
0.7349680662155151,
0.7347938418388367,
0.7317767143249512,
0.7317485809326172
],
[
72406,
121646,
253869,
32892,
56416,
227758,
185000,
124797,
94941,
158830,
255903,
63998,
7433,
243244,
222271,
56307,
165986,
202977,
87503,
186986
]
] |
|
term_set_databits | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | int
term_set_databits (int fd, int databits)
{
int rval, i;
struct termios2 *tiop;
rval = 0;
do { /* dummy */
i = term_find(fd);
if ( i < 0 ) {
rval = -1;
break;
}
tiop = &term.nexttermios[i];
switch (databits) {
case 5:
tiop->c_cflag = (tiop->c_cflag & ~CSIZE) | CS5;
break;
case 6:
tiop->c_cflag = (tiop->c_cflag & ~CSIZE) | CS6;
break;
case 7:
tiop->c_cflag = (tiop->c_cflag & ~CSIZE) | CS7;
break;
case 8:
tiop->c_cflag = (tiop->c_cflag & ~CSIZE) | CS8;
break;
default:
term_errno = TERM_EDATABITS;
rval = -1;
break;
}
if ( rval < 0 ) break;
} while (0);
return rval;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4072EE", "function_addr": 4223726, "binary_name": "7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 18h"], [3, "mov [rbp+var_14], edi"], [4, "mov [rbp+var_18], esi"], [5, "mov [rbp+var_4], 0"], [6, "mov eax, [rbp+var_14]"], [7, "mov edi, eax"], [8, "call sub_4065BD"], [9, "mov [rbp+var_8], eax"], [10, "cmp [rbp+var_8], 0"], [11, "jns short loc_407322"], [12, "mov [rbp+var_4], 0FFFFFFFFh"], [13, "jmp loc_4073E6"], [14, "mov eax, [rbp+var_8]"], [15, "movsxd rdx, eax"], [16, "mov rax, rdx"], [17, "shl rax, 2"], [18, "add rax, rdx"], [19, "add rax, rax"], [20, "add rax, rdx"], [21, "shl rax, 2"], [22, "add rax, 5C0h"], [23, "add rax, 40CBC0h"], [24, "add rax, 4"], [25, "mov [rbp+var_10], rax"], [26, "cmp [rbp+var_18], 8"], [27, "jz short loc_4073BB"], [28, "cmp [rbp+var_18], 8"], [29, "jg short loc_4073D0"], [30, "cmp [rbp+var_18], 7"], [31, "jz short loc_4073A3"], [32, "cmp [rbp+var_18], 7"], [33, "jg short loc_4073D0"], [34, "cmp [rbp+var_18], 5"], [35, "jz short loc_407376"], [36, "cmp [rbp+var_18], 6"], [37, "jz short loc_40738B"], [38, "jmp short loc_4073D0"], [39, "mov rax, [rbp+var_10]"], [40, "mov eax, [rax+8]"], [41, "and eax, 0FFFFFFCFh"], [42, "mov edx, eax"], [43, "mov rax, [rbp+var_10]"], [44, "mov [rax+8], edx"], [45, "jmp short loc_4073E2"], [46, "mov rax, [rbp+var_10]"], [47, "mov eax, [rax+8]"], [48, "and eax, 0FFFFFFCFh"], [49, "or eax, 10h"], [50, "mov edx, eax"], [51, "mov rax, [rbp+var_10]"], [52, "mov [rax+8], edx"], [53, "jmp short loc_4073E2"], [54, "mov rax, [rbp+var_10]"], [55, "mov eax, [rax+8]"], [56, "and eax, 0FFFFFFCFh"], [57, "or eax, 20h"], [58, "mov edx, eax"], [59, "mov rax, [rbp+var_10]"], [60, "mov [rax+8], edx"], [61, "jmp short loc_4073E2"], [62, "mov rax, [rbp+var_10]"], [63, "mov eax, [rax+8]"], [64, "or eax, 30h"], [65, "mov edx, eax"], [66, "mov rax, [rbp+var_10]"], [67, "mov [rax+8], edx"], [68, "jmp short loc_4073E2"], [69, "mov cs:dword_40CBA0, 0Eh"], [70, "mov [rbp+var_4], 0FFFFFFFFh"], [71, "nop"], [72, "cmp [rbp+var_4], 0"], [73, "mov eax, [rbp+var_4]"], [74, "leave"], [75, "retn"]], "data_dep": [[6, 3], [7, 6], [9, 8], [10, 9], [11, 10], [14, 9], [15, 14], [16, 15], [17, 16], [18, 17], [18, 15], [19, 18], [20, 19], [20, 15], [21, 20], [22, 21], [23, 22], [24, 23], [25, 24], [26, 4], [27, 26], [28, 4], [29, 28], [30, 4], [31, 30], [32, 4], [33, 32], [34, 4], [35, 34], [36, 4], [37, 36], [39, 25], [40, 39], [41, 40], [42, 41], [43, 25], [44, 42], [44, 43], [46, 25], [47, 46], [48, 47], [49, 48], [50, 49], [51, 25], [52, 51], [52, 50], [54, 25], [55, 54], [56, 55], [57, 56], [58, 57], [59, 25], [60, 59], [60, 58], [62, 25], [63, 62], [64, 63], [65, 64], [66, 25], [67, 65], [67, 66], [72, 5], [72, 70], [73, 5], [73, 70], [73, 12], [75, 73]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e_7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.jsonl.gz", "strip_func_name": "sub_4072EE", "query": "\n\n\n__int64 __fastcall sub_4072EE(int a1, int a2)\n{\nint v3; // [rsp+10h] [rbp-8h]\nunsigned int v4; // [rsp+14h] [rbp-4h]\n\nv4 = 0;\nv3 = sub_4065BD(a1);\nif ( v3 >= 0 )\n{\nif ( a2 == 8 )\n{\n*((_DWORD *)&unk_40D18C + 11 * v3) |= 0x30u;\nreturn v4;\n}\nif ( a2 <= 8 )\n{\nswitch ( a2 )\n{\ncase 7:\n*((_DWORD *)&unk_40D18C + 11 * v3) = *((_DWORD *)&unk_40D18C + 11 * v3) & 0xFFFFFFCF | 0x20;\nreturn v4;\ncase 5:\n*((_DWORD *)&unk_40D18C + 11 * v3) &= 0xFFFFFFCF;\nreturn v4;\ncase 6:\n*((_DWORD *)&unk_40D18C + 11 * v3) = *((_DWORD *)&unk_40D18C + 11 * v3) & 0xFFFFFFCF | 0x10;\nreturn v4;\n}\n}\ndword_40CBA0 = 14;\nreturn (unsigned int)-1;\n}\nreturn (unsigned int)-1;\n}\n\n\n\nQ:[a1,a2,v4,sub_4072EE,sub_4065BD,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'databits', 'v4': 'rval', 'sub_4072EE': 'term_set_databits', 'sub_4065BD': 'term_find'}"} | [
[
0.7523379325866699,
0.7221559882164001,
0.7136537432670593,
0.7131764888763428,
0.7098186612129211,
0.6970076560974121,
0.6959336996078491,
0.6934430599212646,
0.6900594830513,
0.6774147152900696,
0.6734964847564697,
0.6646245121955872,
0.6634191870689392,
0.6602826714515686,
0.6571759581565857,
0.6562912464141846,
0.6534217596054077,
0.6483564376831055,
0.6468127965927124,
0.6426783800125122
],
[
202569,
58168,
253040,
231336,
2093,
164210,
175052,
88438,
201591,
134253,
102680,
188579,
83033,
218322,
243138,
128375,
55017,
249170,
162140,
7528
]
] |
|
printUsage | 1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d | cleanflight | blackbox-tools | NA | void printUsage(const char *argv0)
{
fprintf(stderr,
"Blackbox flight log renderer by Nicholas Sherlock ("
#ifdef BLACKBOX_VERSION
"v" STR(BLACKBOX_VERSION) ", "
#endif
__DATE__ " " __TIME__ ")\n\n"
"Usage:\n"
" %s [options] <logfilename.txt>\n\n"
"Options:\n"
" --help This page\n"
" --index <num> Choose which log from the file should be rendered\n"
" --width <px> Choose the width of the image (default %d)\n"
" --height <px> Choose the height of the image (default %d)\n"
" --fps FPS of the resulting video (default %d)\n"
" --threads Number of threads to use to render frames (default %d)\n"
" --prefix <filename> Set the prefix of the output frame filenames\n"
" --start <x:xx> Begin the log at this time offset (default 0:00)\n"
" --end <x:xx> End the log at this time offset\n"
" --[no-]draw-pid-table Show table with PIDs and gyros (default on)\n"
" --[no-]draw-craft Show craft drawing (default on)\n"
" --[no-]draw-sticks Show RC command sticks (default on)\n"
" --[no-]draw-time Show frame number and time in bottom right (default on)\n"
" --[no-]draw-acc Show accelerometer data and amperage in bottom left (default on)\n"
" --[no-]plot-motor Draw motors on the upper graph (default on)\n"
" --[no-]plot-pid Draw PIDs on the lower graph (default off)\n"
" --[no-]plot-gyro Draw gyroscopes on the lower graph (default on)\n"
" --sticks-top <px> Offset the stick overlay from the top (default off)\n"
" --sticks-right <px> Offset the stick overlay from the right (default off)\n"
" --sticks-width <px> Size of the stick area (default off)\n"
" --sticks-radius <px> Radius of the sticks (default relative to image size)\n"
" --craft-top <px> Offset the craft overlay from the top (default off)\n"
" --craft-right <px> Offset the craft overlay from the right (default off)\n"
" --craft-width <px> Size of the craft area (default off)\n"
" --smoothing-pid <n> Smoothing window for the PIDs (default %d)\n"
" --smoothing-gyro <n> Smoothing window for the gyroscopes (default %d)\n"
" --smoothing-motor <n> Smoothing window for the motors (default %d)\n"
" --unit-gyro <raw|degree> Unit for the gyro values in the table (default %s)\n"
" --prop-style <name> Style of propeller display (pie/blades, default %s)\n"
" --gapless Fill in gaps in the log with straight lines\n"
" --raw-amperage Print the current sensor ADC value along with computed amperage\n"
" --sticks-text-color Set the RGBA text color (default 1.0,1.0,1.0,1.0)\n"
" --sticks-color Set the RGBA sticks color (default 1.0,0.4,0.4,1.0)\n"
" --sticks-area-color Set the RGBA sticks area color (default 0.3,0.3,0.3,0.8)\n"
" --sticks-cross-color Set the RGBA sticks crosshair color (default 0.75,0.75,0.75,0.5)\n"
" --sticks-trail-length <px> Length of the stick trails (default %d)\n"
" --sticks-trail-color Set the RGBA stick trail color (default 1.0,1.0,1.0,1.0)\n"
"\n", argv0, defaultOptions.imageWidth, defaultOptions.imageHeight, defaultOptions.fps, defaultOptions.threads,
defaultOptions.pidSmoothing, defaultOptions.gyroSmoothing, defaultOptions.motorSmoothing,
UNIT_NAME[defaultOptions.gyroUnit], PROP_STYLE_NAME[defaultOptions.propStyle], defaultOptions.stickTrailLength
);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40CAE1", "function_addr": 4246241, "binary_name": "1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "push rbx"], [5, "sub rsp, 18h"], [6, "mov [rbp+var_28], rdi"], [7, "mov ebx, 0"], [8, "mov eax, 1"], [9, "mov eax, eax"], [10, "mov rsi, ds:off_4109F0[rax*8]"], [11, "mov eax, 0"], [12, "mov eax, eax"], [13, "mov rcx, ds:off_4109D0[rax*8]"], [14, "mov r11d, 2"], [15, "mov r10d, 2"], [16, "mov r9d, 4"], [17, "mov r8d, 3"], [18, "mov r13d, 1Eh"], [19, "mov r12d, 438h"], [20, "mov edi, 780h"], [21, "mov rax, cs:stderr"], [22, "mov rdx, [rbp+var_28]"], [23, "sub rsp, 8"], [24, "push rbx"], [25, "push rsi"], [26, "push rcx"], [27, "push r11"], [28, "push r10"], [29, "push r9"], [30, "push r8"], [31, "mov r9d, r13d"], [32, "mov r8d, r12d"], [33, "mov ecx, edi"], [34, "mov esi, offset aBlackboxFlight"], [35, "mov rdi, rax"], [36, "mov eax, 0"], [37, "call _fprintf"], [38, "add rsp, 40h"], [39, "nop"], [40, "lea rsp, [rbp-18h]"], [41, "pop rbx"], [42, "pop r12"], [43, "pop r13"], [44, "pop rbp"], [45, "retn"]], "data_dep": [[9, 8], [12, 11], [22, 6], [23, 5], [24, 7], [25, 10], [26, 13], [27, 14], [28, 15], [29, 16], [30, 17], [31, 18], [32, 19], [33, 20], [35, 21], [38, 23], [40, 38], [41, 24], [42, 3], [43, 2], [44, 0], [45, 37]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d_1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d.jsonl.gz", "strip_func_name": "sub_40CAE1", "query": "\n\n\nint __fastcall sub_40CAE1(const char *a1)\n{\nreturn fprintf(\nstderr,\n\"Blackbox flight log renderer by Nicholas Sherlock (Jun 2 2023 20:41:57)\\n\"\n\"\\n\"\n\"Usage:\\n\"\n\" %s [options] <logfilename.txt>\\n\"\n\"\\n\"\n\"Options:\\n\"\n\" --help This page\\n\"\n\" --index <num> Choose which log from the file should be rendered\\n\"\n\" --width <px> Choose the width of the image (default %d)\\n\"\n\" --height <px> Choose the height of the image (default %d)\\n\"\n\" --fps FPS of the resulting video (default %d)\\n\"\n\" --threads Number of threads to use to render frames (default %d)\\n\"\n\" --prefix <filename> Set the prefix of the output frame filenames\\n\"\n\" --start <x:xx> Begin the log at this time offset (default 0:00)\\n\"\n\" --end <x:xx> End the log at this time offset\\n\"\n\" --[no-]draw-pid-table Show table with PIDs and gyros (default on)\\n\"\n\" --[no-]draw-craft Show craft drawing (default on)\\n\"\n\" --[no-]draw-sticks Show RC command sticks (default on)\\n\"\n\" --[no-]draw-time Show frame number and time in bottom right (default on)\\n\"\n\" --[no-]draw-acc Show accelerometer data and amperage in bottom left (default on)\\n\"\n\" --[no-]plot-motor Draw motors on the upper graph (default on)\\n\"\n\" --[no-]plot-pid Draw PIDs on the lower graph (default off)\\n\"\n\" --[no-]plot-gyro Draw gyroscopes on the lower graph (default on)\\n\"\n\" --sticks-top <px> Offset the stick overlay from the top (default off)\\n\"\n\" --sticks-right <px> Offset the stick overlay from the right (default off)\\n\"\n\" --sticks-width <px> Size of the stick area (default off)\\n\"\n\" --sticks-radius <px> Radius of the sticks (default relative to image size)\\n\"\n\" --craft-top <px> Offset the craft overlay from the top (default off)\\n\"\n\" --craft-right <px> Offset the craft overlay from the right (default off)\\n\"\n\" --craft-width <px> Size of the craft area (default off)\\n\"\n\" --smoothing-pid <n> Smoothing window for the PIDs (default %d)\\n\"\n\" --smoothing-gyro <n> Smoothing window for the gyroscopes (default %d)\\n\"\n\" --smoothing-motor <n> Smoothing window for the motors (default %d)\\n\"\n\" --unit-gyro <raw|degree> Unit for the gyro values in the table (default %s)\\n\"\n\" --prop-style <name> Style of propeller display (pie/blades, default %s)\\n\"\n\" --gapless Fill in gaps in the log with straight lines\\n\"\n\" --raw-amperage Print the current sensor ADC value along with computed amperage\\n\"\n\" --sticks-text-color Set the RGBA text color (default 1.0,1.0,1.0,1.0)\\n\"\n\" --sticks-color Set the RGBA sticks color (default 1.0,0.4,0.4,1.0)\\n\"\n\" --sticks-area-color Set the RGBA sticks area color (default 0.3,0.3,0.3,0.8)\\n\"\n\" --sticks-cross-color Set the RGBA sticks crosshair color (default 0.75,0.75,0.75,0.5)\\n\"\n\" --sticks-trail-length <px> Length of the stick trails (default %d)\\n\"\n\" --sticks-trail-color Set the RGBA stick trail color (default 1.0,1.0,1.0,1.0)\\n\"\n\"\\n\",\na1,\n1920LL,\n1080LL,\n30LL,\n3LL,\n4LL,\n2LL,\n2LL,\n\"raw\",\noff_4109F0[1],\n0LL);\n}\n\n\n\nQ:[a1,sub_40CAE1,]", "hints": "[]", "response": "{'a1': 'argv0', 'sub_40CAE1': 'printUsage'}"} | [
[
0.7521251440048218,
0.7249200344085693,
0.7068071961402893,
0.7060586810112,
0.7044327259063721,
0.7043476700782776,
0.7023550271987915,
0.6992720365524292,
0.6991581916809082,
0.6981737017631531,
0.6943292021751404,
0.6942703127861023,
0.6917898058891296,
0.6917447447776794,
0.6885042190551758,
0.6862383484840393,
0.685485303401947,
0.6801189184188843,
0.6734578609466553,
0.6710061430931091
],
[
233471,
86738,
59266,
45492,
50703,
213432,
77134,
139370,
219876,
93672,
116867,
197250,
235824,
132035,
47473,
66319,
231460,
103198,
108715,
161155
]
] |
|
to_termios | c17cb2498866e308421bbc9157fe549d4fcd9366490656c221c34bda324db954 | DoctorWkt | Apout | NA | static void to_termios(struct tr_sgttyb *sgtb, struct termios *tios)
{
TrapDebug((dbg_file, "\n\tto_termios: sgtty flags are 0x%x ",
sgtb->sg_flags));
switch (sgtb->sg_ispeed) {
case TR_B0:
tios->c_ispeed = B0;
break;
case TR_B50:
tios->c_ispeed = B50;
break;
case TR_B75:
tios->c_ispeed = B75;
break;
case TR_B110:
tios->c_ispeed = B110;
break;
case TR_B134:
tios->c_ispeed = B134;
break;
case TR_B150:
tios->c_ispeed = B150;
break;
case TR_B200:
tios->c_ispeed = B200;
break;
case TR_B300:
tios->c_ispeed = B300;
break;
case TR_B600:
tios->c_ispeed = B600;
break;
case TR_B1200:
tios->c_ispeed = B1200;
break;
case TR_B1800:
tios->c_ispeed = B1800;
break;
case TR_B2400:
tios->c_ispeed = B2400;
break;
case TR_B4800:
tios->c_ispeed = B4800;
break;
case TR_B9600:
tios->c_ispeed = B9600;
break;
case TR_EXTA:
tios->c_ispeed = B19200;
break;
case TR_EXTB:
tios->c_ispeed = B38400;
break;
default:
tios->c_ispeed = B0;
break;
}
switch (sgtb->sg_ospeed) {
case TR_B0:
tios->c_ospeed = B0;
break;
case TR_B50:
tios->c_ospeed = B50;
break;
case TR_B75:
tios->c_ospeed = B75;
break;
case TR_B110:
tios->c_ospeed = B110;
break;
case TR_B134:
tios->c_ospeed = B134;
break;
case TR_B150:
tios->c_ospeed = B150;
break;
case TR_B200:
tios->c_ospeed = B200;
break;
case TR_B300:
tios->c_ospeed = B300;
break;
case TR_B600:
tios->c_ospeed = B600;
break;
case TR_B1200:
tios->c_ospeed = B1200;
break;
case TR_B1800:
tios->c_ospeed = B1800;
break;
case TR_B2400:
tios->c_ospeed = B2400;
break;
case TR_B4800:
tios->c_ospeed = B4800;
break;
case TR_B9600:
tios->c_ospeed = B9600;
break;
case TR_EXTA:
tios->c_ospeed = B19200;
break;
case TR_EXTB:
tios->c_ospeed = B38400;
break;
default:
tios->c_ospeed = B0;
break;
}
tios->c_cc[VERASE] = sgtb->sg_erase;
tios->c_cc[VKILL] = sgtb->sg_kill;
/* Initially turn off any flags we might set */
tios->c_oflag &= ~(OXTABS | ONLCR);
tios->c_cflag &= ~(PARENB | PARODD);
tios->c_lflag &= ~(ECHO);
if (sgtb->sg_flags & TR_XTABS)
tios->c_oflag |= OXTABS;
if (sgtb->sg_flags & TR_ODDP) {
tios->c_cflag |= PARENB;
tios->c_cflag &= ~PARODD;
}
if (sgtb->sg_flags & TR_EVENP)
tios->c_cflag |= PARENB | PARODD;
if (sgtb->sg_flags & TR_ANYP)
tios->c_cflag &= ~PARENB;
if (sgtb->sg_flags & TR_CRMOD)
tios->c_oflag |= ONLCR;
if (sgtb->sg_flags & TR_ECHO)
tios->c_lflag |= ECHO;
if (sgtb->sg_flags & TR_RAW) {
tios->c_lflag &=
~(ECHO | ICANON | IEXTEN | ISIG | BRKINT | ICRNL | INPCK |
ISTRIP | IXON);
tios->c_cflag &= ~(CSIZE | PARENB);
tios->c_cflag |= CS8;
tios->c_oflag &= ~(OPOST);
tios->c_cc[VMIN] = 1;
tios->c_cc[VTIME] = 0;
}
if (sgtb->sg_flags & TR_CBREAK) {
TrapDebug((dbg_file, "\n\tto_termios: setting cbreak I hope "));
tios->c_lflag &= ~(ECHO | ICANON);
tios->c_cc[VMIN] = 1;
tios->c_cc[VTIME] = 0;
}
TrapDebug((dbg_file, "\n\tto_termios: iflag is 0x%x",
(int) tios->c_iflag));
TrapDebug((dbg_file, "\n\tto_termios: oflag is 0x%x",
(int) tios->c_oflag));
TrapDebug((dbg_file, "\n\tto_termios: lflag is 0x%x ",
(int) tios->c_lflag));
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40654D", "function_addr": 4220237, "binary_name": "c17cb2498866e308421bbc9157fe549d4fcd9366490656c221c34bda324db954.elf_extract.pkl\n"}, "code": [[0, "mov [rsp+var_8], rdi"], [1, "mov [rsp+var_10], rsi"], [2, "mov rax, [rsp+var_8]"], [3, "movzx eax, byte ptr [rax]"], [4, "movsx eax, al"], [5, "cmp eax, 0Fh"], [6, "ja def_406575"], [7, "mov eax, eax"], [8, "mov rax, ds:jpt_406575[rax*8]"], [9, "jmp rax"], [10, "mov rax, [rsp+var_10]"], [11, "mov dword ptr [rax+34h], 0"], [12, "jmp loc_406679"], [13, "mov rax, [rsp+var_10]"], [14, "mov dword ptr [rax+34h], 1"], [15, "jmp loc_406679"], [16, "mov rax, [rsp+var_10]"], [17, "mov dword ptr [rax+34h], 2"], [18, "jmp loc_406679"], [19, "mov rax, [rsp+var_10]"], [20, "mov dword ptr [rax+34h], 3"], [21, "jmp loc_406679"], [22, "mov rax, [rsp+var_10]"], [23, "mov dword ptr [rax+34h], 4"], [24, "jmp loc_406679"], [25, "mov rax, [rsp+var_10]"], [26, "mov dword ptr [rax+34h], 5"], [27, "jmp loc_406679"], [28, "mov rax, [rsp+var_10]"], [29, "mov dword ptr [rax+34h], 6"], [30, "jmp loc_406679"], [31, "mov rax, [rsp+var_10]"], [32, "mov dword ptr [rax+34h], 7"], [33, "jmp short loc_406679"], [34, "mov rax, [rsp+var_10]"], [35, "mov dword ptr [rax+34h], 8"], [36, "jmp short loc_406679"], [37, "mov rax, [rsp+var_10]"], [38, "mov dword ptr [rax+34h], 9"], [39, "jmp short loc_406679"], [40, "mov rax, [rsp+var_10]"], [41, "mov dword ptr [rax+34h], 0Ah"], [42, "jmp short loc_406679"], [43, "mov rax, [rsp+var_10]"], [44, "mov dword ptr [rax+34h], 0Bh"], [45, "jmp short loc_406679"], [46, "mov rax, [rsp+var_10]"], [47, "mov dword ptr [rax+34h], 0Ch"], [48, "jmp short loc_406679"], [49, "mov rax, [rsp+var_10]"], [50, "mov dword ptr [rax+34h], 0Dh"], [51, "jmp short loc_406679"], [52, "mov rax, [rsp+var_10]"], [53, "mov dword ptr [rax+34h], 0Eh"], [54, "jmp short loc_406679"], [55, "mov rax, [rsp+var_10]"], [56, "mov dword ptr [rax+34h], 0Fh"], [57, "jmp short loc_406679"], [58, "mov rax, [rsp+var_10]"], [59, "mov dword ptr [rax+34h], 0"], [60, "nop"], [61, "mov rax, [rsp+var_8]"], [62, "movzx eax, byte ptr [rax+1]"], [63, "movsx eax, al"], [64, "cmp eax, 0Fh"], [65, "ja def_406698"], [66, "mov eax, eax"], [67, "mov rax, ds:jpt_406698[rax*8]"], [68, "jmp rax"], [69, "mov rax, [rsp+var_10]"], [70, "mov dword ptr [rax+38h], 0"], [71, "jmp loc_40679C"], [72, "mov rax, [rsp+var_10]"], [73, "mov dword ptr [rax+38h], 1"], [74, "jmp loc_40679C"], [75, "mov rax, [rsp+var_10]"], [76, "mov dword ptr [rax+38h], 2"], [77, "jmp loc_40679C"], [78, "mov rax, [rsp+var_10]"], [79, "mov dword ptr [rax+38h], 3"], [80, "jmp loc_40679C"], [81, "mov rax, [rsp+var_10]"], [82, "mov dword ptr [rax+38h], 4"], [83, "jmp loc_40679C"], [84, "mov rax, [rsp+var_10]"], [85, "mov dword ptr [rax+38h], 5"], [86, "jmp loc_40679C"], [87, "mov rax, [rsp+var_10]"], [88, "mov dword ptr [rax+38h], 6"], [89, "jmp loc_40679C"], [90, "mov rax, [rsp+var_10]"], [91, "mov dword ptr [rax+38h], 7"], [92, "jmp short loc_40679C"], [93, "mov rax, [rsp+var_10]"], [94, "mov dword ptr [rax+38h], 8"], [95, "jmp short loc_40679C"], [96, "mov rax, [rsp+var_10]"], [97, "mov dword ptr [rax+38h], 9"], [98, "jmp short loc_40679C"], [99, "mov rax, [rsp+var_10]"], [100, "mov dword ptr [rax+38h], 0Ah"], [101, "jmp short loc_40679C"], [102, "mov rax, [rsp+var_10]"], [103, "mov dword ptr [rax+38h], 0Bh"], [104, "jmp short loc_40679C"], [105, "mov rax, [rsp+var_10]"], [106, "mov dword ptr [rax+38h], 0Ch"], [107, "jmp short loc_40679C"], [108, "mov rax, [rsp+var_10]"], [109, "mov dword ptr [rax+38h], 0Dh"], [110, "jmp short loc_40679C"], [111, "mov rax, [rsp+var_10]"], [112, "mov dword ptr [rax+38h], 0Eh"], [113, "jmp short loc_40679C"], [114, "mov rax, [rsp+var_10]"], [115, "mov dword ptr [rax+38h], 0Fh"], [116, "jmp short loc_40679C"], [117, "mov rax, [rsp+var_10]"], [118, "mov dword ptr [rax+38h], 0"], [119, "nop"], [120, "mov rax, [rsp+var_8]"], [121, "movzx eax, byte ptr [rax+2]"], [122, "mov edx, eax"], [123, "mov rax, [rsp+var_10]"], [124, "mov [rax+13h], dl"], [125, "mov rax, [rsp+var_8]"], [126, "movzx eax, byte ptr [rax+3]"], [127, "mov edx, eax"], [128, "mov rax, [rsp+var_10]"], [129, "mov [rax+14h], dl"], [130, "mov rax, [rsp+var_10]"], [131, "mov eax, [rax+4]"], [132, "and eax, 0FFFFE7FBh"], [133, "mov edx, eax"], [134, "mov rax, [rsp+var_10]"], [135, "mov [rax+4], edx"], [136, "mov rax, [rsp+var_10]"], [137, "mov eax, [rax+8]"], [138, "and ah, 0FCh"], [139, "mov edx, eax"], [140, "mov rax, [rsp+var_10]"], [141, "mov [rax+8], edx"], [142, "mov rax, [rsp+var_10]"], [143, "mov eax, [rax+0Ch]"], [144, "and eax, 0FFFFFFF7h"], [145, "mov edx, eax"], [146, "mov rax, [rsp+var_10]"], [147, "mov [rax+0Ch], edx"], [148, "mov rax, [rsp+var_8]"], [149, "movzx eax, word ptr [rax+4]"], [150, "cwde"], [151, "and eax, 400h"], [152, "test eax, eax"], [153, "jz short loc_40682B"], [154, "mov rax, [rsp+var_10]"], [155, "mov eax, [rax+4]"], [156, "or ah, 18h"], [157, "mov edx, eax"], [158, "mov rax, [rsp+var_10]"], [159, "mov [rax+4], edx"], [160, "mov rax, [rsp+var_8]"], [161, "movzx eax, word ptr [rax+4]"], [162, "cwde"], [163, "and eax, 40h"], [164, "test eax, eax"], [165, "jz short loc_406866"], [166, "mov rax, [rsp+var_10]"], [167, "mov eax, [rax+8]"], [168, "or ah, 1"], [169, "mov edx, eax"], [170, "mov rax, [rsp+var_10]"], [171, "mov [rax+8], edx"], [172, "mov rax, [rsp+var_10]"], [173, "mov eax, [rax+8]"], [174, "and ah, 0FDh"], [175, "mov edx, eax"], [176, "mov rax, [rsp+var_10]"], [177, "mov [rax+8], edx"], [178, "mov rax, [rsp+var_8]"], [179, "movzx eax, word ptr [rax+4]"], [180, "cwde"], [181, "and eax, 80h"], [182, "test eax, eax"], [183, "jz short loc_40688E"], [184, "mov rax, [rsp+var_10]"], [185, "mov eax, [rax+8]"], [186, "or ah, 3"], [187, "mov edx, eax"], [188, "mov rax, [rsp+var_10]"], [189, "mov [rax+8], edx"], [190, "mov rax, [rsp+var_8]"], [191, "movzx eax, word ptr [rax+4]"], [192, "cwde"], [193, "and eax, 0C0h"], [194, "test eax, eax"], [195, "jz short loc_4068B6"], [196, "mov rax, [rsp+var_10]"], [197, "mov eax, [rax+8]"], [198, "and ah, 0FEh"], [199, "mov edx, eax"], [200, "mov rax, [rsp+var_10]"], [201, "mov [rax+8], edx"], [202, "mov rax, [rsp+var_8]"], [203, "movzx eax, word ptr [rax+4]"], [204, "cwde"], [205, "and eax, 10h"], [206, "test eax, eax"], [207, "jz short loc_4068DC"], [208, "mov rax, [rsp+var_10]"], [209, "mov eax, [rax+4]"], [210, "or eax, 4"], [211, "mov edx, eax"], [212, "mov rax, [rsp+var_10]"], [213, "mov [rax+4], edx"], [214, "mov rax, [rsp+var_8]"], [215, "movzx eax, word ptr [rax+4]"], [216, "cwde"], [217, "and eax, 8"], [218, "test eax, eax"], [219, "jz short loc_406902"], [220, "mov rax, [rsp+var_10]"], [221, "mov eax, [rax+0Ch]"], [222, "or eax, 8"], [223, "mov edx, eax"], [224, "mov rax, [rsp+var_10]"], [225, "mov [rax+0Ch], edx"], [226, "mov rax, [rsp+var_8]"], [227, "movzx eax, word ptr [rax+4]"], [228, "cwde"], [229, "and eax, 20h"], [230, "test eax, eax"], [231, "jz short loc_40697D"], [232, "mov rax, [rsp+var_10]"], [233, "mov eax, [rax+0Ch]"], [234, "and eax, 0FFFF7AC4h"], [235, "mov edx, eax"], [236, "mov rax, [rsp+var_10]"], [237, "mov [rax+0Ch], edx"], [238, "mov rax, [rsp+var_10]"], [239, "mov eax, [rax+8]"], [240, "and eax, 0FFFFFECFh"], [241, "mov edx, eax"], [242, "mov rax, [rsp+var_10]"], [243, "mov [rax+8], edx"], [244, "mov rax, [rsp+var_10]"], [245, "mov eax, [rax+8]"], [246, "or eax, 30h"], [247, "mov edx, eax"], [248, "mov rax, [rsp+var_10]"], [249, "mov [rax+8], edx"], [250, "mov rax, [rsp+var_10]"], [251, "mov eax, [rax+4]"], [252, "and eax, 0FFFFFFFEh"], [253, "mov edx, eax"], [254, "mov rax, [rsp+var_10]"], [255, "mov [rax+4], edx"], [256, "mov rax, [rsp+var_10]"], [257, "mov byte ptr [rax+17h], 1"], [258, "mov rax, [rsp+var_10]"], [259, "mov byte ptr [rax+16h], 0"], [260, "mov rax, [rsp+var_8]"], [261, "movzx eax, word ptr [rax+4]"], [262, "cwde"], [263, "and eax, 2"], [264, "test eax, eax"], [265, "jz short loc_4069B5"], [266, "mov rax, [rsp+var_10]"], [267, "mov eax, [rax+0Ch]"], [268, "and eax, 0FFFFFFF5h"], [269, "mov edx, eax"], [270, "mov rax, [rsp+var_10]"], [271, "mov [rax+0Ch], edx"], [272, "mov rax, [rsp+var_10]"], [273, "mov byte ptr [rax+17h], 1"], [274, "mov rax, [rsp+var_10]"], [275, "mov byte ptr [rax+16h], 0"], [276, "nop"], [277, "retn"]], "data_dep": [[2, 0], [3, 2], [4, 3], [5, 4], [6, 5], [7, 4], [9, 8], [10, 1], [11, 10], [13, 1], [14, 13], [16, 1], [17, 16], [19, 1], [20, 19], [22, 1], [23, 22], [25, 1], [26, 25], [28, 1], [29, 28], [31, 1], [32, 31], [34, 1], [35, 34], [37, 1], [38, 37], [40, 1], [41, 40], [43, 1], [44, 43], [46, 1], [47, 46], [49, 1], [50, 49], [52, 1], [53, 52], [55, 1], [56, 55], [58, 1], [59, 58], [61, 0], [62, 41], [62, 50], [62, 59], [62, 17], [62, 26], [62, 35], [62, 44], [62, 11], [62, 20], [62, 53], [62, 61], [62, 29], [62, 38], [62, 47], [62, 56], [62, 14], [62, 23], [62, 32], [63, 62], [64, 63], [65, 64], [66, 63], [68, 67], [69, 1], [70, 69], [72, 1], [73, 72], [75, 1], [76, 75], [78, 1], [79, 78], [81, 1], [82, 81], [84, 1], [85, 84], [87, 1], [88, 87], [90, 1], [91, 90], [93, 1], [94, 93], [96, 1], [97, 96], [99, 1], [100, 99], [102, 1], [103, 102], [105, 1], [106, 105], [108, 1], [109, 108], [111, 1], [112, 111], [114, 1], [115, 114], [117, 1], [118, 117], [120, 0], [121, 11], [121, 20], [121, 141], [121, 100], [121, 109], [121, 118], [121, 76], [121, 85], [121, 94], [121, 103], [121, 112], [121, 70], [121, 79], [121, 29], [121, 38], [121, 47], [121, 56], [121, 14], [121, 23], [121, 32], [121, 41], [121, 135], [121, 120], [121, 129], [121, 88], [121, 97], [121, 106], [121, 115], [121, 124], [121, 73], [121, 82], [121, 91], [121, 50], [121, 59], [121, 17], [121, 26], [121, 35], [121, 44], [121, 53], [121, 147], [122, 121], [123, 1], [124, 123], [124, 122], [125, 0], [126, 125], [126, 124], [127, 126], [128, 1], [129, 128], [129, 127], [130, 1], [131, 130], [131, 129], [132, 131], [133, 132], [134, 1], [135, 134], [135, 133], [136, 1], [137, 135], [137, 136], [138, 137], [139, 138], [140, 1], [141, 140], [141, 139], [142, 1], [143, 141], [143, 142], [144, 143], [145, 144], [146, 1], [147, 146], [147, 145], [148, 0], [149, 147], [149, 135], [149, 148], [151, 149], [152, 151], [153, 152], [154, 1], [155, 14], [155, 23], [155, 32], [155, 41], [155, 50], [155, 135], [155, 17], [155, 129], [155, 97], [155, 106], [155, 115], [155, 124], [155, 73], [155, 82], [155, 91], [155, 100], [155, 59], [155, 76], [155, 26], [155, 35], [155, 44], [155, 53], [155, 147], [155, 11], [155, 20], [155, 29], [155, 141], [155, 159], [155, 109], [155, 118], [155, 85], [155, 94], [155, 103], [155, 112], [155, 70], [155, 79], [155, 88], [155, 38], [155, 47], [155, 56], [155, 154], [156, 155], [157, 156], [158, 1], [159, 158], [159, 157], [160, 0], [161, 70], [161, 79], [161, 88], [161, 47], [161, 56], [161, 14], [161, 23], [161, 32], [161, 41], [161, 50], [161, 135], [161, 17], [161, 129], [161, 147], [161, 97], [161, 106], [161, 115], [161, 124], [161, 73], [161, 82], [161, 91], [161, 100], [161, 59], [161, 76], [161, 26], [161, 35], [161, 44], [161, 53], [161, 160], [161, 11], [161, 20], [161, 29], [161, 38], [161, 141], [161, 159], [161, 109], [161, 118], [161, 85], [161, 94], [161, 103], [161, 112], [163, 161], [164, 163], [165, 164], [166, 1], [167, 11], [167, 20], [167, 29], [167, 38], [167, 141], [167, 159], [167, 118], [167, 135], [167, 85], [167, 94], [167, 103], [167, 112], [167, 70], [167, 79], [167, 88], [167, 47], [167, 56], [167, 177], [167, 14], [167, 23], [167, 32], [167, 41], [167, 50], [167, 171], [167, 166], [167, 17], [167, 129], [167, 147], [167, 97], [167, 106], [167, 115], [167, 124], [167, 73], [167, 82], [167, 91], [167, 100], [167, 109], [167, 59], [167, 76], [167, 26], [167, 35], [167, 44], [167, 53], [168, 167], [169, 168], [170, 1], [171, 170], [171, 169], [172, 1], [173, 172], [173, 171], [174, 173], [175, 174], [176, 1], [177, 176], [177, 175], [178, 0], [179, 73], [179, 82], [179, 91], [179, 100], [179, 50], [179, 59], [179, 26], [179, 35], [179, 44], [179, 53], [179, 147], [179, 178], [179, 11], [179, 20], [179, 29], [179, 141], [179, 109], [179, 118], [179, 76], [179, 85], [179, 94], [179, 103], [179, 112], [179, 70], [179, 79], [179, 88], [179, 38], [179, 47], [179, 56], [179, 159], [179, 177], [179, 14], [179, 23], [179, 32], [179, 41], [179, 135], [179, 171], [179, 17], [179, 129], [179, 97], [179, 106], [179, 115], [179, 124], [181, 179], [182, 181], [183, 182], [184, 1], [185, 23], [185, 32], [185, 41], [185, 50], [185, 59], [185, 171], [185, 17], [185, 26], [185, 129], [185, 147], [185, 106], [185, 115], [185, 124], [185, 73], [185, 82], [185, 91], [185, 100], [185, 109], [185, 189], [185, 184], [185, 76], [185, 85], [185, 35], [185, 44], [185, 53], [185, 11], [185, 20], [185, 29], [185, 38], [185, 141], [185, 159], [185, 118], [185, 14], [185, 135], [185, 94], [185, 103], [185, 112], [185, 70], [185, 79], [185, 88], [185, 97], [185, 47], [185, 56], [185, 177], [186, 185], [187, 186], [188, 1], [189, 188], [189, 187], [190, 0], [191, 70], [191, 79], [191, 88], [191, 38], [191, 47], [191, 56], [191, 177], [191, 190], [191, 14], [191, 23], [191, 32], [191, 41], [191, 50], [191, 135], [191, 171], [191, 17], [191, 129], [191, 147], [191, 97], [191, 106], [191, 115], [191, 124], [191, 73], [191, 82], [191, 91], [191, 100], [191, 59], [191, 189], [191, 76], [191, 26], [191, 35], [191, 44], [191, 53], [191, 11], [191, 20], [191, 29], [191, 141], [191, 159], [191, 109], [191, 118], [191, 85], [191, 94], [191, 103], [191, 112], [193, 191], [194, 193], [195, 194], [196, 1], [197, 159], [197, 14], [197, 135], [197, 94], [197, 103], [197, 112], [197, 196], [197, 70], [197, 79], [197, 88], [197, 97], [197, 56], [197, 177], [197, 73], [197, 23], [197, 32], [197, 41], [197, 50], [197, 59], [197, 171], [197, 189], [197, 17], [197, 26], [197, 35], [197, 129], [197, 147], [197, 106], [197, 115], [197, 124], [197, 82], [197, 91], [197, 100], [197, 109], [197, 118], [197, 76], [197, 85], [197, 44], [197, 53], [197, 201], [197, 11], [197, 20], [197, 29], [197, 38], [197, 47], [197, 141], [198, 197], [199, 198], [200, 1], [201, 199], [201, 200], [202, 0], [203, 202], [203, 76], [203, 35], [203, 44], [203, 53], [203, 11], [203, 20], [203, 29], [203, 38], [203, 141], [203, 159], [203, 118], [203, 135], [203, 85], [203, 94], [203, 103], [203, 112], [203, 201], [203, 70], [203, 79], [203, 88], [203, 47], [203, 56], [203, 177], [203, 14], [203, 23], [203, 32], [203, 41], [203, 50], [203, 171], [203, 17], [203, 26], [203, 129], [203, 147], [203, 97], [203, 106], [203, 115], [203, 124], [203, 73], [203, 82], [203, 91], [203, 100], [203, 109], [203, 59], [203, 189], [205, 203], [206, 205], [207, 206], [208, 1], [209, 17], [209, 26], [209, 129], [209, 147], [209, 106], [209, 115], [209, 124], [209, 208], [209, 73], [209, 82], [209, 91], [209, 100], [209, 109], [209, 59], [209, 189], [209, 76], [209, 35], [209, 44], [209, 53], [209, 11], [209, 20], [209, 29], [209, 38], [209, 141], [209, 159], [209, 118], [209, 135], [209, 85], [209, 94], [209, 103], [209, 112], [209, 201], [209, 70], [209, 79], [209, 88], [209, 97], [209, 47], [209, 56], [209, 177], [209, 213], [209, 14], [209, 23], [209, 32], [209, 41], [209, 50], [209, 171], [210, 209], [211, 210], [212, 1], [213, 212], [213, 211], [214, 0], [215, 23], [215, 32], [215, 41], [215, 50], [215, 59], [215, 171], [215, 17], [215, 26], [215, 129], [215, 147], [215, 106], [215, 115], [215, 124], [215, 73], [215, 82], [215, 91], [215, 100], [215, 109], [215, 189], [215, 76], [215, 85], [215, 35], [215, 44], [215, 53], [215, 11], [215, 20], [215, 29], [215, 38], [215, 141], [215, 159], [215, 118], [215, 14], [215, 135], [215, 94], [215, 103], [215, 112], [215, 201], [215, 214], [215, 70], [215, 79], [215, 88], [215, 97], [215, 47], [215, 56], [215, 177], [215, 213], [217, 215], [218, 217], [219, 218], [220, 1], [221, 135], [221, 94], [221, 103], [221, 112], [221, 70], [221, 79], [221, 88], [221, 97], [221, 177], [221, 213], [221, 56], [221, 23], [221, 32], [221, 41], [221, 50], [221, 59], [221, 171], [221, 17], [221, 26], [221, 129], [221, 147], [221, 106], [221, 115], [221, 124], [221, 73], [221, 82], [221, 91], [221, 100], [221, 109], [221, 189], [221, 225], [221, 220], [221, 76], [221, 85], [221, 35], [221, 44], [221, 53], [221, 201], [221, 11], [221, 20], [221, 29], [221, 38], [221, 47], [221, 141], [221, 159], [221, 118], [221, 14], [222, 221], [223, 222], [224, 1], [225, 224], [225, 223], [226, 0], [227, 11], [227, 20], [227, 29], [227, 38], [227, 47], [227, 141], [227, 159], [227, 14], [227, 135], [227, 94], [227, 103], [227, 112], [227, 70], [227, 79], [227, 88], [227, 97], [227, 56], [227, 177], [227, 213], [227, 73], [227, 23], [227, 32], [227, 41], [227, 50], [227, 59], [227, 171], [227, 189], [227, 17], [227, 26], [227, 129], [227, 147], [227, 106], [227, 115], [227, 124], [227, 226], [227, 82], [227, 91], [227, 100], [227, 109], [227, 118], [227, 225], [227, 76], [227, 85], [227, 35], [227, 44], [227, 53], [227, 201], [229, 227], [230, 229], [231, 230], [232, 1], [233, 82], [233, 91], [233, 100], [233, 109], [233, 118], [233, 225], [233, 76], [233, 85], [233, 44], [233, 53], [233, 11], [233, 20], [233, 29], [233, 38], [233, 47], [233, 141], [233, 159], [233, 257], [233, 243], [233, 14], [233, 135], [233, 94], [233, 103], [233, 112], [233, 237], [233, 232], [233, 70], [233, 79], [233, 88], [233, 97], [233, 106], [233, 56], [233, 177], [233, 213], [233, 201], [233, 73], [233, 23], [233, 32], [233, 41], [233, 50], [233, 59], [233, 171], [233, 189], [233, 17], [233, 255], [233, 26], [233, 35], [233, 129], [233, 147], [233, 259], [233, 115], [233, 124], [233, 249], [234, 233], [235, 234], [236, 1], [237, 236], [237, 235], [238, 1], [239, 201], [239, 141], [239, 177], [239, 238], [239, 237], [239, 189], [240, 239], [241, 240], [242, 1], [243, 242], [243, 241], [244, 1], [245, 244], [245, 243], [246, 245], [247, 246], [248, 1], [249, 247], [249, 248], [250, 1], [251, 135], [251, 213], [251, 250], [251, 249], [251, 159], [252, 251], [253, 252], [254, 1], [255, 253], [255, 254], [256, 1], [257, 256], [258, 1], [259, 258], [260, 0], [261, 171], [261, 189], [261, 17], [261, 26], [261, 35], [261, 129], [261, 147], [261, 259], [261, 115], [261, 124], [261, 11], [261, 249], [261, 91], [261, 100], [261, 109], [261, 118], [261, 225], [261, 76], [261, 85], [261, 94], [261, 44], [261, 53], [261, 201], [261, 20], [261, 29], [261, 38], [261, 47], [261, 56], [261, 141], [261, 159], [261, 177], [261, 257], [261, 243], [261, 14], [261, 23], [261, 135], [261, 103], [261, 112], [261, 260], [261, 237], [261, 255], [261, 70], [261, 79], [261, 88], [261, 97], [261, 106], [261, 213], [261, 73], [261, 82], [261, 32], [261, 41], [261, 50], [261, 59], [263, 261], [264, 263], [265, 264], [266, 1], [267, 70], [267, 79], [267, 88], [267, 97], [267, 56], [267, 177], [267, 213], [267, 73], [267, 32], [267, 41], [267, 50], [267, 59], [267, 171], [267, 17], [267, 255], [267, 26], [267, 273], [267, 129], [267, 147], [267, 259], [267, 106], [267, 115], [267, 124], [267, 249], [267, 82], [267, 91], [267, 100], [267, 109], [267, 118], [267, 189], [267, 225], [267, 76], [267, 85], [267, 35], [267, 23], [267, 44], [267, 53], [267, 201], [267, 11], [267, 20], [267, 29], [267, 38], [267, 47], [267, 141], [267, 159], [267, 271], [267, 266], [267, 275], [267, 243], [267, 14], [267, 135], [267, 94], [267, 103], [267, 112], [267, 237], [267, 257], [268, 267], [269, 268], [270, 1], [271, 270], [271, 269], [272, 1], [273, 272], [274, 1], [275, 274], [277, 274], [277, 264]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/c17cb2498866e308421bbc9157fe549d4fcd9366490656c221c34bda324db954_c17cb2498866e308421bbc9157fe549d4fcd9366490656c221c34bda324db954.jsonl.gz", "strip_func_name": "sub_40654D", "query": "\n\n\n__int64 __fastcall sub_40654D(__int64 a1, __int64 a2)\n{\nint v2; // eax\nint v3; // eax\nint v4; // eax\nint v5; // eax\nint v6; // eax\nint v7; // eax\n__int64 result; // rax\n\nswitch ( *(_BYTE *)a1 )\n{\ncase 0:\n*(_DWORD *)(a2 + 52) = 0;\nbreak;\ncase 1:\n*(_DWORD *)(a2 + 52) = 1;\nbreak;\ncase 2:\n*(_DWORD *)(a2 + 52) = 2;\nbreak;\ncase 3:\n*(_DWORD *)(a2 + 52) = 3;\nbreak;\ncase 4:\n*(_DWORD *)(a2 + 52) = 4;\nbreak;\ncase 5:\n*(_DWORD *)(a2 + 52) = 5;\nbreak;\ncase 6:\n*(_DWORD *)(a2 + 52) = 6;\nbreak;\ncase 7:\n*(_DWORD *)(a2 + 52) = 7;\nbreak;\ncase 8:\n*(_DWORD *)(a2 + 52) = 8;\nbreak;\ncase 9:\n*(_DWORD *)(a2 + 52) = 9;\nbreak;\ncase 0xA:\n*(_DWORD *)(a2 + 52) = 10;\nbreak;\ncase 0xB:\n*(_DWORD *)(a2 + 52) = 11;\nbreak;\ncase 0xC:\n*(_DWORD *)(a2 + 52) = 12;\nbreak;\ncase 0xD:\n*(_DWORD *)(a2 + 52) = 13;\nbreak;\ncase 0xE:\n*(_DWORD *)(a2 + 52) = 14;\nbreak;\ncase 0xF:\n*(_DWORD *)(a2 + 52) = 15;\nbreak;\ndefault:\n*(_DWORD *)(a2 + 52) = 0;\nbreak;\n}\nswitch ( *(_BYTE *)(a1 + 1) )\n{\ncase 0:\n*(_DWORD *)(a2 + 56) = 0;\nbreak;\ncase 1:\n*(_DWORD *)(a2 + 56) = 1;\nbreak;\ncase 2:\n*(_DWORD *)(a2 + 56) = 2;\nbreak;\ncase 3:\n*(_DWORD *)(a2 + 56) = 3;\nbreak;\ncase 4:\n*(_DWORD *)(a2 + 56) = 4;\nbreak;\ncase 5:\n*(_DWORD *)(a2 + 56) = 5;\nbreak;\ncase 6:\n*(_DWORD *)(a2 + 56) = 6;\nbreak;\ncase 7:\n*(_DWORD *)(a2 + 56) = 7;\nbreak;\ncase 8:\n*(_DWORD *)(a2 + 56) = 8;\nbreak;\ncase 9:\n*(_DWORD *)(a2 + 56) = 9;\nbreak;\ncase 0xA:\n*(_DWORD *)(a2 + 56) = 10;\nbreak;\ncase 0xB:\n*(_DWORD *)(a2 + 56) = 11;\nbreak;\ncase 0xC:\n*(_DWORD *)(a2 + 56) = 12;\nbreak;\ncase 0xD:\n*(_DWORD *)(a2 + 56) = 13;\nbreak;\ncase 0xE:\n*(_DWORD *)(a2 + 56) = 14;\nbreak;\ncase 0xF:\n*(_DWORD *)(a2 + 56) = 15;\nbreak;\ndefault:\n*(_DWORD *)(a2 + 56) = 0;\nbreak;\n}\n*(_BYTE *)(a2 + 19) = *(_BYTE *)(a1 + 2);\n*(_BYTE *)(a2 + 20) = *(_BYTE *)(a1 + 3);\n*(_DWORD *)(a2 + 4) &= 0xFFFFE7FB;\nv2 = *(_DWORD *)(a2 + 8);\nBYTE1(v2) &= 0xFCu;\n*(_DWORD *)(a2 + 8) = v2;\n*(_DWORD *)(a2 + 12) &= 0xFFFFFFF7;\nif ( (*(_WORD *)(a1 + 4) & 0x400) != 0 )\n{\nv3 = *(_DWORD *)(a2 + 4);\nBYTE1(v3) |= 0x18u;\n*(_DWORD *)(a2 + 4) = v3;\n}\nif ( (*(_WORD *)(a1 + 4) & 0x40) != 0 )\n{\nv4 = *(_DWORD *)(a2 + 8);\nBYTE1(v4) |= 1u;\n*(_DWORD *)(a2 + 8) = v4;\nv5 = *(_DWORD *)(a2 + 8);\nBYTE1(v5) &= 0xFDu;\n*(_DWORD *)(a2 + 8) = v5;\n}\nif ( (*(_WORD *)(a1 + 4) & 0x80) != 0 )\n{\nv6 = *(_DWORD *)(a2 + 8);\nBYTE1(v6) |= 3u;\n*(_DWORD *)(a2 + 8) = v6;\n}\nif ( (*(_WORD *)(a1 + 4) & 0xC0) != 0 )\n{\nv7 = *(_DWORD *)(a2 + 8);\nBYTE1(v7) &= 0xFEu;\n*(_DWORD *)(a2 + 8) = v7;\n}\nif ( (*(_WORD *)(a1 + 4) & 0x10) != 0 )\n*(_DWORD *)(a2 + 4) |= 4u;\nif ( (*(_WORD *)(a1 + 4) & 8) != 0 )\n*(_DWORD *)(a2 + 12) |= 8u;\nif ( (*(_WORD *)(a1 + 4) & 0x20) != 0 )\n{\n*(_DWORD *)(a2 + 12) &= 0xFFFF7AC4;\n*(_DWORD *)(a2 + 8) &= 0xFFFFFECF;\n*(_DWORD *)(a2 + 8) |= 0x30u;\n*(_DWORD *)(a2 + 4) &= 0xFFFFFFFE;\n*(_BYTE *)(a2 + 23) = 1;\n*(_BYTE *)(a2 + 22) = 0;\n}\nresult = *(_WORD *)(a1 + 4) & 2;\nif ( (_DWORD)result )\n{\n*(_DWORD *)(a2 + 12) &= 0xFFFFFFF5;\n*(_BYTE *)(a2 + 23) = 1;\nresult = a2;\n*(_BYTE *)(a2 + 22) = 0;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_40654D,]", "hints": "[]", "response": "{'a1': 'sgtb', 'a2': 'tios', 'sub_40654D': 'to_termios'}"} | [
[
0.8046107292175293,
0.8019618391990662,
0.7903205156326294,
0.7868740558624268,
0.7813389897346497,
0.7729228734970093,
0.7684822678565979,
0.7576730251312256,
0.7502726316452026,
0.7474459409713745,
0.7472141981124878,
0.7470626831054688,
0.7430142164230347,
0.7413400411605835,
0.7395588159561157,
0.7391228675842285,
0.7347975373268127,
0.7323263883590698,
0.7284722328186035,
0.7239372730255127
],
[
183825,
81495,
233797,
52790,
155598,
47185,
239786,
187994,
75015,
251311,
256193,
54892,
217138,
226711,
110923,
41791,
208939,
211993,
72146,
233517
]
] |
|
free_firmware_image | a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c | coreboot | vboot | NA | void free_firmware_image(struct firmware_image *image)
{
/*
* The programmer is not allocated by load_firmware_image and must be
* preserved explicitly.
*/
const char *programmer = image->programmer;
free(image->data);
free(image->file_name);
free(image->ro_version);
free(image->rw_version_a);
free(image->rw_version_b);
memset(image, 0, sizeof(*image));
image->programmer = programmer;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41DAC9", "function_addr": 4315849, "binary_name": "a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+s], rdi"], [4, "mov rax, [rbp+s]"], [5, "mov rax, [rax]"], [6, "mov [rbp+var_8], rax"], [7, "mov rax, [rbp+s]"], [8, "mov rax, [rax+10h]"], [9, "mov rdi, rax"], [10, "call _free"], [11, "mov rax, [rbp+s]"], [12, "mov rax, [rax+18h]"], [13, "mov rdi, rax"], [14, "call _free"], [15, "mov rax, [rbp+s]"], [16, "mov rax, [rax+20h]"], [17, "mov rdi, rax"], [18, "call _free"], [19, "mov rax, [rbp+s]"], [20, "mov rax, [rax+28h]"], [21, "mov rdi, rax"], [22, "call _free"], [23, "mov rax, [rbp+s]"], [24, "mov rax, [rax+30h]"], [25, "mov rdi, rax"], [26, "call _free"], [27, "mov rax, [rbp+s]"], [28, "mov edx, 40h "], [29, "mov esi, 0"], [30, "mov rdi, rax"], [31, "call _memset"], [32, "mov rax, [rbp+s]"], [33, "mov rdx, [rbp+var_8]"], [34, "mov [rax], rdx"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 3], [8, 7], [9, 8], [11, 3], [12, 11], [13, 12], [15, 3], [16, 15], [17, 16], [19, 3], [20, 19], [21, 20], [23, 3], [24, 23], [25, 24], [27, 3], [30, 27], [32, 3], [33, 6], [34, 33], [34, 32], [37, 32]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c_a5d5b25cd438620c6efce9ec3bb72c00ffee4d285821814405e9ff2a1169a28c.jsonl.gz", "strip_func_name": "sub_41DAC9", "query": "\n\n\nvoid **__fastcall sub_41DAC9(void **a1)\n{\nvoid **result; // rax\nvoid *v2; // [rsp+18h] [rbp-8h]\n\nv2 = *a1;\nfree(a1[2]);\nfree(a1[3]);\nfree(a1[4]);\nfree(a1[5]);\nfree(a1[6]);\nmemset(a1, 0, 0x40uLL);\nresult = a1;\n*a1 = v2;\nreturn result;\n}\n\n\n\nQ:[a1,v2,sub_41DAC9,]", "hints": "[]", "response": "{'a1': 'image', 'v2': 'programmer', 'sub_41DAC9': 'free_firmware_image'}"} | [
[
0.877630352973938,
0.8419459462165833,
0.8383597135543823,
0.8361183404922485,
0.8299916982650757,
0.8021327257156372,
0.796444833278656,
0.7962872982025146,
0.7950922846794128,
0.7950057983398438,
0.7773470878601074,
0.7770918011665344,
0.7615174055099487,
0.759563684463501,
0.7589583396911621,
0.7497111558914185,
0.7388851046562195,
0.7345157265663147,
0.7343448400497437,
0.7326905727386475
],
[
264332,
257313,
12894,
15800,
157406,
117405,
255339,
40732,
222759,
117451,
50803,
177010,
107098,
68042,
217514,
225551,
260154,
32695,
157631,
163130
]
] |
|
appendl | 3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413 | emikulic | darkhttpd | NA | static void appendl(struct apbuf *buf, const char *s, const size_t len) {
size_t need = buf->length + len;
if (buf->pool < need) {
/* pool has dried up */
while (buf->pool < need)
buf->pool += APBUF_GROW;
buf->str = xrealloc(buf->str, buf->pool);
}
memcpy(buf->str + buf->length, s, len);
buf->length += len;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403D7B", "function_addr": 4210043, "binary_name": "3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 30h"], [5, "mov [rbp+var_28], rdi"], [6, "mov [rbp+src], rsi"], [7, "mov [rbp+n], rdx"], [8, "mov rax, [rbp+var_28]"], [9, "cmp [rbp+var_28], 0"], [10, "jz short loc_403DA8"], [11, "mov rdx, rax"], [12, "and edx, 7"], [13, "test rdx, rdx"], [14, "jz short loc_403DB5"], [15, "mov rsi, rax"], [16, "mov edi, offset off_430A00"], [17, "call ___ubsan_handle_type_mismatch_v1"], [18, "mov rax, [rbp+var_28]"], [19, "mov rdx, rax"], [20, "shr rdx, 3"], [21, "add rdx, 7FFF8000h"], [22, "movzx edx, byte ptr [rdx]"], [23, "test dl, dl"], [24, "jz short loc_403DD6"], [25, "mov rdi, rax"], [26, "call ___asan_report_load8"], [27, "mov rax, [rbp+var_28]"], [28, "mov rdx, [rax]"], [29, "mov rax, [rbp+n]"], [30, "add rax, rdx"], [31, "mov [rbp+var_18], rax"], [32, "mov rax, [rbp+var_28]"], [33, "cmp [rbp+var_28], 0"], [34, "jz short loc_403DFE"], [35, "mov rdx, rax"], [36, "and edx, 7"], [37, "test rdx, rdx"], [38, "jz short loc_403E0B"], [39, "mov rsi, rax"], [40, "mov edi, offset off_430A40"], [41, "call ___ubsan_handle_type_mismatch_v1"], [42, "mov rax, [rbp+var_28]"], [43, "lea rdx, [rax+8]"], [44, "cmp rax, 0FFFFFFFFFFFFFFF8h"], [45, "jb short loc_403E2A"], [46, "mov rax, [rbp+var_28]"], [47, "mov rsi, rax"], [48, "mov edi, offset off_430A80"], [49, "call ___ubsan_handle_pointer_overflow"], [50, "mov rax, [rbp+var_28]"], [51, "add rax, 8"], [52, "mov rdx, rax"], [53, "shr rdx, 3"], [54, "add rdx, 7FFF8000h"], [55, "movzx edx, byte ptr [rdx]"], [56, "test dl, dl"], [57, "jz short loc_403E4F"], [58, "mov rdi, rax"], [59, "call ___asan_report_load8"], [60, "mov rax, [rbp+var_28]"], [61, "mov rax, [rax+8]"], [62, "cmp [rbp+var_18], rax"], [63, "jbe loc_4040D5"], [64, "jmp loc_403F26"], [65, "mov rax, [rbp+var_28]"], [66, "cmp [rbp+var_28], 0"], [67, "jz short loc_403E7C"], [68, "mov rdx, rax"], [69, "and edx, 7"], [70, "test rdx, rdx"], [71, "jz short loc_403E89"], [72, "mov rsi, rax"], [73, "mov edi, offset off_430AC0"], [74, "call ___ubsan_handle_type_mismatch_v1"], [75, "mov rax, [rbp+var_28]"], [76, "lea rdx, [rax+8]"], [77, "cmp rax, 0FFFFFFFFFFFFFFF8h"], [78, "jb short loc_403EA8"], [79, "mov rax, [rbp+var_28]"], [80, "mov rsi, rax"], [81, "mov edi, offset off_430B00"], [82, "call ___ubsan_handle_pointer_overflow"], [83, "mov rax, [rbp+var_28]"], [84, "add rax, 8"], [85, "mov rdx, rax"], [86, "shr rdx, 3"], [87, "add rdx, 7FFF8000h"], [88, "movzx edx, byte ptr [rdx]"], [89, "test dl, dl"], [90, "jz short loc_403ECD"], [91, "mov rdi, rax"], [92, "call ___asan_report_load8"], [93, "mov rax, [rbp+var_28]"], [94, "mov rax, [rax+8]"], [95, "lea rbx, [rax+1000h]"], [96, "mov rax, [rbp+var_28]"], [97, "cmp [rbp+var_28], 0"], [98, "jz short loc_403EF2"], [99, "mov rdx, rax"], [100, "and edx, 7"], [101, "test rdx, rdx"], [102, "jz short loc_403EFF"], [103, "mov rsi, rax"], [104, "mov edi, offset off_430B40"], [105, "call ___ubsan_handle_type_mismatch_v1"], [106, "mov rax, [rbp+var_28]"], [107, "lea rdx, [rax+8]"], [108, "cmp rax, 0FFFFFFFFFFFFFFF8h"], [109, "jb short loc_403F1E"], [110, "mov rax, [rbp+var_28]"], [111, "mov rsi, rax"], [112, "mov edi, offset off_430B80"], [113, "call ___ubsan_handle_pointer_overflow"], [114, "mov rax, [rbp+var_28]"], [115, "mov [rax+8], rbx"], [116, "mov rax, [rbp+var_28]"], [117, "cmp [rbp+var_28], 0"], [118, "jz short loc_403F3C"], [119, "mov rdx, rax"], [120, "and edx, 7"], [121, "test rdx, rdx"], [122, "jz short loc_403F49"], [123, "mov rsi, rax"], [124, "mov edi, offset off_430BC0"], [125, "call ___ubsan_handle_type_mismatch_v1"], [126, "mov rax, [rbp+var_28]"], [127, "lea rdx, [rax+8]"], [128, "cmp rax, 0FFFFFFFFFFFFFFF8h"], [129, "jb short loc_403F68"], [130, "mov rax, [rbp+var_28]"], [131, "mov rsi, rax"], [132, "mov edi, offset off_430C00"], [133, "call ___ubsan_handle_pointer_overflow"], [134, "mov rax, [rbp+var_28]"], [135, "add rax, 8"], [136, "mov rdx, rax"], [137, "shr rdx, 3"], [138, "add rdx, 7FFF8000h"], [139, "movzx edx, byte ptr [rdx]"], [140, "test dl, dl"], [141, "jz short loc_403F8D"], [142, "mov rdi, rax"], [143, "call ___asan_report_load8"], [144, "mov rax, [rbp+var_28]"], [145, "mov rax, [rax+8]"], [146, "cmp [rbp+var_18], rax"], [147, "ja loc_403E66"], [148, "mov rax, [rbp+var_28]"], [149, "cmp [rbp+var_28], 0"], [150, "jz short loc_403FB5"], [151, "mov rdx, rax"], [152, "and edx, 7"], [153, "test rdx, rdx"], [154, "jz short loc_403FC2"], [155, "mov rsi, rax"], [156, "mov edi, offset off_430C40"], [157, "call ___ubsan_handle_type_mismatch_v1"], [158, "mov rax, [rbp+var_28]"], [159, "lea rdx, [rax+8]"], [160, "cmp rax, 0FFFFFFFFFFFFFFF8h"], [161, "jb short loc_403FE1"], [162, "mov rax, [rbp+var_28]"], [163, "mov rsi, rax"], [164, "mov edi, offset off_430C80"], [165, "call ___ubsan_handle_pointer_overflow"], [166, "mov rax, [rbp+var_28]"], [167, "mov rbx, [rax+8]"], [168, "mov rax, [rbp+var_28]"], [169, "cmp [rbp+var_28], 0"], [170, "jz short loc_403FFF"], [171, "mov rdx, rax"], [172, "and edx, 7"], [173, "test rdx, rdx"], [174, "jz short loc_40400C"], [175, "mov rsi, rax"], [176, "mov edi, offset off_430CC0"], [177, "call ___ubsan_handle_type_mismatch_v1"], [178, "mov rax, [rbp+var_28]"], [179, "lea rdx, [rax+10h]"], [180, "cmp rax, 0FFFFFFFFFFFFFFF0h"], [181, "jb short loc_40402B"], [182, "mov rax, [rbp+var_28]"], [183, "mov rsi, rax"], [184, "mov edi, offset off_430D00"], [185, "call ___ubsan_handle_pointer_overflow"], [186, "mov rax, [rbp+var_28]"], [187, "add rax, 10h"], [188, "mov rdx, rax"], [189, "shr rdx, 3"], [190, "add rdx, 7FFF8000h"], [191, "movzx edx, byte ptr [rdx]"], [192, "test dl, dl"], [193, "jz short loc_404050"], [194, "mov rdi, rax"], [195, "call ___asan_report_load8"], [196, "mov rax, [rbp+var_28]"], [197, "mov rax, [rax+10h]"], [198, "mov rsi, rbx"], [199, "mov rdi, rax"], [200, "call sub_403931"], [201, "mov rbx, rax"], [202, "mov rax, [rbp+var_28]"], [203, "cmp [rbp+var_28], 0"], [204, "jz short loc_40407C"], [205, "mov rdx, rax"], [206, "and edx, 7"], [207, "test rdx, rdx"], [208, "jz short loc_404089"], [209, "mov rsi, rax"], [210, "mov edi, offset off_430D40"], [211, "call ___ubsan_handle_type_mismatch_v1"], [212, "mov rax, [rbp+var_28]"], [213, "lea rdx, [rax+10h]"], [214, "cmp rax, 0FFFFFFFFFFFFFFF0h"], [215, "jb short loc_4040A8"], [216, "mov rax, [rbp+var_28]"], [217, "mov rsi, rax"], [218, "mov edi, offset off_430D80"], [219, "call ___ubsan_handle_pointer_overflow"], [220, "mov rax, [rbp+var_28]"], [221, "add rax, 10h"], [222, "mov rdx, rax"], [223, "shr rdx, 3"], [224, "add rdx, 7FFF8000h"], [225, "movzx edx, byte ptr [rdx]"], [226, "test dl, dl"], [227, "jz short loc_4040CD"], [228, "mov rdi, rax"], [229, "call ___asan_report_store8"], [230, "mov rax, [rbp+var_28]"], [231, "mov [rax+10h], rbx"], [232, "mov rax, [rbp+var_28]"], [233, "cmp [rbp+var_28], 0"], [234, "jz short loc_4040EB"], [235, "mov rdx, rax"], [236, "and edx, 7"], [237, "test rdx, rdx"], [238, "jz short loc_4040F8"], [239, "mov rsi, rax"], [240, "mov edi, offset off_430DC0"], [241, "call ___ubsan_handle_type_mismatch_v1"], [242, "mov rax, [rbp+var_28]"], [243, "lea rdx, [rax+10h]"], [244, "cmp rax, 0FFFFFFFFFFFFFFF0h"], [245, "jb short loc_404117"], [246, "mov rax, [rbp+var_28]"], [247, "mov rsi, rax"], [248, "mov edi, offset off_430E00"], [249, "call ___ubsan_handle_pointer_overflow"], [250, "mov rax, [rbp+var_28]"], [251, "add rax, 10h"], [252, "mov rdx, rax"], [253, "shr rdx, 3"], [254, "add rdx, 7FFF8000h"], [255, "movzx edx, byte ptr [rdx]"], [256, "test dl, dl"], [257, "jz short loc_40413C"], [258, "mov rdi, rax"], [259, "call ___asan_report_load8"], [260, "mov rax, [rbp+var_28]"], [261, "mov rbx, [rax+10h]"], [262, "mov rax, [rbp+var_28]"], [263, "cmp [rbp+var_28], 0"], [264, "jz short loc_40415A"], [265, "mov rdx, rax"], [266, "and edx, 7"], [267, "test rdx, rdx"], [268, "jz short loc_404167"], [269, "mov rsi, rax"], [270, "mov edi, offset off_430E40"], [271, "call ___ubsan_handle_type_mismatch_v1"], [272, "mov rax, [rbp+var_28]"], [273, "mov rdx, rax"], [274, "shr rdx, 3"], [275, "add rdx, 7FFF8000h"], [276, "movzx edx, byte ptr [rdx]"], [277, "test dl, dl"], [278, "jz short loc_404188"], [279, "mov rdi, rax"], [280, "call ___asan_report_load8"], [281, "mov rax, [rbp+var_28]"], [282, "mov r12, [rax]"], [283, "mov rdx, rbx"], [284, "lea rax, [rdx+r12]"], [285, "mov rcx, r12"], [286, "not rcx"], [287, "shr rcx, 3Fh"], [288, "test cl, cl"], [289, "jz short loc_4041BB"], [290, "cmp rax, rdx"], [291, "jnb short loc_4041C0"], [292, "mov rdx, rax"], [293, "mov rsi, rbx"], [294, "mov edi, offset off_430E80"], [295, "call ___ubsan_handle_pointer_overflow"], [296, "jmp short loc_4041C0"], [297, "cmp rax, rdx"], [298, "ja short loc_4041A9"], [299, "add rbx, r12"], [300, "test rbx, rbx"], [301, "jnz short loc_4041D2"], [302, "mov edi, offset off_445880"], [303, "call ___ubsan_handle_nonnull_arg"], [304, "cmp [rbp+src], 0"], [305, "jnz short loc_4041E3"], [306, "mov edi, offset off_4458E0"], [307, "call ___ubsan_handle_nonnull_arg"], [308, "mov rdx, [rbp+n]"], [309, "mov rax, [rbp+src]"], [310, "mov rsi, rax"], [311, "mov rdi, rbx"], [312, "call _memcpy"], [313, "mov rax, [rbp+var_28]"], [314, "cmp [rbp+var_28], 0"], [315, "jz short loc_40420C"], [316, "mov rdx, rax"], [317, "and edx, 7"], [318, "test rdx, rdx"], [319, "jz short loc_404219"], [320, "mov rsi, rax"], [321, "mov edi, offset off_430EC0"], [322, "call ___ubsan_handle_type_mismatch_v1"], [323, "mov rax, [rbp+var_28]"], [324, "mov rdx, rax"], [325, "shr rdx, 3"], [326, "add rdx, 7FFF8000h"], [327, "movzx edx, byte ptr [rdx]"], [328, "test dl, dl"], [329, "jz short loc_40423A"], [330, "mov rdi, rax"], [331, "call ___asan_report_load8"], [332, "mov rax, [rbp+var_28]"], [333, "mov rdx, [rax]"], [334, "mov rax, [rbp+n]"], [335, "lea rbx, [rdx+rax]"], [336, "mov rax, [rbp+var_28]"], [337, "cmp [rbp+var_28], 0"], [338, "jz short loc_40425F"], [339, "mov rdx, rax"], [340, "and edx, 7"], [341, "test rdx, rdx"], [342, "jz short loc_40426C"], [343, "mov rsi, rax"], [344, "mov edi, offset off_430F00"], [345, "call ___ubsan_handle_type_mismatch_v1"], [346, "mov rax, [rbp+var_28]"], [347, "mov [rax], rbx"], [348, "nop"], [349, "add rsp, 30h"], [350, "pop rbx"], [351, "pop r12"], [352, "pop rbp"], [353, "retn"]], "data_dep": [[8, 5], [9, 5], [10, 9], [11, 8], [12, 11], [13, 12], [14, 13], [15, 8], [18, 5], [19, 18], [20, 19], [21, 20], [22, 21], [23, 22], [24, 23], [25, 18], [27, 5], [28, 27], [29, 7], [30, 29], [30, 28], [31, 30], [32, 5], [33, 5], [34, 33], [35, 32], [36, 35], [37, 36], [38, 37], [39, 32], [42, 5], [43, 42], [43, 28], [43, 37], [44, 42], [45, 44], [46, 5], [47, 46], [50, 5], [51, 50], [52, 51], [53, 52], [54, 53], [55, 54], [56, 55], [57, 56], [58, 51], [60, 5], [61, 60], [62, 31], [62, 61], [63, 62], [65, 5], [66, 5], [67, 66], [68, 65], [69, 68], [70, 69], [71, 70], [72, 65], [75, 5], [76, 115], [76, 75], [76, 70], [76, 140], [77, 75], [78, 77], [79, 5], [80, 79], [83, 5], [84, 83], [85, 84], [86, 85], [87, 86], [88, 115], [88, 87], [89, 88], [90, 89], [91, 84], [93, 5], [94, 93], [94, 115], [95, 115], [95, 95], [95, 94], [96, 5], [97, 5], [98, 97], [99, 96], [100, 99], [101, 100], [102, 101], [103, 96], [106, 5], [107, 89], [107, 106], [107, 115], [107, 101], [108, 106], [109, 108], [110, 5], [111, 110], [114, 5], [115, 114], [115, 95], [116, 5], [117, 5], [118, 117], [119, 116], [120, 119], [121, 120], [122, 121], [123, 116], [126, 5], [127, 126], [127, 56], [127, 121], [127, 107], [127, 115], [128, 126], [129, 128], [130, 5], [131, 130], [134, 5], [135, 134], [136, 135], [137, 136], [138, 137], [139, 138], [139, 115], [140, 139], [141, 140], [142, 135], [144, 5], [145, 144], [145, 115], [146, 31], [146, 145], [147, 146], [148, 5], [149, 5], [150, 149], [151, 148], [152, 151], [153, 152], [154, 153], [155, 148], [158, 5], [159, 140], [159, 158], [159, 153], [159, 115], [160, 158], [161, 160], [162, 5], [163, 162], [166, 5], [167, 166], [167, 115], [168, 5], [169, 5], [170, 169], [171, 168], [172, 171], [173, 172], [174, 173], [175, 168], [178, 5], [179, 178], [179, 173], [179, 159], [179, 115], [180, 178], [181, 180], [182, 5], [183, 182], [186, 5], [187, 186], [188, 187], [189, 188], [190, 189], [191, 190], [191, 115], [192, 191], [193, 192], [194, 187], [196, 5], [197, 196], [197, 115], [198, 167], [199, 197], [201, 200], [202, 5], [203, 5], [204, 203], [205, 202], [206, 205], [207, 206], [208, 207], [209, 202], [212, 5], [213, 115], [213, 212], [213, 207], [213, 192], [214, 212], [215, 214], [216, 5], [217, 216], [220, 5], [221, 220], [222, 221], [223, 222], [224, 223], [225, 224], [225, 115], [226, 225], [227, 226], [228, 221], [230, 5], [231, 230], [231, 201], [232, 5], [233, 5], [234, 233], [235, 232], [236, 235], [237, 236], [238, 237], [239, 232], [242, 5], [243, 242], [243, 237], [243, 56], [243, 115], [243, 231], [243, 226], [244, 242], [245, 244], [246, 5], [247, 246], [250, 5], [251, 250], [252, 251], [253, 252], [254, 253], [255, 231], [255, 115], [255, 254], [256, 255], [257, 256], [258, 251], [260, 5], [261, 115], [261, 231], [261, 260], [262, 5], [263, 5], [264, 263], [265, 262], [266, 265], [267, 266], [268, 267], [269, 262], [272, 5], [273, 272], [274, 273], [275, 274], [276, 275], [276, 115], [276, 231], [277, 276], [278, 277], [279, 272], [281, 5], [282, 115], [282, 281], [282, 231], [283, 261], [284, 283], [284, 115], [284, 231], [284, 281], [285, 282], [286, 285], [287, 286], [288, 287], [289, 288], [290, 284], [290, 283], [291, 290], [292, 284], [293, 261], [297, 283], [297, 284], [298, 297], [299, 282], [299, 261], [300, 299], [301, 300], [304, 6], [305, 304], [308, 7], [309, 6], [310, 309], [311, 300], [313, 5], [314, 5], [315, 314], [316, 313], [317, 316], [318, 317], [319, 318], [320, 313], [323, 5], [324, 323], [325, 324], [326, 325], [327, 115], [327, 231], [327, 326], [328, 327], [329, 328], [330, 323], [332, 5], [333, 115], [333, 231], [333, 332], [334, 7], [335, 115], [335, 231], [335, 334], [335, 300], [336, 5], [337, 5], [338, 337], [339, 336], [340, 339], [341, 340], [342, 341], [343, 336], [346, 5], [347, 346], [347, 335], [349, 4], [350, 3], [351, 2], [352, 0], [353, 346]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413_3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.jsonl.gz", "strip_func_name": "sub_403D7B", "query": "\n\n\nunsigned __int64 __fastcall sub_403D7B(unsigned __int64 a1, const void *a2, size_t a3)\n{\n__int64 v3; // rbx\nsize_t v4; // rbx\nvoid *v5; // rbx\nunsigned __int64 v6; // rbx\n__int64 v7; // r12\nunsigned __int64 v8; // rax\nvoid *v9; // rbx\nsize_t v10; // rbx\nunsigned __int64 result; // rax\nsize_t v13; // [rsp+28h] [rbp-18h]\n\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((a1 >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv13 = *(_QWORD *)a1 + a3;\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF8LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 8) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nif ( v13 > *(_QWORD *)(a1 + 8) )\n{\nwhile ( 1 )\n{\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF8LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 8) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nif ( v13 <= *(_QWORD *)(a1 + 8) )\nbreak;\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF8LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 8) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv3 = *(_QWORD *)(a1 + 8) + 4096LL;\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF8LL )\n__ubsan_handle_pointer_overflow();\n*(_QWORD *)(a1 + 8) = v3;\n}\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF8LL )\n__ubsan_handle_pointer_overflow();\nv4 = *(_QWORD *)(a1 + 8);\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF0LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 16) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv5 = sub_403931(*(void **)(a1 + 16), v4);\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF0LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 16) >> 3) + 0x7FFF8000) )\n__asan_report_store8();\n*(_QWORD *)(a1 + 16) = v5;\n}\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( a1 >= 0xFFFFFFFFFFFFFFF0LL )\n__ubsan_handle_pointer_overflow();\nif ( *(_BYTE *)(((a1 + 16) >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv6 = *(_QWORD *)(a1 + 16);\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((a1 >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv7 = *(_QWORD *)a1;\nv8 = v6 + *(_QWORD *)a1;\nif ( *(__int64 *)a1 >= 0 )\n{\nif ( v8 >= v6 )\ngoto LABEL_72;\ngoto LABEL_70;\n}\nif ( v8 > v6 )\nLABEL_70:\n__ubsan_handle_pointer_overflow();\nLABEL_72:\nv9 = (void *)(v7 + v6);\nif ( !v9 )\n__ubsan_handle_nonnull_arg();\nif ( !a2 )\n__ubsan_handle_nonnull_arg();\nmemcpy(v9, a2, a3);\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((a1 >> 3) + 0x7FFF8000) )\n__asan_report_load8();\nv10 = *(_QWORD *)a1 + a3;\nif ( !a1 || (a1 & 7) != 0 )\n__ubsan_handle_type_mismatch_v1();\nresult = a1;\n*(_QWORD *)a1 = v10;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v13,sub_403D7B,sub_403931,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'buf', 'a2': 's', 'v13': 'need', 'sub_403D7B': 'appendl', 'sub_403931': 'xrealloc'}"} | [
[
0.7631751894950867,
0.7432308197021484,
0.7403450608253479,
0.7263461351394653,
0.7224199771881104,
0.7211841940879822,
0.7161034345626831,
0.7155909538269043,
0.7154579758644104,
0.7130941152572632,
0.7081686854362488,
0.7057976126670837,
0.7018526792526245,
0.7018247842788696,
0.7012025713920593,
0.6942107677459717,
0.6932534575462341,
0.6906520128250122,
0.6899726390838623,
0.6896499991416931
],
[
251063,
105054,
24271,
161702,
169138,
154323,
47458,
73714,
127342,
239041,
184184,
52870,
219157,
177438,
129639,
60355,
219817,
243570,
16476,
32730
]
] |
|
render_sprite_4x | 2a88bf2821a4bad2730716bb0472eb898d83070dce6cc540bd05d05f1b116b6c | xyzz | psclassic-source | NA | void render_sprite_4x(psx_gpu_struct *psx_gpu, s32 x, s32 y, u32 u, u32 v,
s32 width, s32 height, u32 flags, u32 color)
{
s32 x_right = x + width - 1;
s32 y_bottom = y + height - 1;
#ifdef PROFILE
sprites++;
#endif
if(x < psx_gpu->viewport_start_x)
{
u32 clip = psx_gpu->viewport_start_x - x;
x += clip;
u += clip;
width -= clip;
}
if(y < psx_gpu->viewport_start_y)
{
s32 clip = psx_gpu->viewport_start_y - y;
y += clip;
v += clip;
height -= clip;
}
if(x_right > psx_gpu->viewport_end_x)
width -= x_right - psx_gpu->viewport_end_x;
if(y_bottom > psx_gpu->viewport_end_y)
height -= y_bottom - psx_gpu->viewport_end_y;
if((width <= 0) || (height <= 0))
return;
psx_gpu->vram_out_ptr = select_enhancement_buf_ptr(psx_gpu, x);
x *= 2;
y *= 2;
#ifdef PROFILE
span_pixels += width * height;
spans += height;
#endif
u32 render_state = flags &
(RENDER_FLAGS_MODULATE_TEXELS | RENDER_FLAGS_BLEND |
RENDER_FLAGS_TEXTURE_MAP);
render_state |=
(psx_gpu->render_state_base & ~RENDER_STATE_DITHER);
if((psx_gpu->render_state != render_state) ||
(psx_gpu->primitive_type != PRIMITIVE_TYPE_SPRITE))
{
psx_gpu->render_state = render_state;
flush_render_block_buffer(psx_gpu);
#ifdef PROFILE
state_changes++;
#endif
}
psx_gpu->primitive_type = PRIMITIVE_TYPE_SPRITE;
color &= 0xFFFFFF;
if(psx_gpu->triangle_color != color)
{
flush_render_block_buffer(psx_gpu);
psx_gpu->triangle_color = color;
}
if(color == 0x808080)
render_state |= RENDER_FLAGS_MODULATE_TEXELS;
render_block_handler_struct *render_block_handler =
&(render_sprite_block_handlers_4x[render_state]);
psx_gpu->render_block_handler = render_block_handler;
((setup_sprite_function_type *)render_block_handler->setup_blocks)
(psx_gpu, x, y, u, v, width, height, color);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_474F89", "function_addr": 4673417, "binary_name": "2a88bf2821a4bad2730716bb0472eb898d83070dce6cc540bd05d05f1b116b6c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov [rbp+var_30], edx"], [6, "mov [rbp+var_34], ecx"], [7, "mov [rbp+var_38], r8d"], [8, "mov [rbp+var_3C], r9d"], [9, "mov edx, [rbp+var_2C]"], [10, "mov eax, [rbp+var_3C]"], [11, "add eax, edx"], [12, "sub eax, 1"], [13, "mov [rbp+var_8], eax"], [14, "mov edx, [rbp+var_30]"], [15, "mov eax, [rbp+arg_0]"], [16, "add eax, edx"], [17, "sub eax, 1"], [18, "mov [rbp+var_C], eax"], [19, "mov rax, [rbp+var_28]"], [20, "movzx eax, word ptr [rax+108h]"], [21, "cwde"], [22, "cmp [rbp+var_2C], eax"], [23, "jge short loc_474FFF"], [24, "mov rax, [rbp+var_28]"], [25, "movzx eax, word ptr [rax+108h]"], [26, "cwde"], [27, "sub eax, [rbp+var_2C]"], [28, "mov [rbp+var_10], eax"], [29, "mov edx, [rbp+var_2C]"], [30, "mov eax, [rbp+var_10]"], [31, "add eax, edx"], [32, "mov [rbp+var_2C], eax"], [33, "mov eax, [rbp+var_10]"], [34, "add [rbp+var_34], eax"], [35, "mov eax, [rbp+var_3C]"], [36, "sub eax, [rbp+var_10]"], [37, "mov [rbp+var_3C], eax"], [38, "mov rax, [rbp+var_28]"], [39, "movzx eax, word ptr [rax+10Ah]"], [40, "cwde"], [41, "cmp [rbp+var_30], eax"], [42, "jge short loc_475034"], [43, "mov rax, [rbp+var_28]"], [44, "movzx eax, word ptr [rax+10Ah]"], [45, "cwde"], [46, "sub eax, [rbp+var_30]"], [47, "mov [rbp+var_14], eax"], [48, "mov eax, [rbp+var_14]"], [49, "add [rbp+var_30], eax"], [50, "mov eax, [rbp+var_14]"], [51, "add [rbp+var_38], eax"], [52, "mov eax, [rbp+var_14]"], [53, "sub [rbp+arg_0], eax"], [54, "mov rax, [rbp+var_28]"], [55, "movzx eax, word ptr [rax+10Ch]"], [56, "cwde"], [57, "cmp [rbp+var_8], eax"], [58, "jle short loc_47505B"], [59, "mov rax, [rbp+var_28]"], [60, "movzx eax, word ptr [rax+10Ch]"], [61, "movsx edx, ax"], [62, "mov eax, [rbp+var_8]"], [63, "sub eax, edx"], [64, "sub [rbp+var_3C], eax"], [65, "mov rax, [rbp+var_28]"], [66, "movzx eax, word ptr [rax+10Eh]"], [67, "cwde"], [68, "cmp [rbp+var_C], eax"], [69, "jle short loc_475082"], [70, "mov rax, [rbp+var_28]"], [71, "movzx eax, word ptr [rax+10Eh]"], [72, "movsx edx, ax"], [73, "mov eax, [rbp+var_C]"], [74, "sub eax, edx"], [75, "sub [rbp+arg_0], eax"], [76, "cmp [rbp+var_3C], 0"], [77, "jle loc_4751D2"], [78, "cmp [rbp+arg_0], 0"], [79, "jle loc_4751D2"], [80, "mov rax, [rbp+var_28]"], [81, "mov rcx, [rax+130h]"], [82, "mov eax, [rbp+var_2C]"], [83, "lea edx, [rax+0Fh]"], [84, "test eax, eax"], [85, "cmovs eax, edx"], [86, "sar eax, 4"], [87, "mov rdx, [rbp+var_28]"], [88, "cdqe"], [89, "movzx eax, byte ptr [rdx+rax+14Ch]"], [90, "movzx eax, al"], [91, "shl eax, 14h"], [92, "cdqe"], [93, "add rax, rax"], [94, "lea rdx, [rcx+rax]"], [95, "mov rax, [rbp+var_28]"], [96, "mov [rax+0F8h], rdx"], [97, "shl [rbp+var_2C], 1"], [98, "shl [rbp+var_30], 1"], [99, "mov eax, [rbp+arg_8]"], [100, "and eax, 7"], [101, "mov [rbp+var_4], eax"], [102, "mov rax, [rbp+var_28]"], [103, "movzx eax, word ptr [rax+100h]"], [104, "movzx eax, ax"], [105, "and eax, 0FFFFFFF7h"], [106, "or [rbp+var_4], eax"], [107, "mov rax, [rbp+var_28]"], [108, "movzx eax, word ptr [rax+102h]"], [109, "movzx eax, ax"], [110, "cmp [rbp+var_4], eax"], [111, "jnz short loc_47511C"], [112, "mov rax, [rbp+var_28]"], [113, "movzx eax, byte ptr [rax+11Ah]"], [114, "cmp al, 1"], [115, "jz short loc_475138"], [116, "mov eax, [rbp+var_4]"], [117, "mov edx, eax"], [118, "mov rax, [rbp+var_28]"], [119, "mov [rax+102h], dx"], [120, "mov rax, [rbp+var_28]"], [121, "mov rdi, rax"], [122, "call sub_401C40"], [123, "mov rax, [rbp+var_28]"], [124, "mov byte ptr [rax+11Ah], 1"], [125, "and [rbp+arg_10], 0FFFFFFh"], [126, "mov rax, [rbp+var_28]"], [127, "mov eax, [rax+0B4h]"], [128, "cmp [rbp+arg_10], eax"], [129, "jz short loc_475172"], [130, "mov rax, [rbp+var_28]"], [131, "mov rdi, rax"], [132, "call sub_401C40"], [133, "mov rax, [rbp+var_28]"], [134, "mov edx, [rbp+arg_10]"], [135, "mov [rax+0B4h], edx"], [136, "cmp [rbp+arg_10], offset unk_808080"], [137, "jnz short loc_47517F"], [138, "or [rbp+var_4], 1"], [139, "mov eax, [rbp+var_4]"], [140, "shl rax, 5"], [141, "add rax, 4A80E0h"], [142, "mov [rbp+var_20], rax"], [143, "mov rax, [rbp+var_28]"], [144, "mov rdx, [rbp+var_20]"], [145, "mov [rax+0D0h], rdx"], [146, "mov rax, [rbp+var_20]"], [147, "mov rax, [rax]"], [148, "mov r10, rax"], [149, "mov r8d, [rbp+var_38]"], [150, "mov ecx, [rbp+var_34]"], [151, "mov r9d, [rbp+var_3C]"], [152, "mov edx, [rbp+var_30]"], [153, "mov esi, [rbp+var_2C]"], [154, "mov rax, [rbp+var_28]"], [155, "mov edi, [rbp+arg_10]"], [156, "push rdi"], [157, "mov edi, [rbp+arg_0]"], [158, "push rdi"], [159, "mov rdi, rax"], [160, "call r10"], [161, "add rsp, 10h"], [162, "jmp short locret_4751D3"], [163, "nop"], [164, "leave"], [165, "retn"]], "data_dep": [[9, 4], [10, 8], [11, 9], [11, 10], [12, 11], [13, 12], [14, 5], [16, 15], [16, 14], [17, 16], [18, 17], [19, 3], [20, 19], [22, 20], [22, 4], [23, 22], [24, 3], [25, 24], [27, 4], [27, 25], [28, 27], [29, 4], [30, 28], [31, 29], [31, 30], [32, 31], [33, 28], [34, 6], [34, 33], [35, 8], [36, 35], [36, 28], [37, 36], [38, 3], [39, 38], [41, 39], [41, 5], [42, 41], [43, 3], [44, 43], [46, 44], [46, 5], [47, 46], [48, 47], [49, 48], [49, 5], [50, 47], [51, 7], [51, 50], [52, 47], [53, 52], [54, 3], [55, 54], [57, 13], [57, 55], [58, 57], [59, 3], [60, 59], [61, 60], [62, 13], [63, 61], [63, 62], [64, 63], [64, 8], [64, 37], [65, 3], [66, 65], [68, 66], [68, 18], [69, 68], [70, 3], [71, 70], [72, 71], [73, 18], [74, 73], [74, 72], [75, 74], [75, 53], [76, 8], [76, 37], [76, 64], [77, 76], [78, 53], [78, 75], [79, 78], [80, 3], [81, 80], [82, 32], [82, 4], [83, 14], [83, 82], [83, 61], [83, 72], [83, 29], [84, 82], [85, 84], [85, 83], [86, 85], [87, 3], [89, 86], [90, 89], [91, 90], [93, 91], [94, 87], [94, 93], [95, 3], [96, 95], [96, 94], [97, 32], [97, 4], [98, 5], [98, 49], [99, 13], [100, 99], [101, 100], [102, 3], [103, 102], [103, 96], [104, 103], [105, 104], [106, 101], [106, 105], [107, 3], [108, 107], [108, 96], [109, 108], [110, 109], [110, 106], [111, 110], [112, 3], [113, 96], [113, 112], [114, 113], [115, 114], [116, 106], [117, 116], [118, 3], [119, 118], [119, 117], [120, 3], [121, 120], [123, 3], [124, 123], [125, 28], [126, 3], [127, 124], [127, 126], [128, 125], [128, 127], [129, 128], [130, 3], [131, 130], [133, 3], [134, 125], [135, 133], [135, 134], [136, 125], [137, 136], [138, 106], [139, 138], [139, 106], [140, 139], [141, 140], [142, 141], [143, 3], [144, 142], [145, 144], [145, 143], [146, 142], [147, 146], [147, 145], [148, 147], [149, 7], [149, 51], [150, 6], [150, 34], [151, 8], [151, 37], [151, 64], [152, 98], [153, 97], [154, 3], [155, 125], [156, 155], [157, 75], [157, 53], [158, 157], [159, 154], [160, 148], [161, 2], [165, 74], [165, 160], [165, 66]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2a88bf2821a4bad2730716bb0472eb898d83070dce6cc540bd05d05f1b116b6c_2a88bf2821a4bad2730716bb0472eb898d83070dce6cc540bd05d05f1b116b6c.jsonl.gz", "strip_func_name": "sub_474F89", "query": "\n\n\nint __fastcall sub_474F89(__int64 a1, int a2, int a3, int a4, int a5, int a6, int a7, char a8, int a9)\n{\nint result; // eax\nint v10; // [rsp+4h] [rbp-3Ch]\nint v11; // [rsp+8h] [rbp-38h]\nint v12; // [rsp+Ch] [rbp-34h]\nint v13; // [rsp+10h] [rbp-30h]\nint v14; // [rsp+10h] [rbp-30h]\nint v15; // [rsp+14h] [rbp-2Ch]\nint v16; // [rsp+14h] [rbp-2Ch]\nint v17; // [rsp+2Ch] [rbp-14h]\nint v18; // [rsp+30h] [rbp-10h]\nint v19; // [rsp+34h] [rbp-Ch]\nint v20; // [rsp+38h] [rbp-8h]\nunsigned int v21; // [rsp+3Ch] [rbp-4h]\nint v22; // [rsp+60h] [rbp+20h]\n\nv15 = a2;\nv13 = a3;\nv12 = a4;\nv11 = a5;\nv10 = a6;\nv20 = a2 + a6 - 1;\nv19 = a3 + a7 - 1;\nif ( a2 < *(__int16 *)(a1 + 264) )\n{\nv18 = *(__int16 *)(a1 + 264) - a2;\nv15 = *(__int16 *)(a1 + 264);\nv12 = v18 + a4;\nv10 = a6 - v18;\n}\nif ( a3 < *(__int16 *)(a1 + 266) )\n{\nv17 = *(__int16 *)(a1 + 266) - a3;\nv13 = *(__int16 *)(a1 + 266);\nv11 = v17 + a5;\na7 -= v17;\n}\nif ( v20 > *(__int16 *)(a1 + 268) )\nv10 -= v20 - *(__int16 *)(a1 + 268);\nresult = *(__int16 *)(a1 + 270);\nif ( v19 > (__int16)result )\n{\nresult = v19 - *(__int16 *)(a1 + 270);\na7 -= result;\n}\nif ( v10 > 0 && a7 > 0 )\n{\n*(_QWORD *)(a1 + 248) = *(_QWORD *)(a1 + 304) + 2LL * (*(unsigned __int8 *)(a1 + v15 / 16 + 332) << 20);\nv16 = 2 * v15;\nv14 = 2 * v13;\nv21 = *(_WORD *)(a1 + 256) & 0xFFF7 | a8 & 7;\nif ( v21 != *(unsigned __int16 *)(a1 + 258) || *(_BYTE *)(a1 + 282) != 1 )\n{\n*(_WORD *)(a1 + 258) = v21;\nsub_401C40(a1);\n}\n*(_BYTE *)(a1 + 282) = 1;\nv22 = a9 & 0xFFFFFF;\nif ( v22 != *(_DWORD *)(a1 + 180) )\n{\nsub_401C40(a1);\n*(_DWORD *)(a1 + 180) = v22;\n}\nif ( v22 == (_DWORD)&unk_808080 )\nv21 |= 1u;\n*(_QWORD *)(a1 + 208) = 32LL * v21 + 4882656;\nresult = (*(&off_4A80E0 + 4 * v21))(a1, v16, v14, v12, v11, v10, a7, v22);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,a9,v10,v11,v12,v14,v16,v17,v18,v19,v20,v21,v22,sub_474F89,sub_401C40,]", "hints": "[]", "response": "{'a3': 'y', 'a4': 'u', 'a1': 'psx_gpu', 'a2': 'x', 'a5': 'v', 'a6': 'width', 'a7': 'height', 'a8': 'flags', 'a9': 'color', 'v10': 'widtha', 'v11': 'va', 'v12': 'ua', 'v14': 'ya', 'v16': 'xa', 'v17': 'clip_0', 'v18': 'clip', 'v19': 'y_bottom', 'v20': 'x_right', 'v21': 'render_state', 'v22': 'colora', 'sub_474F89': 'render_sprite_4x', 'sub_401C40': 'flush_render_block_buffer'}"} | [
[
0.8176001310348511,
0.8136842250823975,
0.7927360534667969,
0.7758435010910034,
0.7700898051261902,
0.7696557641029358,
0.7690213918685913,
0.7684396505355835,
0.7671146988868713,
0.7669501304626465,
0.7668236494064331,
0.7651565670967102,
0.7608041167259216,
0.758927047252655,
0.7544295787811279,
0.7531962990760803,
0.7486202716827393,
0.7444779872894287,
0.7443615794181824,
0.7427822351455688
],
[
29025,
167996,
262026,
143836,
206113,
95626,
164844,
3765,
235351,
35811,
78997,
148751,
197795,
10123,
70837,
175366,
13933,
156731,
60086,
91675
]
] |
|
StdioFprintfPointer | 001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13 | larryhe | tiny-c-interpreter | NA | void StdioFprintfPointer(StdOutStream *Stream, const char *Format, void *Value)
{
if (Stream->FilePtr != NULL)
Stream->CharCount += fprintf(Stream->FilePtr, Format, Value);
else if (Stream->StrOutLen >= 0)
{
int CCount = snprintf(Stream->StrOutPtr, Stream->StrOutLen, Format, Value);
Stream->StrOutPtr += CCount;
Stream->StrOutLen -= CCount;
Stream->CharCount += CCount;
}
else
{
int CCount = sprintf(Stream->StrOutPtr, Format, Value);
Stream->CharCount += CCount;
Stream->StrOutPtr += CCount;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_411F81", "function_addr": 4267905, "binary_name": "001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+format], rsi"], [5, "mov [rbp+var_28], rdx"], [6, "mov rax, [rbp+var_18]"], [7, "mov rax, [rax]"], [8, "test rax, rax"], [9, "jz short loc_411FD7"], [10, "mov rax, [rbp+var_18]"], [11, "mov rax, [rax]"], [12, "mov rdx, [rbp+var_28]"], [13, "mov rcx, [rbp+format]"], [14, "mov rsi, rcx"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _fprintf"], [18, "mov edx, eax"], [19, "mov rax, [rbp+var_18]"], [20, "mov eax, [rax+14h]"], [21, "add edx, eax"], [22, "mov rax, [rbp+var_18]"], [23, "mov [rax+14h], edx"], [24, "jmp loc_41209A"], [25, "mov rax, [rbp+var_18]"], [26, "mov eax, [rax+10h]"], [27, "test eax, eax"], [28, "js short loc_41204C"], [29, "mov rax, [rbp+var_18]"], [30, "mov eax, [rax+10h]"], [31, "movsxd rsi, eax"], [32, "mov rax, [rbp+var_18]"], [33, "mov rax, [rax+8]"], [34, "mov rcx, [rbp+var_28]"], [35, "mov rdx, [rbp+format]"], [36, "mov rdi, rax"], [37, "mov eax, 0"], [38, "call _snprintf"], [39, "mov [rbp+var_8], eax"], [40, "mov rax, [rbp+var_18]"], [41, "mov rdx, [rax+8]"], [42, "mov eax, [rbp+var_8]"], [43, "cdqe"], [44, "add rdx, rax"], [45, "mov rax, [rbp+var_18]"], [46, "mov [rax+8], rdx"], [47, "mov rax, [rbp+var_18]"], [48, "mov eax, [rax+10h]"], [49, "sub eax, [rbp+var_8]"], [50, "mov edx, eax"], [51, "mov rax, [rbp+var_18]"], [52, "mov [rax+10h], edx"], [53, "mov rax, [rbp+var_18]"], [54, "mov edx, [rax+14h]"], [55, "mov eax, [rbp+var_8]"], [56, "add edx, eax"], [57, "mov rax, [rbp+var_18]"], [58, "mov [rax+14h], edx"], [59, "jmp short loc_41209A"], [60, "mov rax, [rbp+var_18]"], [61, "mov rax, [rax+8]"], [62, "mov rdx, [rbp+var_28]"], [63, "mov rcx, [rbp+format]"], [64, "mov rsi, rcx"], [65, "mov rdi, rax"], [66, "mov eax, 0"], [67, "call _sprintf"], [68, "mov [rbp+var_4], eax"], [69, "mov rax, [rbp+var_18]"], [70, "mov edx, [rax+14h]"], [71, "mov eax, [rbp+var_4]"], [72, "add edx, eax"], [73, "mov rax, [rbp+var_18]"], [74, "mov [rax+14h], edx"], [75, "mov rax, [rbp+var_18]"], [76, "mov rdx, [rax+8]"], [77, "mov eax, [rbp+var_4]"], [78, "cdqe"], [79, "add rdx, rax"], [80, "mov rax, [rbp+var_18]"], [81, "mov [rax+8], rdx"], [82, "nop"], [83, "leave"], [84, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 3], [11, 10], [12, 5], [13, 4], [14, 13], [15, 11], [18, 17], [19, 3], [20, 19], [21, 18], [21, 20], [22, 3], [23, 22], [23, 21], [25, 3], [26, 25], [27, 26], [28, 27], [29, 3], [30, 29], [31, 30], [32, 3], [33, 32], [34, 5], [35, 4], [36, 33], [39, 38], [40, 3], [41, 40], [42, 39], [44, 42], [44, 41], [45, 3], [46, 45], [46, 44], [47, 3], [48, 47], [48, 46], [49, 39], [49, 48], [50, 49], [51, 3], [52, 51], [52, 50], [53, 3], [54, 53], [54, 52], [55, 39], [56, 55], [56, 54], [57, 3], [58, 56], [58, 57], [60, 3], [61, 60], [62, 5], [63, 4], [64, 63], [65, 61], [68, 67], [69, 3], [70, 69], [71, 68], [72, 70], [72, 71], [73, 3], [74, 73], [74, 72], [75, 3], [76, 74], [76, 75], [77, 68], [79, 76], [79, 77], [80, 3], [81, 80], [81, 79], [84, 22], [84, 57], [84, 80]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13_001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13.jsonl.gz", "strip_func_name": "sub_411F81", "query": "\n\n\n__int64 __fastcall sub_411F81(__int64 a1, const char *a2, __int64 a3)\n{\nint v3; // edx\n__int64 result; // rax\nint v5; // eax\nint v6; // edx\nint v7; // eax\n__int64 v8; // rdx\n\nif ( *(_QWORD *)a1 )\n{\nv3 = *(_DWORD *)(a1 + 20) + fprintf(*(FILE **)a1, a2, a3);\nresult = a1;\n*(_DWORD *)(a1 + 20) = v3;\n}\nelse if ( *(int *)(a1 + 16) < 0 )\n{\nv7 = sprintf(*(char **)(a1 + 8), a2, a3);\n*(_DWORD *)(a1 + 20) += v7;\nv8 = v7 + *(_QWORD *)(a1 + 8);\nresult = a1;\n*(_QWORD *)(a1 + 8) = v8;\n}\nelse\n{\nv5 = snprintf(*(char **)(a1 + 8), *(int *)(a1 + 16), a2, a3);\n*(_QWORD *)(a1 + 8) += v5;\n*(_DWORD *)(a1 + 16) -= v5;\nv6 = v5 + *(_DWORD *)(a1 + 20);\nresult = a1;\n*(_DWORD *)(a1 + 20) = v6;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v8,sub_411F81,]", "hints": "[]", "response": "{'a3': 'Value', 'a1': 'Stream', 'a2': 'Format', 'v8': 'Value', 'sub_411F81': 'StdioFprintfPointer'}"} | [
[
0.7630008459091187,
0.7378395795822144,
0.7281089425086975,
0.7226995229721069,
0.7196621894836426,
0.7193307876586914,
0.7132793068885803,
0.7122693061828613,
0.6995522975921631,
0.6959249973297119,
0.6932064294815063,
0.69024658203125,
0.6838016510009766,
0.6832215189933777,
0.6827843189239502,
0.6793150901794434,
0.678180992603302,
0.6772138476371765,
0.6759439706802368,
0.6750179529190063
],
[
247923,
202676,
64559,
235849,
4280,
96789,
47302,
223037,
185946,
268,
239728,
251664,
98113,
170861,
203865,
149334,
236829,
63901,
50173,
167485
]
] |
|
send_junk_data_super | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | static void send_junk_data_super(
const char *src_ip, unsigned short src_port,
const char *dst_ip, unsigned short dst_port,
unsigned int seq_num, unsigned int ack_num,
int len, unsigned char ttl)
{
struct send_tcp_vars vars;
//log_debug("size of vars: %ld", sizeof vars);
memset(&vars, 0, sizeof vars);
strncpy(vars.src_ip, src_ip, 16);
strncpy(vars.dst_ip, dst_ip, 16);
vars.src_port = src_port;
vars.dst_port = dst_port;
vars.flags = TCP_ACK;
vars.seq_num = seq_num;
vars.ack_num = htonl(ntohl(ack_num) + 1000);
vars.ack_num = ack_num;
//vars.wrong_tcp_checksum = 1;
vars.ttl = ttl;
u_char bytes[20] = {0x13,0x12,0xf9,0x89,0x5c,0xdd,0xa6,0x15,0x12,0x83,0x3e,0x93,0x11,0x22,0x33,0x44,0x55,0x66,0x01,0x01};
memcpy(vars.tcp_opt, bytes, 20);
vars.tcp_opt_len = 20;
vars.payload_len = len;
int i;
for (i = 0; i < len; i++) {
vars.payload[i] = '.';
}
//dump_send_tcp_vars(&vars);
send_tcp(&vars);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_413861", "function_addr": 4274273, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10C0h"], [3, "mov [rbp+src], rdi"], [4, "mov [rbp+var_10A8], rdx"], [5, "mov eax, ecx"], [6, "mov [rbp+var_10AC], r8d"], [7, "mov [rbp+netlong], r9d"], [8, "mov edx, [rbp+arg_8]"], [9, "mov ecx, esi"], [10, "mov [rbp+var_109C], cx"], [11, "mov [rbp+var_10A0], ax"], [12, "mov eax, edx"], [13, "mov [rbp+var_10B4], al"], [14, "lea rax, [rbp+s]"], [15, "mov edx, 1064h"], [16, "mov esi, 0"], [17, "mov rdi, rax"], [18, "call _memset"], [19, "mov rcx, [rbp+src]"], [20, "lea rax, [rbp+s]"], [21, "mov edx, 10h"], [22, "mov rsi, rcx"], [23, "mov rdi, rax"], [24, "call _strncpy"], [25, "mov rax, [rbp+var_10A8]"], [26, "lea rdx, [rbp+s]"], [27, "lea rcx, [rdx+10h]"], [28, "mov edx, 10h"], [29, "mov rsi, rax"], [30, "mov rdi, rcx"], [31, "call _strncpy"], [32, "movzx eax, [rbp+var_109C]"], [33, "mov [rbp+var_104C], ax"], [34, "movzx eax, [rbp+var_10A0]"], [35, "mov [rbp+var_104A], ax"], [36, "mov [rbp+var_103D], 10h"], [37, "mov eax, [rbp+var_10AC]"], [38, "mov [rbp+var_1048], eax"], [39, "mov eax, [rbp+netlong]"], [40, "mov edi, eax"], [41, "call _ntohl"], [42, "add eax, 3E8h"], [43, "mov edi, eax"], [44, "call _htonl"], [45, "mov [rbp+var_1044], eax"], [46, "mov eax, [rbp+netlong]"], [47, "mov [rbp+var_1044], eax"], [48, "movzx eax, [rbp+var_10B4]"], [49, "mov [rbp+var_1050], al"], [50, "mov rax, 15A6DD5C89F91213h"], [51, "mov rdx, 44332211933E8312h"], [52, "mov [rbp+var_1090], rax"], [53, "mov [rbp+var_1088], rdx"], [54, "mov [rbp+var_1080], 1016655h"], [55, "mov rax, [rbp+var_1090]"], [56, "mov rdx, [rbp+var_1088]"], [57, "mov [rbp+var_1039], rax"], [58, "mov [rbp+var_1031], rdx"], [59, "mov eax, [rbp+var_1080]"], [60, "mov [rbp+var_1029], eax"], [61, "mov [rbp+var_1011], 14h"], [62, "mov eax, [rbp+arg_0]"], [63, "mov [rbp+var_10], ax"], [64, "mov [rbp+var_4], 0"], [65, "jmp short loc_4139E1"], [66, "mov eax, [rbp+var_4]"], [67, "cdqe"], [68, "mov [rbp+rax+var_1010], 2Eh "], [69, "add [rbp+var_4], 1"], [70, "mov eax, [rbp+var_4]"], [71, "cmp eax, [rbp+arg_0]"], [72, "jl short loc_4139D0"], [73, "lea rax, [rbp+s]"], [74, "mov rdi, rax"], [75, "call sub_407CE9"], [76, "nop"], [77, "leave"], [78, "retn"]], "data_dep": [[10, 9], [11, 5], [12, 8], [13, 12], [14, 12], [17, 14], [19, 3], [20, 18], [22, 19], [23, 20], [25, 4], [26, 21], [27, 19], [27, 26], [29, 25], [30, 27], [32, 10], [33, 32], [34, 11], [35, 34], [37, 6], [38, 37], [39, 7], [40, 39], [42, 41], [43, 42], [45, 44], [46, 7], [47, 46], [48, 13], [49, 48], [52, 50], [53, 51], [55, 52], [56, 53], [57, 55], [58, 56], [59, 54], [60, 59], [63, 62], [66, 69], [66, 64], [68, 66], [69, 64], [69, 69], [70, 64], [70, 69], [71, 70], [72, 71], [73, 70], [74, 73], [78, 75]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_413861", "query": "\n\n\nint __fastcall sub_413861(const char *a1, __int16 a2, const char *a3, __int16 a4, int a5, uint32_t a6, int a7, char a8)\n{\nuint32_t v8; // eax\nchar s[16]; // [rsp+50h] [rbp-1070h] BYREF\nchar v15[20]; // [rsp+60h] [rbp-1060h] BYREF\n__int16 v16; // [rsp+74h] [rbp-104Ch]\n__int16 v17; // [rsp+76h] [rbp-104Ah]\nint v18; // [rsp+78h] [rbp-1048h]\nuint32_t v19; // [rsp+7Ch] [rbp-1044h]\nchar v20; // [rsp+83h] [rbp-103Dh]\n__int64 v21; // [rsp+87h] [rbp-1039h]\n__int64 v22; // [rsp+8Fh] [rbp-1031h]\nint v23; // [rsp+97h] [rbp-1029h]\nchar v24; // [rsp+AFh] [rbp-1011h]\nchar v25[4096]; // [rsp+B0h] [rbp-1010h]\n__int16 v26; // [rsp+10B0h] [rbp-10h]\nint i; // [rsp+10BCh] [rbp-4h]\n\nmemset(s, 0, 0x1064uLL);\nstrncpy(s, a1, 0x10uLL);\nstrncpy(v15, a3, 0x10uLL);\nv16 = a2;\nv17 = a4;\nv20 = 16;\nv18 = a5;\nv8 = ntohl(a6);\nhtonl(v8 + 1000);\nv19 = a6;\nv15[16] = a8;\nv21 = 0x15A6DD5C89F91213LL;\nv22 = 0x44332211933E8312LL;\nv23 = 16868949;\nv24 = 20;\nv26 = a7;\nfor ( i = 0; i < a7; ++i )\nv25[i] = 46;\nreturn sub_407CE9((__int64)s);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,s,sub_413861,sub_407CE9,]", "hints": "[]", "response": "{'a3': 'dst_ip', 'a4': 'dst_port', 'a1': 'src_ip', 'a2': 'src_port', 'a5': 'seq_num', 'a6': 'ack_num', 'a7': 'len', 'a8': 'ttl', 's': 'vars', 'sub_413861': 'send_junk_data_super_0', 'sub_407CE9': 'send_tcp'}"} | [
[
0.8035043478012085,
0.7892112731933594,
0.7740386128425598,
0.7612645626068115,
0.7478188276290894,
0.747226893901825,
0.743625819683075,
0.7424841523170471,
0.7386130094528198,
0.7378073930740356,
0.7353823184967041,
0.7343934178352356,
0.7305160760879517,
0.7287124991416931,
0.7285575270652771,
0.7280078530311584,
0.7272112369537354,
0.7142419219017029,
0.7133300304412842,
0.7122355699539185
],
[
73124,
145904,
167885,
244531,
229090,
69447,
44671,
128541,
259604,
206207,
153977,
23684,
115314,
192995,
136531,
248849,
214908,
218248,
133020,
106417
]
] |
|
COM_FileBase | 3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f | yquake2 | yquake2 | NA | void
COM_FileBase(char *in, char *out)
{
char *s, *s2;
s = in + strlen(in) - 1;
while (s != in && *s != '.')
{
s--;
}
for (s2 = s; s2 != in && *s2 != '/'; s2--)
{
}
if (s - s2 < 2)
{
out[0] = 0;
}
else
{
s--;
memcpy(out, s2 + 1, s - s2);
out[s - s2] = 0;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_479F60", "function_addr": 4693856, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "sub rsp, 28h"], [1, "mov [rsp+28h+s], rdi"], [2, "mov [rsp+28h+dest], rsi"], [3, "mov rax, [rsp+28h+s]"], [4, "mov rdi, rax"], [5, "call _strlen"], [6, "lea rdx, [rax-1]"], [7, "mov rax, [rsp+28h+s]"], [8, "add rax, rdx"], [9, "mov [rsp+28h+var_10], rax"], [10, "jmp short loc_479F93"], [11, "sub [rsp+28h+var_10], 1"], [12, "mov rax, [rsp+28h+var_10]"], [13, "cmp rax, [rsp+28h+s]"], [14, "jz short loc_479FAB"], [15, "mov rax, [rsp+28h+var_10]"], [16, "movzx eax, byte ptr [rax]"], [17, "cmp al, 2Eh "], [18, "jnz short loc_479F8D"], [19, "mov rax, [rsp+28h+var_10]"], [20, "mov [rsp+28h+var_18], rax"], [21, "jmp short loc_479FBD"], [22, "sub [rsp+28h+var_18], 1"], [23, "mov rax, [rsp+28h+var_18]"], [24, "cmp rax, [rsp+28h+s]"], [25, "jz short loc_479FD5"], [26, "mov rax, [rsp+28h+var_18]"], [27, "movzx eax, byte ptr [rax]"], [28, "cmp al, 2Fh "], [29, "jnz short loc_479FB7"], [30, "mov rax, [rsp+28h+var_10]"], [31, "sub rax, [rsp+28h+var_18]"], [32, "cmp rax, 1"], [33, "jg short loc_479FEE"], [34, "mov rax, [rsp+28h+dest]"], [35, "mov byte ptr [rax], 0"], [36, "jmp short loc_47A030"], [37, "sub [rsp+28h+var_10], 1"], [38, "mov rax, [rsp+28h+var_10]"], [39, "sub rax, [rsp+28h+var_18]"], [40, "mov rdx, rax"], [41, "mov rax, [rsp+28h+var_18]"], [42, "lea rcx, [rax+1]"], [43, "mov rax, [rsp+28h+dest]"], [44, "mov rsi, rcx"], [45, "mov rdi, rax"], [46, "call _memcpy"], [47, "mov rax, [rsp+28h+var_10]"], [48, "sub rax, [rsp+28h+var_18]"], [49, "mov rdx, rax"], [50, "mov rax, [rsp+28h+dest]"], [51, "add rax, rdx"], [52, "mov byte ptr [rax], 0"], [53, "nop"], [54, "add rsp, 28h"], [55, "retn"]], "data_dep": [[3, 1], [4, 3], [6, 5], [7, 1], [8, 6], [8, 7], [9, 8], [11, 11], [11, 9], [12, 9], [12, 11], [13, 1], [13, 12], [14, 13], [15, 11], [15, 9], [16, 15], [17, 16], [18, 17], [19, 9], [19, 11], [20, 19], [22, 20], [22, 22], [23, 22], [23, 20], [24, 23], [24, 1], [25, 24], [26, 20], [26, 22], [27, 26], [28, 27], [29, 28], [30, 9], [30, 11], [31, 20], [31, 22], [31, 30], [32, 31], [33, 32], [34, 2], [35, 34], [37, 9], [37, 11], [38, 37], [39, 20], [39, 38], [39, 22], [40, 39], [41, 20], [41, 22], [42, 41], [43, 2], [44, 42], [45, 43], [47, 37], [48, 20], [48, 47], [48, 22], [49, 48], [50, 2], [51, 50], [51, 49], [52, 51], [54, 0], [55, 34], [55, 51]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_479F60", "query": "\n\n\n_BYTE *__fastcall sub_479F60(const char *a1, _BYTE *a2)\n{\n_BYTE *result; // rax\nconst char *j; // [rsp+10h] [rbp-18h]\nconst char *i; // [rsp+18h] [rbp-10h]\nconst char *v5; // [rsp+18h] [rbp-10h]\n\nfor ( i = &a1[strlen(a1) - 1]; i != a1 && *i != 46; --i )\n;\nfor ( j = i; j != a1 && *j != 47; --j )\n;\nif ( i - j > 1 )\n{\nv5 = i - 1;\nmemcpy(a2, j + 1, v5 - j);\nresult = &a2[v5 - j];\n*result = 0;\n}\nelse\n{\nresult = a2;\n*a2 = 0;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,j,i,sub_479F60,]", "hints": "[]", "response": "{'a1': 'in', 'a2': 'out', 'j': 's2', 'i': 'sa', 'sub_479F60': 'COM_FileBase'}"} | [
[
0.8534449338912964,
0.852758526802063,
0.8421943783760071,
0.8412818908691406,
0.8184765577316284,
0.8140173554420471,
0.796161413192749,
0.7871624231338501,
0.7682347893714905,
0.7669069170951843,
0.7620841264724731,
0.761968731880188,
0.7583743333816528,
0.7487621903419495,
0.7467607259750366,
0.7463316917419434,
0.7457242012023926,
0.7426844835281372,
0.7400406002998352,
0.7379379868507385
],
[
113101,
131581,
35818,
225089,
171545,
244521,
55189,
42299,
177720,
15713,
188808,
93661,
178177,
22440,
245200,
182379,
174539,
184650,
211071,
155214
]
] |
|
m_setitem | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_setitem(bvm *vm)
{
be_getmember(vm, 1, ".p");
list_check_data(vm, 3);
be_pushvalue(vm, 2);
be_pushvalue(vm, 3);
if (!be_setindex(vm, -3)) {
be_raise(vm, "index_error", "list assignment index out of range");
}
be_return_nil(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_419CEB", "function_addr": 4300011, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, [rbp+var_8]"], [5, "mov edx, offset aP_3"], [6, "mov esi, 1"], [7, "mov rdi, rax"], [8, "call be_getmember"], [9, "mov rax, [rbp+var_8]"], [10, "mov esi, 0FFFFFFFFh"], [11, "mov rdi, rax"], [12, "call be_islist"], [13, "xor eax, 1"], [14, "test al, al"], [15, "jnz short loc_419D36"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdi, rax"], [18, "call be_top"], [19, "cmp eax, 3"], [20, "jg short loc_419D44"], [21, "mov rax, [rbp+var_8]"], [22, "mov rdi, rax"], [23, "call be_returnnilvalue"], [24, "jmp short locret_419DA0"], [25, "mov rax, [rbp+var_8]"], [26, "mov esi, 2"], [27, "mov rdi, rax"], [28, "call be_pushvalue"], [29, "mov rax, [rbp+var_8]"], [30, "mov esi, 3"], [31, "mov rdi, rax"], [32, "call be_pushvalue"], [33, "mov rax, [rbp+var_8]"], [34, "mov esi, 0FFFFFFFDh"], [35, "mov rdi, rax"], [36, "call be_setindex"], [37, "xor eax, 1"], [38, "test al, al"], [39, "jz short loc_419D94"], [40, "mov rax, [rbp+var_8]"], [41, "mov edx, offset aListAssignment"], [42, "mov esi, offset aIndexError_1"], [43, "mov rdi, rax"], [44, "call be_raise"], [45, "mov rax, [rbp+var_8]"], [46, "mov rdi, rax"], [47, "call be_returnnilvalue"], [48, "leave"], [49, "retn"]], "data_dep": [[4, 3], [7, 4], [9, 3], [11, 9], [13, 12], [14, 13], [15, 14], [16, 3], [17, 16], [19, 18], [20, 19], [21, 3], [22, 21], [25, 3], [27, 25], [29, 3], [31, 29], [33, 3], [35, 33], [37, 36], [38, 37], [39, 38], [40, 3], [43, 40], [45, 3], [46, 45], [49, 23], [49, 47]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_419CEB", "query": "\n\n\n__int64 __fastcall sub_419CEB(__int64 a1)\n{\nbe_getmember(a1, 1u, (__int64)\".p\");\nif ( be_islist(a1, 0xFFFFFFFF) && (int)be_top(a1) > 3 )\n{\nbe_pushvalue(a1, 2u);\nbe_pushvalue(a1, 3u);\nif ( (unsigned __int8)be_setindex(a1, 0xFFFFFFFD) != 1 )\nbe_raise(a1, (__int64)\"index_error\", (__int64)\"list assignment index out of range\");\n}\nreturn be_returnnilvalue(a1);\n}\n\n\n\nQ:[a1,sub_419CEB,]", "hints": "[]", "response": "{'a1': 'vm', 'sub_419CEB': 'm_setitem_0'}"} | [
[
0.8618000745773315,
0.8299994468688965,
0.8114562034606934,
0.804358720779419,
0.7859612703323364,
0.7791288495063782,
0.7779995203018188,
0.7742886543273926,
0.7703776359558105,
0.7580646276473999,
0.7555839419364929,
0.755560040473938,
0.7550908327102661,
0.7516800165176392,
0.7490789294242859,
0.7419352531433105,
0.7392721176147461,
0.7321944236755371,
0.7285870313644409,
0.7280445098876953
],
[
146305,
156484,
112406,
110380,
125617,
124601,
139869,
86189,
73804,
205257,
152339,
71724,
22938,
142804,
122492,
234182,
256536,
171576,
169289,
191110
]
] |
|
uf_sort_bubble | 0f6640f058f7210cea32f17315b0da73f3f15f517accfaff7b8b24fee4bf00d4 | QuentinPerez | 42-toolkit | NA | void uf_sort_bubble(int *begin, size_t size)
{
size_t x;
size_t y;
int tmp;
x = 0;
while (x < size)
{
y = 0;
while (y < size - 1)
{
if (begin[y] > begin[y + 1])
{
tmp = begin[y];
begin[y] = begin[y + 1];
begin[y + 1] = tmp;
}
y = y + 1;
}
x = x + 1;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4016CE", "function_addr": 4200142, "binary_name": "0f6640f058f7210cea32f17315b0da73f3f15f517accfaff7b8b24fee4bf00d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_8], 0"], [5, "jmp loc_4017A4"], [6, "mov [rbp+var_10], 0"], [7, "jmp loc_40178D"], [8, "mov rax, [rbp+var_10]"], [9, "lea rdx, ds:0[rax*4]"], [10, "mov rax, [rbp+var_28]"], [11, "add rax, rdx"], [12, "mov edx, [rax]"], [13, "mov rax, [rbp+var_10]"], [14, "add rax, 1"], [15, "lea rcx, ds:0[rax*4]"], [16, "mov rax, [rbp+var_28]"], [17, "add rax, rcx"], [18, "mov eax, [rax]"], [19, "cmp edx, eax"], [20, "jle short loc_401788"], [21, "mov rax, [rbp+var_10]"], [22, "lea rdx, ds:0[rax*4]"], [23, "mov rax, [rbp+var_28]"], [24, "add rax, rdx"], [25, "mov eax, [rax]"], [26, "mov [rbp+var_14], eax"], [27, "mov rax, [rbp+var_10]"], [28, "add rax, 1"], [29, "lea rdx, ds:0[rax*4]"], [30, "mov rax, [rbp+var_28]"], [31, "add rax, rdx"], [32, "mov rdx, [rbp+var_10]"], [33, "lea rcx, ds:0[rdx*4]"], [34, "mov rdx, [rbp+var_28]"], [35, "add rdx, rcx"], [36, "mov eax, [rax]"], [37, "mov [rdx], eax"], [38, "mov rax, [rbp+var_10]"], [39, "add rax, 1"], [40, "lea rdx, ds:0[rax*4]"], [41, "mov rax, [rbp+var_28]"], [42, "add rdx, rax"], [43, "mov eax, [rbp+var_14]"], [44, "mov [rdx], eax"], [45, "add [rbp+var_10], 1"], [46, "mov rax, [rbp+var_30]"], [47, "sub rax, 1"], [48, "cmp [rbp+var_10], rax"], [49, "jb loc_4016F4"], [50, "add [rbp+var_8], 1"], [51, "mov rax, [rbp+var_8]"], [52, "cmp rax, [rbp+var_30]"], [53, "jb loc_4016E7"], [54, "nop"], [55, "nop"], [56, "pop rbp"], [57, "retn"]], "data_dep": [[8, 45], [8, 6], [9, 12], [9, 42], [10, 2], [11, 9], [11, 10], [12, 37], [12, 44], [12, 11], [13, 45], [13, 6], [14, 13], [15, 15], [15, 33], [16, 2], [17, 16], [17, 15], [18, 17], [18, 44], [18, 37], [19, 18], [19, 12], [20, 19], [21, 45], [21, 6], [22, 12], [23, 2], [24, 23], [24, 22], [25, 24], [25, 44], [25, 37], [26, 25], [27, 6], [27, 45], [28, 27], [29, 22], [30, 2], [31, 29], [31, 30], [32, 6], [32, 45], [33, 15], [34, 2], [35, 33], [35, 34], [36, 31], [36, 44], [36, 37], [37, 35], [37, 36], [38, 45], [38, 6], [39, 38], [40, 35], [41, 2], [42, 41], [42, 40], [43, 26], [44, 42], [44, 43], [45, 6], [45, 45], [46, 3], [47, 46], [48, 45], [48, 47], [48, 6], [49, 48], [50, 50], [50, 4], [51, 50], [51, 4], [52, 51], [52, 3], [53, 52], [56, 0], [57, 51]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0f6640f058f7210cea32f17315b0da73f3f15f517accfaff7b8b24fee4bf00d4_0f6640f058f7210cea32f17315b0da73f3f15f517accfaff7b8b24fee4bf00d4.jsonl.gz", "strip_func_name": "sub_4016CE", "query": "\n\n\nunsigned __int64 __fastcall sub_4016CE(__int64 a1, unsigned __int64 a2)\n{\nunsigned __int64 result; // rax\nint v3; // [rsp+1Ch] [rbp-14h]\nunsigned __int64 j; // [rsp+20h] [rbp-10h]\nunsigned __int64 i; // [rsp+28h] [rbp-8h]\n\nfor ( i = 0LL; ; ++i )\n{\nresult = i;\nif ( i >= a2 )\nbreak;\nfor ( j = 0LL; j < a2 - 1; ++j )\n{\nif ( *(_DWORD *)(4 * j + a1) > *(_DWORD *)(4 * (j + 1) + a1) )\n{\nv3 = *(_DWORD *)(4 * j + a1);\n*(_DWORD *)(4 * j + a1) = *(_DWORD *)(4 * (j + 1) + a1);\n*(_DWORD *)(a1 + 4 * (j + 1)) = v3;\n}\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,j,i,sub_4016CE,]", "hints": "[]", "response": "{'a1': 'begin', 'a2': 'size', 'v3': 'tmp', 'j': 'y', 'i': 'x', 'sub_4016CE': 'uf_sort_bubble'}"} | [
[
0.7698681950569153,
0.7468805909156799,
0.7450417280197144,
0.7399036884307861,
0.7357821464538574,
0.7185343503952026,
0.7133450508117676,
0.7121787071228027,
0.7097967863082886,
0.7055376172065735,
0.7028205990791321,
0.7004866600036621,
0.7000972628593445,
0.6998957395553589,
0.6982170939445496,
0.6964915990829468,
0.6939570903778076,
0.6938446164131165,
0.6907064318656921,
0.6894834637641907
],
[
136986,
57167,
201350,
130331,
8022,
51148,
173802,
135511,
104138,
165033,
255354,
40301,
34315,
259953,
75832,
156599,
29342,
134836,
175090,
108594
]
] |
|
str_to_longlong | 89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6 | Tachone | Tachftp | NA | long long str_to_longlong(const char *str)
{
//return atoll(str);
/* long long result = 0;
long long mult = 1;
unsigned int len = strlen(str);
unsigned int i;
if (len > 15)
return 0;
for (i=0; i<len; i++)
{
char ch = str[len-(i+1)];
long long val;
if (ch < '0' || ch > '9')
return 0;
val = ch - '0';
val *= mult;
result += val;
mult *= 10;
}
*/
long long result = 0;
long long mult = 1;
unsigned int len = strlen(str);
int i;
if (len > 15)
return 0;
for (i=len-1; i>=0; i--)
{
char ch = str[i];
long long val;
if (ch < '0' || ch > '9')
return 0;
val = ch - '0';
val *= mult;
result += val;
mult *= 10;
}
return result;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4070C3", "function_addr": 4223171, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_8], 0"], [5, "mov [rbp+var_10], 1"], [6, "mov rax, [rbp+s]"], [7, "mov rdi, rax"], [8, "call _strlen"], [9, "mov [rbp+var_18], eax"], [10, "cmp [rbp+var_18], 0Fh"], [11, "jbe short loc_4070FB"], [12, "mov eax, 0"], [13, "jmp short locret_407171"], [14, "mov eax, [rbp+var_18]"], [15, "sub eax, 1"], [16, "mov [rbp+var_14], eax"], [17, "jmp short loc_407167"], [18, "mov eax, [rbp+var_14]"], [19, "movsxd rdx, eax"], [20, "mov rax, [rbp+s]"], [21, "add rax, rdx"], [22, "movzx eax, byte ptr [rax]"], [23, "mov [rbp+var_19], al"], [24, "cmp [rbp+var_19], 2Fh "], [25, "jle short loc_407125"], [26, "cmp [rbp+var_19], 39h "], [27, "jle short loc_40712C"], [28, "mov eax, 0"], [29, "jmp short locret_407171"], [30, "movsx eax, [rbp+var_19]"], [31, "sub eax, 30h "], [32, "cdqe"], [33, "mov [rbp+var_28], rax"], [34, "mov rax, [rbp+var_28]"], [35, "imul rax, [rbp+var_10]"], [36, "mov [rbp+var_28], rax"], [37, "mov rax, [rbp+var_28]"], [38, "add [rbp+var_8], rax"], [39, "mov rdx, [rbp+var_10]"], [40, "mov rax, rdx"], [41, "shl rax, 2"], [42, "add rax, rdx"], [43, "add rax, rax"], [44, "mov [rbp+var_10], rax"], [45, "sub [rbp+var_14], 1"], [46, "cmp [rbp+var_14], 0"], [47, "jns short loc_407106"], [48, "mov rax, [rbp+var_8]"], [49, "leave"], [50, "retn"]], "data_dep": [[6, 3], [7, 6], [9, 8], [10, 9], [11, 10], [14, 9], [15, 14], [16, 15], [18, 16], [18, 45], [19, 18], [20, 3], [21, 19], [21, 20], [22, 21], [23, 22], [24, 23], [25, 24], [26, 23], [27, 26], [30, 23], [31, 30], [33, 31], [34, 33], [35, 5], [35, 44], [35, 34], [36, 35], [37, 36], [38, 38], [38, 4], [38, 37], [39, 5], [39, 44], [40, 39], [41, 40], [42, 39], [42, 41], [43, 42], [44, 43], [45, 16], [45, 45], [46, 45], [46, 16], [47, 46], [48, 38], [48, 4], [50, 12], [50, 48], [50, 28]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_4070C3", "query": "\n\n\n__int64 __fastcall sub_4070C3(const char *a1)\n{\nchar v2; // [rsp+27h] [rbp-19h]\nunsigned int v3; // [rsp+28h] [rbp-18h]\nint i; // [rsp+2Ch] [rbp-14h]\n__int64 v5; // [rsp+30h] [rbp-10h]\n__int64 v6; // [rsp+38h] [rbp-8h]\n\nv6 = 0LL;\nv5 = 1LL;\nv3 = strlen(a1);\nif ( v3 > 0xF )\nreturn 0LL;\nfor ( i = v3 - 1; i >= 0; --i )\n{\nv2 = a1[i];\nif ( v2 <= 47 || v2 > 57 )\nreturn 0LL;\nv6 += v5 * (v2 - 48);\nv5 *= 10LL;\n}\nreturn v6;\n}\n\n\n\nQ:[a1,v2,v3,v5,v6,sub_4070C3,]", "hints": "[]", "response": "{'a1': 'str', 'v2': 'ch_0', 'v3': 'len', 'v5': 'mult', 'v6': 'result', 'sub_4070C3': 'str_to_longlong'}"} | [
[
0.7795964479446411,
0.774276614189148,
0.764079213142395,
0.7620025277137756,
0.7569279670715332,
0.7543513774871826,
0.749579131603241,
0.7489741444587708,
0.7471994161605835,
0.740678071975708,
0.7378011345863342,
0.7376227378845215,
0.729682445526123,
0.7265265583992004,
0.7255107760429382,
0.7223473191261292,
0.7210090160369873,
0.7203924655914307,
0.7203001976013184,
0.7200435400009155
],
[
246465,
209020,
10348,
69929,
25268,
188487,
147985,
40673,
210062,
107930,
186221,
153400,
97946,
169393,
77674,
160146,
147272,
54826,
51830,
94066
]
] |
|
send_fake_SYN_ACK | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | void send_fake_SYN_ACK(struct mypacket *orig_packet, unsigned int flags)
{
char sip[16], dip[16];
unsigned short sport, dport;
unsigned int seq_num, ack_num;
struct send_tcp_vars vars = {};
struct in_addr s_in_addr = {orig_packet->iphdr->saddr};
struct in_addr d_in_addr = {orig_packet->iphdr->daddr};
strncpy(sip, inet_ntoa(s_in_addr), 16);
strncpy(dip, inet_ntoa(d_in_addr), 16);
sport = ntohs(orig_packet->tcphdr->th_sport);
dport = ntohs(orig_packet->tcphdr->th_dport);
seq_num = ntohl(orig_packet->tcphdr->th_seq);
ack_num = ntohl(orig_packet->tcphdr->th_ack);
memset(&vars, 0, sizeof vars);
strncpy(vars.src_ip, sip, 16);
strncpy(vars.dst_ip, dip, 16);
vars.src_port = sport;
vars.dst_port = dport;
vars.flags = TCP_SYN | TCP_ACK;
vars.seq_num = rand();
vars.ack_num = rand();
// mss (aliyun discards SYN without mss option header)
//u_char bytes[4] = {0x02, 0x04, 0x05, 0xb4};
//memcpy(vars.tcp_opt, bytes, 4);
//vars.tcp_opt_len = 4;
// copy the tcp option header to the insertion packet
char *tcp_opt = (char*)orig_packet->tcphdr + 20;
unsigned char tcp_opt_len = orig_packet->tcphdr->th_off * 4 - 20;
memcpy(vars.tcp_opt, tcp_opt, tcp_opt_len);
vars.tcp_opt_len = tcp_opt_len;
send_insertion_packet(&vars, flags);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_411E4B", "function_addr": 4267595, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10D0h"], [3, "mov [rbp+var_10C8], rdi"], [4, "mov [rbp+var_10CC], esi"], [5, "lea rdx, [rbp+s]"], [6, "mov eax, 0"], [7, "mov ecx, 20Ch"], [8, "mov rdi, rdx"], [9, "rep stosq"], [10, "mov rdx, rdi"], [11, "mov [rdx], eax"], [12, "add rdx, 4"], [13, "mov rax, [rbp+var_10C8]"], [14, "mov rax, [rax+10h]"], [15, "mov eax, [rax+0Ch]"], [16, "mov [rbp+in.s_addr], eax"], [17, "mov rax, [rbp+var_10C8]"], [18, "mov rax, [rax+10h]"], [19, "mov eax, [rax+10h]"], [20, "mov [rbp+var_10B8.s_addr], eax"], [21, "mov eax, [rbp+in.s_addr]"], [22, "mov edi, eax"], [23, "call _inet_ntoa"], [24, "mov rcx, rax"], [25, "lea rax, [rbp+dest]"], [26, "mov edx, 10h"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _strncpy"], [30, "mov eax, [rbp+var_10B8.s_addr]"], [31, "mov edi, eax"], [32, "call _inet_ntoa"], [33, "mov rcx, rax"], [34, "lea rax, [rbp+src]"], [35, "mov edx, 10h"], [36, "mov rsi, rcx"], [37, "mov rdi, rax"], [38, "call _strncpy"], [39, "mov rax, [rbp+var_10C8]"], [40, "mov rax, [rax+18h]"], [41, "movzx eax, word ptr [rax]"], [42, "movzx eax, ax"], [43, "mov edi, eax"], [44, "call _ntohs"], [45, "mov [rbp+var_2], ax"], [46, "mov rax, [rbp+var_10C8]"], [47, "mov rax, [rax+18h]"], [48, "movzx eax, word ptr [rax+2]"], [49, "movzx eax, ax"], [50, "mov edi, eax"], [51, "call _ntohs"], [52, "mov [rbp+var_4], ax"], [53, "mov rax, [rbp+var_10C8]"], [54, "mov rax, [rax+18h]"], [55, "mov eax, [rax+4]"], [56, "mov edi, eax"], [57, "call _ntohl"], [58, "mov [rbp+var_8], eax"], [59, "mov rax, [rbp+var_10C8]"], [60, "mov rax, [rax+18h]"], [61, "mov eax, [rax+8]"], [62, "mov edi, eax"], [63, "call _ntohl"], [64, "mov [rbp+var_C], eax"], [65, "lea rax, [rbp+s]"], [66, "mov edx, 1064h"], [67, "mov esi, 0"], [68, "mov rdi, rax"], [69, "call _memset"], [70, "lea rcx, [rbp+dest]"], [71, "lea rax, [rbp+s]"], [72, "mov edx, 10h"], [73, "mov rsi, rcx"], [74, "mov rdi, rax"], [75, "call _strncpy"], [76, "lea rax, [rbp+src]"], [77, "lea rdx, [rbp+s]"], [78, "lea rcx, [rdx+10h]"], [79, "mov edx, 10h"], [80, "mov rsi, rax"], [81, "mov rdi, rcx"], [82, "call _strncpy"], [83, "movzx eax, [rbp+var_2]"], [84, "mov [rbp+var_108C], ax"], [85, "movzx eax, [rbp+var_4]"], [86, "mov [rbp+var_108A], ax"], [87, "mov [rbp+var_107D], 12h"], [88, "call _rand"], [89, "mov [rbp+var_1088], eax"], [90, "call _rand"], [91, "mov [rbp+var_1084], eax"], [92, "mov rax, [rbp+var_10C8]"], [93, "mov rax, [rax+18h]"], [94, "add rax, 14h"], [95, "mov [rbp+var_18], rax"], [96, "mov rax, [rbp+var_10C8]"], [97, "mov rax, [rax+18h]"], [98, "movzx eax, byte ptr [rax+0Ch]"], [99, "shr al, 4"], [100, "movzx eax, al"], [101, "sub eax, 5"], [102, "shl eax, 2"], [103, "mov [rbp+var_19], al"], [104, "movzx edx, [rbp+var_19]"], [105, "mov rax, [rbp+var_18]"], [106, "lea rcx, [rbp+s]"], [107, "add rcx, 37h "], [108, "mov rsi, rax"], [109, "mov rdi, rcx"], [110, "call _memcpy"], [111, "movzx eax, [rbp+var_19]"], [112, "mov [rbp+var_1051], al"], [113, "mov edx, [rbp+var_10CC]"], [114, "lea rax, [rbp+s]"], [115, "mov esi, edx"], [116, "mov rdi, rax"], [117, "call sub_41146E"], [118, "nop"], [119, "leave"], [120, "retn"]], "data_dep": [[8, 5], [10, 8], [11, 6], [11, 10], [12, 10], [13, 3], [14, 13], [14, 11], [15, 14], [15, 11], [16, 15], [17, 3], [18, 17], [18, 11], [19, 18], [19, 11], [20, 19], [21, 16], [22, 21], [24, 23], [25, 23], [27, 24], [28, 25], [30, 20], [31, 30], [33, 32], [34, 32], [36, 33], [37, 34], [39, 3], [40, 39], [40, 11], [41, 40], [41, 11], [42, 41], [43, 42], [45, 44], [46, 3], [47, 11], [47, 46], [48, 47], [48, 11], [49, 48], [50, 49], [52, 51], [53, 3], [54, 53], [54, 11], [55, 11], [55, 54], [56, 55], [58, 57], [59, 3], [60, 11], [60, 59], [61, 60], [61, 11], [62, 61], [64, 63], [65, 63], [68, 65], [70, 33], [71, 69], [73, 70], [74, 71], [76, 75], [77, 72], [78, 77], [78, 70], [78, 11], [80, 76], [81, 78], [83, 45], [84, 83], [85, 52], [86, 85], [89, 88], [91, 90], [92, 3], [93, 92], [93, 11], [94, 93], [95, 94], [96, 3], [97, 96], [97, 11], [98, 11], [98, 97], [99, 98], [100, 99], [101, 100], [102, 101], [103, 102], [104, 103], [105, 95], [106, 78], [107, 106], [108, 105], [109, 107], [111, 103], [112, 111], [113, 4], [114, 111], [115, 113], [116, 114], [120, 117]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_411E4B", "query": "\n\n\nint __fastcall sub_411E4B(__int64 a1, char a2)\n{\nchar *v2; // rax\nchar *v3; // rax\nstruct in_addr v5; // [rsp+18h] [rbp-10B8h]\nint s[1052]; // [rsp+20h] [rbp-10B0h] BYREF\nchar src[16]; // [rsp+1090h] [rbp-40h] BYREF\nchar dest[23]; // [rsp+10A0h] [rbp-30h] BYREF\nunsigned __int8 v9; // [rsp+10B7h] [rbp-19h]\nvoid *v10; // [rsp+10B8h] [rbp-18h]\nuint32_t v11; // [rsp+10C4h] [rbp-Ch]\nuint32_t v12; // [rsp+10C8h] [rbp-8h]\nuint16_t v13; // [rsp+10CCh] [rbp-4h]\nuint16_t v14; // [rsp+10CEh] [rbp-2h]\n\nmemset(s, 0, 0x1060uLL);\ns[1048] = 0;\nv5.s_addr = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 16LL);\nv2 = inet_ntoa(*(struct in_addr *)(*(_QWORD *)(a1 + 16) + 12LL));\nstrncpy(dest, v2, 0x10uLL);\nv3 = inet_ntoa(v5);\nstrncpy(src, v3, 0x10uLL);\nv14 = ntohs(**(_WORD **)(a1 + 24));\nv13 = ntohs(*(_WORD *)(*(_QWORD *)(a1 + 24) + 2LL));\nv12 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL));\nv11 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL));\nmemset(s, 0, 0x1064uLL);\nstrncpy((char *)s, dest, 0x10uLL);\nstrncpy((char *)&s[4], src, 0x10uLL);\nLOWORD(s[9]) = v14;\nHIWORD(s[9]) = v13;\nHIBYTE(s[12]) = 18;\ns[10] = rand();\ns[11] = rand();\nv10 = (void *)(*(_QWORD *)(a1 + 24) + 20LL);\nv9 = 4 * ((*(_BYTE *)(*(_QWORD *)(a1 + 24) + 12LL) >> 4) - 5);\nmemcpy((char *)&s[13] + 3, v10, v9);\nHIBYTE(s[23]) = v9;\nreturn sub_41146E((__int64)s, a2);\n}\n\n\n\nQ:[a1,a2,v5,s,src,dest,v9,v10,v11,v12,v13,v14,sub_411E4B,sub_41146E,]", "hints": "[]", "response": "{'a1': 'orig_packet', 'a2': 'flags', 'v5': 'd_in_addr', 's': 'vars', 'src': 'dip', 'dest': 'sip', 'v9': 'tcp_opt_len', 'v10': 'tcp_opt', 'v11': 'ack_num', 'v12': 'seq_num', 'v13': 'dport', 'v14': 'sport', 'sub_411E4B': 'send_fake_SYN_ACK_0', 'sub_41146E': 'send_insertion_packet'}"} | [
[
0.7623652815818787,
0.7390574216842651,
0.7338836789131165,
0.7254816293716431,
0.7126245498657227,
0.7031673192977905,
0.7023279070854187,
0.6998670101165771,
0.698918879032135,
0.6986671686172485,
0.6901000738143921,
0.6821773648262024,
0.6771029829978943,
0.6755617260932922,
0.6748867034912109,
0.673994243144989,
0.6730316877365112,
0.6727046966552734,
0.6716464757919312,
0.669503927230835
],
[
210631,
150537,
118856,
193477,
163817,
47776,
150355,
4576,
63563,
241188,
146142,
4449,
244619,
170406,
204094,
245548,
257553,
82308,
83922,
19392
]
] |
|
to_string | 8091fb888db0eac0604502a61c8da6fb943b602d83b1accdd62b91f233f945b0 | leahneukirchen | obase | NA | void
to_string(struct val *vp)
{
char *tmp;
if (vp->type == string)
return;
if (asprintf(&tmp, "%d", vp->u.i) == -1)
err(3, NULL);
vp->type = string;
vp->u.s = tmp;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40145F", "function_addr": 4199519, "binary_name": "8091fb888db0eac0604502a61c8da6fb943b602d83b1accdd62b91f233f945b0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, [rbp+var_18]"], [5, "mov eax, [rax]"], [6, "cmp eax, 1"], [7, "jz short loc_4014C4"], [8, "mov rax, [rbp+var_18]"], [9, "mov edx, [rax+8]"], [10, "lea rax, [rbp+ptr]"], [11, "mov esi, offset fmt"], [12, "mov rdi, rax"], [13, "mov eax, 0"], [14, "call _asprintf"], [15, "cmp eax, 0FFFFFFFFh"], [16, "jnz short loc_4014AC"], [17, "mov esi, 0"], [18, "mov edi, 3"], [19, "mov eax, 0"], [20, "call _err"], [21, "mov rax, [rbp+var_18]"], [22, "mov dword ptr [rax], 1"], [23, "mov rdx, [rbp+ptr]"], [24, "mov rax, [rbp+var_18]"], [25, "mov [rax+8], rdx"], [26, "jmp short locret_4014C5"], [27, "nop"], [28, "leave"], [29, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 8], [12, 10], [15, 14], [16, 15], [21, 3], [22, 21], [24, 3], [25, 23], [25, 24], [29, 5], [29, 24]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8091fb888db0eac0604502a61c8da6fb943b602d83b1accdd62b91f233f945b0_8091fb888db0eac0604502a61c8da6fb943b602d83b1accdd62b91f233f945b0.jsonl.gz", "strip_func_name": "sub_40145F", "query": "\n\n\nunsigned int *__fastcall sub_40145F(unsigned int *a1)\n{\nunsigned int *result; // rax\nchar *ptr; // [rsp+18h] [rbp-8h] BYREF\n\nresult = (unsigned int *)*a1;\nif ( (_DWORD)result != 1 )\n{\nif ( asprintf(&ptr, \"%d\", a1[2]) == -1 )\nerr(3, 0LL);\n*a1 = 1;\nresult = a1;\n*((_QWORD *)a1 + 1) = ptr;\n}\nreturn result;\n}\n\n\n\nQ:[a1,ptr,sub_40145F,]", "hints": "[]", "response": "{'a1': 'vp', 'ptr': 'tmp', 'sub_40145F': 'to_string'}"} | [
[
0.7385022044181824,
0.7274743914604187,
0.7193690538406372,
0.707365870475769,
0.7047796249389648,
0.6973176002502441,
0.6911211013793945,
0.6871564388275146,
0.6849797368049622,
0.6839494705200195,
0.6782009601593018,
0.6779582500457764,
0.6755155920982361,
0.6686326265335083,
0.6668320298194885,
0.6665436625480652,
0.6647668480873108,
0.6646873950958252,
0.6612961888313293,
0.656226396560669
],
[
231840,
85090,
96045,
65723,
239057,
180846,
49259,
1881,
236810,
176073,
89117,
106893,
239016,
180403,
253896,
196999,
236409,
131609,
124946,
72778
]
] |
|
send_fd | 89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6 | Tachone | Tachftp | NA | void send_fd(int sock_fd, int fd)
{
int ret;
struct msghdr msg;
struct cmsghdr *p_cmsg;
struct iovec vec;
char cmsgbuf[CMSG_SPACE(sizeof(fd))];
int *p_fds;
char sendchar = 0;
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
p_cmsg = CMSG_FIRSTHDR(&msg);
p_cmsg->cmsg_level = SOL_SOCKET;
p_cmsg->cmsg_type = SCM_RIGHTS;
p_cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
p_fds = (int*)CMSG_DATA(p_cmsg);
*p_fds = fd;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = &vec;
msg.msg_iovlen = 1;
msg.msg_flags = 0;
vec.iov_base = &sendchar;
vec.iov_len = sizeof(sendchar);
ret = sendmsg(sock_fd, &msg, 0);
if (ret != 1)
ERR_EXIT("sendmsg");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403850", "function_addr": 4208720, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+var_98], esi"], [5, "mov [rbp+var_81], 0"], [6, "lea rax, [rbp+var_80]"], [7, "mov [rbp+message.msg_control], rax"], [8, "mov [rbp+message.msg_controllen], 18h"], [9, "mov rax, [rbp+message.msg_controllen]"], [10, "cmp rax, 0Fh"], [11, "jbe short loc_40388E"], [12, "mov rax, [rbp+message.msg_control]"], [13, "jmp short loc_403893"], [14, "mov eax, 0"], [15, "mov [rbp+var_8], rax"], [16, "mov rax, [rbp+var_8]"], [17, "mov dword ptr [rax+8], 1"], [18, "mov rax, [rbp+var_8]"], [19, "mov dword ptr [rax+0Ch], 1"], [20, "mov rax, [rbp+var_8]"], [21, "mov qword ptr [rax], 14h"], [22, "mov rax, [rbp+var_8]"], [23, "add rax, 10h"], [24, "mov [rbp+var_10], rax"], [25, "mov rax, [rbp+var_10]"], [26, "mov edx, [rbp+var_98]"], [27, "mov [rax], edx"], [28, "mov [rbp+message.msg_name], 0"], [29, "mov [rbp+message.msg_namelen], 0"], [30, "lea rax, [rbp+var_60]"], [31, "mov [rbp+message.msg_iov], rax"], [32, "mov [rbp+message.msg_iovlen], 1"], [33, "mov [rbp+message.msg_flags], 0"], [34, "lea rax, [rbp+var_81]"], [35, "mov [rbp+var_60], rax"], [36, "mov [rbp+var_58], 1"], [37, "lea rcx, [rbp+message]"], [38, "mov eax, [rbp+fd]"], [39, "mov edx, 0"], [40, "mov rsi, rcx"], [41, "mov edi, eax"], [42, "call _sendmsg"], [43, "mov [rbp+var_14], eax"], [44, "cmp [rbp+var_14], 1"], [45, "jz short loc_40393F"], [46, "mov edi, offset aSendmsg_0"], [47, "call _perror"], [48, "mov edi, 1"], [49, "call _exit"], [50, "nop"], [51, "leave"], [52, "retn"]], "data_dep": [[7, 6], [9, 8], [10, 9], [11, 10], [12, 7], [15, 14], [15, 12], [16, 15], [17, 16], [18, 15], [19, 18], [20, 15], [21, 20], [22, 15], [23, 22], [24, 23], [25, 24], [26, 4], [27, 25], [27, 26], [30, 25], [31, 30], [34, 30], [34, 5], [35, 34], [38, 3], [40, 37], [41, 38], [43, 42], [44, 43], [45, 44], [52, 42]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6_89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.jsonl.gz", "strip_func_name": "sub_403850", "query": "\n\n\nssize_t __fastcall sub_403850(int a1, int a2)\n{\nssize_t result; // rax\nchar v3; // [rsp+1Fh] [rbp-81h] BYREF\n__int64 v4; // [rsp+20h] [rbp-80h] BYREF\nint v5; // [rsp+28h] [rbp-78h]\nint v6; // [rsp+2Ch] [rbp-74h]\nint v7; // [rsp+30h] [rbp-70h] BYREF\n__int64 v8[2]; // [rsp+40h] [rbp-60h] BYREF\nstruct msghdr message; // [rsp+50h] [rbp-50h] BYREF\nint v10; // [rsp+8Ch] [rbp-14h]\nint *v11; // [rsp+90h] [rbp-10h]\n__int64 *v12; // [rsp+98h] [rbp-8h]\n\nv3 = 0;\nmessage.msg_control = &v4;\nmessage.msg_controllen = 24LL;\nv12 = &v4;\nv5 = 1;\nv6 = 1;\nv4 = 20LL;\nv11 = &v7;\nv7 = a2;\nmessage.msg_name = 0LL;\nmessage.msg_namelen = 0;\nmessage.msg_iov = (iovec *)v8;\nmessage.msg_iovlen = 1LL;\nmessage.msg_flags = 0;\nv8[0] = (__int64)&v3;\nv8[1] = 1LL;\nresult = sendmsg(a1, &message, 0);\nv10 = result;\nif ( (_DWORD)result != 1 )\n{\nperror(\"sendmsg\");\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v4,v8,message,v11,v12,sub_403850,]", "hints": "[]", "response": "{'a1': 'sock_fd', 'a2': 'fd', 'v3': 'sendchar', 'v4': 'cmsgbuf', 'v8': 'vec', 'message': 'msg', 'v11': 'p_fds', 'v12': 'p_cmsg', 'sub_403850': 'send_fd'}"} | [
[
0.8173378109931946,
0.7629156708717346,
0.7485522031784058,
0.7230286598205566,
0.7189650535583496,
0.7182928323745728,
0.716121256351471,
0.6917214393615723,
0.688712477684021,
0.6886879205703735,
0.6875352263450623,
0.6833797693252563,
0.6826594471931458,
0.6789950728416443,
0.6761528253555298,
0.6731868982315063,
0.6730994582176208,
0.6728184223175049,
0.6723260879516602,
0.6674330234527588
],
[
74657,
154031,
182493,
232966,
79999,
200918,
96659,
214123,
133713,
61846,
66931,
225373,
236914,
122253,
13670,
208802,
157297,
8958,
92102,
127540
]
] |
|
core_timestamp | f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7 | cbdevnet | midimonster | NA | static void core_timestamp(){
#ifdef _WIN32
global_timestamp = GetTickCount();
#else
struct timespec current;
if(clock_gettime(CLOCK_MONOTONIC_COARSE, ¤t)){
LOGPF("Failed to update global timestamp, time-based processing for some backends may be impaired: %s", strerror(errno));
return;
}
global_timestamp = current.tv_sec * 1000 + current.tv_nsec / 1000000;
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4029C0", "function_addr": 4204992, "binary_name": "f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "lea rax, [rbp+tp]"], [4, "mov rsi, rax"], [5, "mov edi, 6"], [6, "call _clock_gettime"], [7, "test eax, eax"], [8, "jz short loc_402A09"], [9, "call ___errno_location"], [10, "mov eax, [rax]"], [11, "mov edi, eax"], [12, "call _strerror"], [13, "mov rcx, rax"], [14, "mov edx, offset aFailedToUpdate"], [15, "mov esi, offset aCore"], [16, "mov edi, 0"], [17, "mov eax, 0"], [18, "call log_printf"], [19, "jmp short locret_402A43"], [20, "mov rax, [rbp+tp.tv_sec]"], [21, "imul rsi, rax, 3E8h"], [22, "mov rcx, [rbp+tp.tv_nsec]"], [23, "mov rdx, 431BDE82D7B634DBh"], [24, "mov rax, rcx"], [25, "imul rdx"], [26, "mov rax, rdx"], [27, "sar rax, 12h"], [28, "sar rcx, 3Fh"], [29, "mov rdx, rcx"], [30, "sub rax, rdx"], [31, "add rax, rsi"], [32, "mov cs:qword_40C2B0, rax"], [33, "leave"], [34, "retn"]], "data_dep": [[4, 3], [7, 6], [8, 7], [10, 9], [11, 10], [13, 12], [21, 20], [21, 4], [24, 22], [25, 23], [26, 25], [27, 26], [28, 22], [29, 28], [30, 27], [30, 29], [31, 21], [31, 30], [32, 31], [34, 31], [34, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7_f8cb41d5158446c23a3e7f0986d25486be3561b437eede214466bf1444eb62c7.jsonl.gz", "strip_func_name": "sub_4029C0", "query": "\n\n\n__int64 sub_4029C0()\n{\nint *v0; // rax\nchar *v1; // rax\n__int64 v2; // r8\n__int64 v3; // r9\n__int64 result; // rax\nstruct timespec tp; // [rsp+0h] [rbp-10h] BYREF\n\nif ( clock_gettime(6, &tp) )\n{\nv0 = __errno_location();\nv1 = strerror(*v0);\nresult = log_printf(\n0,\n\"core\",\n\"Failed to update global timestamp, time-based processing for some backends may be impaired: %s\\n\",\n(__int64)v1,\nv2,\nv3);\n}\nelse\n{\nresult = 1000 * tp.tv_sec + tp.tv_nsec / 1000000;\nqword_40C2B0 = result;\n}\nreturn result;\n}\n\n\n\nQ:[tp,sub_4029C0,]", "hints": "[]", "response": "{'tp': 'current', 'sub_4029C0': 'core_timestamp'}"} | [
[
0.8059773445129395,
0.7718760967254639,
0.7706683874130249,
0.7688284516334534,
0.7686964869499207,
0.7628995180130005,
0.7599746584892273,
0.7560101747512817,
0.7519751191139221,
0.7448570728302002,
0.7423067092895508,
0.7414350509643555,
0.7409138679504395,
0.7402369976043701,
0.7395980358123779,
0.7380685806274414,
0.737920880317688,
0.7296196818351746,
0.7282824516296387,
0.7270594835281372
],
[
219280,
72947,
58330,
169628,
254413,
254981,
176050,
111200,
227834,
162039,
256957,
164900,
207632,
209260,
139107,
34312,
149208,
217937,
113553,
225810
]
] |
|
module_attribute | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int module_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst)
{
bstring *attr = var_tostr(c);
bmodule *module = var_toobj(o);
int type = be_module_attr(vm, module, attr, dst);
if (type == BE_NONE) {
vm_error(vm, "attribute_error",
"module '%s' has no member '%s'",
be_module_name(module), str(attr));
}
return type;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41C76F", "function_addr": 4310895, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 48h"], [4, "mov [rbp+var_38], rdi"], [5, "mov [rbp+var_40], rsi"], [6, "mov [rbp+var_48], rdx"], [7, "mov [rbp+var_50], rcx"], [8, "mov rax, [rbp+var_48]"], [9, "mov rax, [rax]"], [10, "mov [rbp+var_18], rax"], [11, "mov rax, [rbp+var_40]"], [12, "mov rax, [rax]"], [13, "mov [rbp+var_20], rax"], [14, "mov rcx, [rbp+var_50]"], [15, "mov rdx, [rbp+var_18]"], [16, "mov rsi, [rbp+var_20]"], [17, "mov rax, [rbp+var_38]"], [18, "mov rdi, rax"], [19, "call be_module_attr"], [20, "mov [rbp+var_24], eax"], [21, "cmp [rbp+var_24], 0FFFFFF00h"], [22, "jnz short loc_41C80D"], [23, "mov rax, [rbp+var_18]"], [24, "mov rdi, rax"], [25, "call be_str2cstr"], [26, "mov rbx, rax"], [27, "mov rax, [rbp+var_20]"], [28, "mov rdi, rax"], [29, "call be_module_name"], [30, "mov rdx, rax"], [31, "mov rax, [rbp+var_38]"], [32, "mov rcx, rbx"], [33, "mov esi, offset aModuleSHasNoMe"], [34, "mov rdi, rax"], [35, "mov eax, 0"], [36, "call be_pushfstring"], [37, "mov rdx, rax"], [38, "mov rax, [rbp+var_38]"], [39, "mov esi, offset aAttributeError_0"], [40, "mov rdi, rax"], [41, "call be_raise"], [42, "mov eax, [rbp+var_24]"], [43, "mov rbx, [rbp+var_8]"], [44, "leave"], [45, "retn"]], "data_dep": [[8, 6], [9, 8], [10, 9], [11, 5], [12, 11], [13, 12], [14, 7], [15, 10], [16, 13], [17, 4], [18, 17], [20, 19], [21, 20], [22, 21], [23, 10], [24, 23], [26, 25], [27, 13], [28, 27], [30, 29], [31, 4], [32, 26], [34, 31], [37, 36], [38, 4], [40, 38], [42, 20], [45, 42]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_41C76F", "query": "\n\n\n__int64 __fastcall sub_41C76F(__int64 a1, __int64 *a2, __int64 *a3, _QWORD *a4)\n{\n__int64 result; // rax\n__int64 v5; // rbx\n__int64 v6; // rax\n__int64 v7; // r8\n__int64 v8; // r9\n__int64 v9; // rax\n__int64 v12; // [rsp+30h] [rbp-20h]\n__int64 v13; // [rsp+38h] [rbp-18h]\n\nv13 = *a3;\nv12 = *a2;\nLOBYTE(result) = be_module_attr(a1, *a2, *a3, a4);\nif ( (_DWORD)result == -256 )\n{\nv5 = be_str2cstr(v13);\nv6 = be_module_name(v12);\nv9 = be_pushfstring(a1, \"module '%s' has no member '%s'\", v6, v5, v7, v8, a4, a3, a2);\nbe_raise(a1, (__int64)\"attribute_error\", v9);\n}\nreturn (unsigned int)result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v12,v13,sub_41C76F,]", "hints": "[]", "response": "{'a3': 'c', 'a4': 'dst', 'a1': 'vm', 'a2': 'o', 'v12': 'module', 'v13': 'attr', 'sub_41C76F': 'module_attribute'}"} | [
[
0.738884687423706,
0.7347002029418945,
0.7268651127815247,
0.7220274806022644,
0.7191316485404968,
0.7140515446662903,
0.7125145196914673,
0.7110627293586731,
0.7096673846244812,
0.7087030410766602,
0.7065162658691406,
0.695213258266449,
0.6915046572685242,
0.690558135509491,
0.6894634962081909,
0.6886672377586365,
0.6883565783500671,
0.6873962879180908,
0.6871886253356934,
0.6867821216583252
],
[
150364,
222199,
132132,
60245,
102753,
81646,
26850,
251476,
34550,
37730,
65895,
53812,
28722,
181471,
197617,
204957,
16896,
82558,
70008,
62792
]
] |
|
unhexStr | 74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0 | jech | babeld | NA | int unhexStr(char *hexstr)
{
char *o = hexstr;
int len = 0, nibble1 = 0, nibble2 = 0;
if (!hexstr) return 0;
for ( ; *hexstr; hexstr++) {
if (isalpha((int)(unsigned char)(*hexstr))) {
nibble1 = tolower((int)(unsigned char)(*hexstr)) - 'a' + 10;
} else if (isdigit((int)(unsigned char)(*hexstr))) {
nibble1 = *hexstr - '0';
} else {
printf("\nError: bad hex character '%c'\n", *hexstr);
}
if (!*++hexstr) break;
if (isalpha((int)(unsigned char)(*hexstr))) {
nibble2 = tolower((int)(unsigned char)(*hexstr)) - 'a' + 10;
} else if (isdigit((int)(unsigned char)(*hexstr))) {
nibble2 = *hexstr - '0';
} else {
printf("\nError: bad hex character '%c'\n", *hexstr);
}
*o++ = (char)((nibble1 << 4) | nibble2);
len++;
}
return len;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405D5B", "function_addr": 4218203, "binary_name": "74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov rax, [rbp+var_28]"], [5, "mov [rbp+var_8], rax"], [6, "mov [rbp+var_C], 0"], [7, "mov [rbp+var_10], 0"], [8, "mov [rbp+var_14], 0"], [9, "cmp [rbp+var_28], 0"], [10, "jnz loc_405EFD"], [11, "mov eax, 0"], [12, "jmp locret_405F12"], [13, "call ___ctype_b_loc"], [14, "mov rdx, [rax]"], [15, "mov rax, [rbp+var_28]"], [16, "movzx eax, byte ptr [rax]"], [17, "movzx eax, al"], [18, "add rax, rax"], [19, "add rax, rdx"], [20, "movzx eax, word ptr [rax]"], [21, "movzx eax, ax"], [22, "and eax, 400h"], [23, "test eax, eax"], [24, "jz short loc_405DD9"], [25, "mov rax, [rbp+var_28]"], [26, "movzx eax, byte ptr [rax]"], [27, "movzx eax, al"], [28, "mov edi, eax"], [29, "call _tolower"], [30, "sub eax, 57h "], [31, "mov [rbp+var_10], eax"], [32, "jmp short loc_405E2D"], [33, "call ___ctype_b_loc"], [34, "mov rdx, [rax]"], [35, "mov rax, [rbp+var_28]"], [36, "movzx eax, byte ptr [rax]"], [37, "movzx eax, al"], [38, "add rax, rax"], [39, "add rax, rdx"], [40, "movzx eax, word ptr [rax]"], [41, "movzx eax, ax"], [42, "and eax, 800h"], [43, "test eax, eax"], [44, "jz short loc_405E12"], [45, "mov rax, [rbp+var_28]"], [46, "movzx eax, byte ptr [rax]"], [47, "movsx eax, al"], [48, "sub eax, 30h "], [49, "mov [rbp+var_10], eax"], [50, "jmp short loc_405E2D"], [51, "mov rax, [rbp+var_28]"], [52, "movzx eax, byte ptr [rax]"], [53, "movsx eax, al"], [54, "mov esi, eax"], [55, "mov edi, offset aErrorBadHexCha"], [56, "mov eax, 0"], [57, "call _printf"], [58, "add [rbp+var_28], 1"], [59, "mov rax, [rbp+var_28]"], [60, "movzx eax, byte ptr [rax]"], [61, "test al, al"], [62, "jz loc_405F0E"], [63, "call ___ctype_b_loc"], [64, "mov rdx, [rax]"], [65, "mov rax, [rbp+var_28]"], [66, "movzx eax, byte ptr [rax]"], [67, "movzx eax, al"], [68, "add rax, rax"], [69, "add rax, rdx"], [70, "movzx eax, word ptr [rax]"], [71, "movzx eax, ax"], [72, "and eax, 400h"], [73, "test eax, eax"], [74, "jz short loc_405E81"], [75, "mov rax, [rbp+var_28]"], [76, "movzx eax, byte ptr [rax]"], [77, "movzx eax, al"], [78, "mov edi, eax"], [79, "call _tolower"], [80, "sub eax, 57h "], [81, "mov [rbp+var_14], eax"], [82, "jmp short loc_405ED5"], [83, "call ___ctype_b_loc"], [84, "mov rdx, [rax]"], [85, "mov rax, [rbp+var_28]"], [86, "movzx eax, byte ptr [rax]"], [87, "movzx eax, al"], [88, "add rax, rax"], [89, "add rax, rdx"], [90, "movzx eax, word ptr [rax]"], [91, "movzx eax, ax"], [92, "and eax, 800h"], [93, "test eax, eax"], [94, "jz short loc_405EBA"], [95, "mov rax, [rbp+var_28]"], [96, "movzx eax, byte ptr [rax]"], [97, "movsx eax, al"], [98, "sub eax, 30h "], [99, "mov [rbp+var_14], eax"], [100, "jmp short loc_405ED5"], [101, "mov rax, [rbp+var_28]"], [102, "movzx eax, byte ptr [rax]"], [103, "movsx eax, al"], [104, "mov esi, eax"], [105, "mov edi, offset aErrorBadHexCha"], [106, "mov eax, 0"], [107, "call _printf"], [108, "mov eax, [rbp+var_10]"], [109, "shl eax, 4"], [110, "mov esi, eax"], [111, "mov eax, [rbp+var_14]"], [112, "mov ecx, eax"], [113, "mov rax, [rbp+var_8]"], [114, "lea rdx, [rax+1]"], [115, "mov [rbp+var_8], rdx"], [116, "or esi, ecx"], [117, "mov edx, esi"], [118, "mov [rax], dl"], [119, "add [rbp+var_C], 1"], [120, "add [rbp+var_28], 1"], [121, "mov rax, [rbp+var_28]"], [122, "movzx eax, byte ptr [rax]"], [123, "test al, al"], [124, "jnz loc_405D99"], [125, "jmp short loc_405F0F"], [126, "nop"], [127, "mov eax, [rbp+var_C]"], [128, "leave"], [129, "retn"]], "data_dep": [[4, 3], [5, 4], [9, 3], [10, 9], [14, 13], [14, 118], [15, 120], [15, 3], [16, 15], [16, 118], [17, 16], [18, 17], [19, 18], [19, 14], [20, 19], [20, 118], [21, 20], [22, 21], [23, 22], [24, 23], [25, 120], [25, 3], [26, 25], [26, 118], [27, 26], [28, 27], [30, 29], [31, 30], [34, 118], [34, 33], [35, 3], [35, 120], [36, 118], [36, 35], [37, 36], [38, 37], [39, 34], [39, 38], [40, 118], [40, 39], [41, 40], [42, 41], [43, 42], [44, 43], [45, 3], [45, 120], [46, 45], [46, 118], [47, 46], [48, 47], [49, 48], [51, 120], [51, 3], [52, 51], [52, 118], [53, 52], [54, 53], [58, 120], [58, 3], [59, 58], [60, 59], [60, 118], [61, 60], [62, 61], [64, 118], [64, 63], [65, 58], [66, 118], [66, 65], [67, 66], [68, 67], [69, 64], [69, 68], [70, 118], [70, 69], [71, 70], [72, 71], [73, 72], [74, 73], [75, 58], [76, 118], [76, 75], [77, 76], [78, 77], [80, 79], [81, 80], [84, 118], [84, 83], [85, 58], [86, 85], [86, 118], [87, 86], [88, 87], [89, 88], [89, 84], [90, 89], [90, 118], [91, 90], [92, 91], [93, 92], [94, 93], [95, 58], [96, 95], [96, 118], [97, 96], [98, 97], [99, 98], [101, 58], [102, 118], [102, 101], [103, 102], [104, 103], [108, 31], [108, 49], [108, 7], [109, 108], [110, 109], [111, 8], [111, 81], [111, 99], [112, 111], [113, 5], [113, 115], [114, 118], [114, 113], [114, 64], [114, 84], [115, 114], [116, 110], [116, 112], [117, 116], [118, 113], [118, 117], [119, 6], [119, 119], [120, 58], [121, 120], [121, 3], [122, 121], [122, 118], [123, 122], [124, 123], [127, 6], [127, 119], [129, 11], [129, 127]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0_74162c74ed1dbe2d7ce02099834e466bf6c4f9771f3a94dd4c17471359c13ad0.jsonl.gz", "strip_func_name": "sub_405D5B", "query": "\n\n\n__int64 __fastcall sub_405D5B(_BYTE *a1)\n{\n_BYTE *v2; // rax\n_BYTE *v3; // [rsp+8h] [rbp-28h]\n_BYTE *v4; // [rsp+8h] [rbp-28h]\nint v5; // [rsp+1Ch] [rbp-14h]\nint v6; // [rsp+20h] [rbp-10h]\nunsigned int v7; // [rsp+24h] [rbp-Ch]\n_BYTE *v8; // [rsp+28h] [rbp-8h]\n\nv3 = a1;\nv8 = a1;\nv7 = 0;\nLOBYTE(v6) = 0;\nLOBYTE(v5) = 0;\nif ( !a1 )\nreturn 0LL;\nwhile ( *v3 )\n{\nif ( ((*__ctype_b_loc())[(unsigned __int8)*v3] & 0x400) != 0 )\n{\nv6 = tolower((unsigned __int8)*v3) - 87;\n}\nelse if ( ((*__ctype_b_loc())[(unsigned __int8)*v3] & 0x800) != 0 )\n{\nLOBYTE(v6) = *v3 - 48;\n}\nelse\n{\nprintf(\"\\nError: bad hex character '%c'\\n\", (unsigned int)(char)*v3);\n}\nv4 = v3 + 1;\nif ( !*v4 )\nbreak;\nif ( ((*__ctype_b_loc())[(unsigned __int8)*v4] & 0x400) != 0 )\n{\nv5 = tolower((unsigned __int8)*v4) - 87;\n}\nelse if ( ((*__ctype_b_loc())[(unsigned __int8)*v4] & 0x800) != 0 )\n{\nLOBYTE(v5) = *v4 - 48;\n}\nelse\n{\nprintf(\"\\nError: bad hex character '%c'\\n\", (unsigned int)(char)*v4);\n}\nv2 = v8++;\n*v2 = v5 | (16 * v6);\n++v7;\nv3 = v4 + 1;\n}\nreturn v7;\n}\n\n\n\nQ:[a1,v3,v5,v6,v7,v8,sub_405D5B,]", "hints": "[]", "response": "{'a1': 'hexstr', 'v3': 'hexstrb', 'v5': 'nibble2', 'v6': 'nibble1', 'v7': 'len', 'v8': 'o', 'sub_405D5B': 'unhexStr'}"} | [
[
0.8203113079071045,
0.8058921098709106,
0.7698874473571777,
0.7649215459823608,
0.7625937461853027,
0.7535725831985474,
0.7511996030807495,
0.740386426448822,
0.7370602488517761,
0.7363755106925964,
0.7268707752227783,
0.7227085828781128,
0.7224398255348206,
0.7201400995254517,
0.7194462418556213,
0.7142926454544067,
0.7141531705856323,
0.7134509086608887,
0.713125467300415,
0.7092577815055847
],
[
58197,
250724,
46236,
159808,
256430,
85120,
122087,
140207,
82567,
217412,
156798,
258789,
197237,
247889,
218080,
110986,
27540,
14724,
41010,
229945
]
] |
|
ioremapsetup | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | static int
ioremapsetup(HttpDir* o, const char* driverregister, HttpCommand* cmd)
{
const char* ref;
if( !cmd )
{
HttpDir_destructor(o);
return 0;
}
if(HttpDir_authenticateAndAuthorize(o,cmd,driverregister))
{
ref = bStrchr(driverregister, '\057');
if(ref)
{
HttpDir* instructioncounter = o->dirList;
while(instructioncounter)
{
if(instructioncounter && !*instructioncounter->name)
{
if(instructioncounter->service)
{
cmd->response.currentDir = instructioncounter;
if( ! (*instructioncounter->service)(instructioncounter, driverregister, cmd) )
return 0;
}
instructioncounter = instructioncounter->next;
}
else
{
instructioncounter = HttpDir_findDir(instructioncounter, driverregister, (int)(ref-driverregister));
if(instructioncounter)
{
if(instructioncounter->service)
{
cmd->response.currentDir = instructioncounter;
if( ! (*instructioncounter->service)(instructioncounter, ref+1, cmd) )
return 0;
}
instructioncounter = instructioncounter->next;
}
}
}
}
if(ref == driverregister)
driverregister++;
if(removechild(o, *driverregister ? driverregister : "\151\156\144\145\170\056\150\164\155\154", cmd))
{
HttpDir* instructioncounter = o->dirList;
while(instructioncounter)
{
if(instructioncounter && !*instructioncounter->name && instructioncounter->service)
{
cmd->response.currentDir = instructioncounter;
if( ! (*instructioncounter->service)(instructioncounter, driverregister, cmd) )
return 0;
}
instructioncounter = instructioncounter->next;
}
return -1;
}
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42A836", "function_addr": 4368438, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+s], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "cmp [rbp+var_38], 0"], [7, "jnz short loc_42A867"], [8, "mov rax, [rbp+var_28]"], [9, "mov rdi, rax"], [10, "call sub_42AAD9"], [11, "mov eax, 0"], [12, "jmp locret_42AA69"], [13, "mov rdx, [rbp+s]"], [14, "mov rcx, [rbp+var_38]"], [15, "mov rax, [rbp+var_28]"], [16, "mov rsi, rcx"], [17, "mov rdi, rax"], [18, "call sub_42B1BC"], [19, "test eax, eax"], [20, "jz loc_42AA64"], [21, "mov rax, [rbp+s]"], [22, "mov esi, 2Fh "], [23, "mov rdi, rax"], [24, "call _strchr"], [25, "mov [rbp+var_18], rax"], [26, "cmp [rbp+var_18], 0"], [27, "jz loc_42A9A4"], [28, "mov rax, [rbp+var_28]"], [29, "mov rax, [rax+20h]"], [30, "mov [rbp+var_8], rax"], [31, "jmp loc_42A999"], [32, "cmp [rbp+var_8], 0"], [33, "jz short loc_42A920"], [34, "mov rax, [rbp+var_8]"], [35, "mov rax, [rax+18h]"], [36, "movzx eax, byte ptr [rax]"], [37, "test al, al"], [38, "jnz short loc_42A920"], [39, "mov rax, [rbp+var_8]"], [40, "mov rax, [rax]"], [41, "test rax, rax"], [42, "jz short loc_42A912"], [43, "mov rax, [rbp+var_38]"], [44, "mov rdx, [rbp+var_8]"], [45, "mov [rax+100h], rdx"], [46, "mov rax, [rbp+var_8]"], [47, "mov r8, [rax]"], [48, "mov rdx, [rbp+var_38]"], [49, "mov rcx, [rbp+s]"], [50, "mov rax, [rbp+var_8]"], [51, "mov rsi, rcx"], [52, "mov rdi, rax"], [53, "call r8"], [54, "test eax, eax"], [55, "jnz short loc_42A912"], [56, "mov eax, 0"], [57, "jmp locret_42AA69"], [58, "mov rax, [rbp+var_8]"], [59, "mov rax, [rax+10h]"], [60, "mov [rbp+var_8], rax"], [61, "jmp short loc_42A999"], [62, "mov rax, [rbp+var_18]"], [63, "sub rax, [rbp+s]"], [64, "mov edx, eax"], [65, "mov rcx, [rbp+s]"], [66, "mov rax, [rbp+var_8]"], [67, "mov rsi, rcx"], [68, "mov rdi, rax"], [69, "call sub_42AFD9"], [70, "mov [rbp+var_8], rax"], [71, "cmp [rbp+var_8], 0"], [72, "jz short loc_42A999"], [73, "mov rax, [rbp+var_8]"], [74, "mov rax, [rax]"], [75, "test rax, rax"], [76, "jz short loc_42A98D"], [77, "mov rax, [rbp+var_38]"], [78, "mov rdx, [rbp+var_8]"], [79, "mov [rax+100h], rdx"], [80, "mov rax, [rbp+var_8]"], [81, "mov rcx, [rax]"], [82, "mov rax, [rbp+var_18]"], [83, "lea rsi, [rax+1]"], [84, "mov rdx, [rbp+var_38]"], [85, "mov rax, [rbp+var_8]"], [86, "mov rdi, rax"], [87, "call rcx"], [88, "test eax, eax"], [89, "jnz short loc_42A98D"], [90, "mov eax, 0"], [91, "jmp locret_42AA69"], [92, "mov rax, [rbp+var_8]"], [93, "mov rax, [rax+10h]"], [94, "mov [rbp+var_8], rax"], [95, "cmp [rbp+var_8], 0"], [96, "jnz loc_42A8B7"], [97, "mov rax, [rbp+var_18]"], [98, "cmp rax, [rbp+s]"], [99, "jnz short loc_42A9B3"], [100, "add [rbp+s], 1"], [101, "mov rax, [rbp+s]"], [102, "movzx eax, byte ptr [rax]"], [103, "test al, al"], [104, "jz short loc_42A9C4"], [105, "mov rax, [rbp+s]"], [106, "jmp short loc_42A9C9"], [107, "mov eax, offset aIndexHtml"], [108, "mov rdx, [rbp+var_38]"], [109, "mov rcx, [rbp+var_28]"], [110, "mov rsi, rax"], [111, "mov rdi, rcx"], [112, "call sub_42A75B"], [113, "test eax, eax"], [114, "jz loc_42AA64"], [115, "mov rax, [rbp+var_28]"], [116, "mov rax, [rax+20h]"], [117, "mov [rbp+var_10], rax"], [118, "jmp short loc_42AA56"], [119, "cmp [rbp+var_10], 0"], [120, "jz short loc_42AA4A"], [121, "mov rax, [rbp+var_10]"], [122, "mov rax, [rax+18h]"], [123, "movzx eax, byte ptr [rax]"], [124, "test al, al"], [125, "jnz short loc_42AA4A"], [126, "mov rax, [rbp+var_10]"], [127, "mov rax, [rax]"], [128, "test rax, rax"], [129, "jz short loc_42AA4A"], [130, "mov rax, [rbp+var_38]"], [131, "mov rdx, [rbp+var_10]"], [132, "mov [rax+100h], rdx"], [133, "mov rax, [rbp+var_10]"], [134, "mov r8, [rax]"], [135, "mov rdx, [rbp+var_38]"], [136, "mov rcx, [rbp+s]"], [137, "mov rax, [rbp+var_10]"], [138, "mov rsi, rcx"], [139, "mov rdi, rax"], [140, "call r8"], [141, "test eax, eax"], [142, "jnz short loc_42AA4A"], [143, "mov eax, 0"], [144, "jmp short locret_42AA69"], [145, "mov rax, [rbp+var_10]"], [146, "mov rax, [rax+10h]"], [147, "mov [rbp+var_10], rax"], [148, "cmp [rbp+var_10], 0"], [149, "jnz short loc_42A9F2"], [150, "mov eax, 0FFFFFFFFh"], [151, "jmp short locret_42AA69"], [152, "mov eax, 0"], [153, "leave"], [154, "retn"]], "data_dep": [[6, 5], [7, 6], [8, 3], [9, 8], [13, 4], [14, 5], [15, 3], [16, 14], [17, 15], [19, 18], [20, 19], [21, 4], [23, 21], [25, 24], [26, 25], [27, 26], [28, 3], [29, 28], [30, 29], [32, 30], [32, 94], [32, 60], [32, 70], [33, 32], [34, 30], [34, 94], [34, 60], [34, 70], [35, 34], [35, 45], [35, 79], [36, 45], [36, 79], [36, 35], [37, 36], [38, 37], [39, 60], [39, 30], [39, 94], [39, 70], [40, 45], [40, 79], [40, 39], [41, 40], [42, 41], [43, 5], [44, 30], [44, 94], [44, 60], [44, 70], [45, 43], [45, 44], [46, 70], [46, 30], [46, 94], [46, 60], [47, 45], [47, 46], [48, 5], [49, 4], [50, 70], [50, 30], [50, 94], [50, 60], [51, 49], [52, 50], [53, 47], [54, 53], [55, 54], [58, 30], [58, 94], [58, 60], [58, 70], [59, 45], [59, 79], [59, 58], [60, 59], [62, 25], [63, 62], [63, 4], [64, 63], [65, 4], [66, 60], [66, 70], [66, 30], [66, 94], [67, 65], [68, 66], [70, 69], [71, 70], [72, 71], [73, 70], [74, 73], [74, 79], [74, 45], [75, 74], [76, 75], [77, 5], [78, 70], [79, 78], [79, 77], [80, 70], [81, 80], [81, 79], [82, 25], [83, 67], [83, 82], [83, 79], [84, 5], [85, 70], [86, 85], [87, 81], [88, 87], [89, 88], [92, 70], [93, 79], [93, 45], [93, 92], [94, 93], [95, 70], [95, 60], [95, 30], [95, 94], [96, 95], [97, 25], [98, 4], [98, 97], [99, 98], [100, 4], [101, 4], [101, 100], [102, 79], [102, 45], [102, 101], [103, 102], [104, 103], [105, 100], [105, 4], [108, 5], [109, 3], [110, 105], [110, 107], [111, 109], [113, 112], [114, 113], [115, 3], [116, 79], [116, 45], [116, 115], [117, 116], [119, 117], [119, 147], [120, 119], [121, 117], [121, 147], [122, 121], [122, 45], [122, 132], [122, 79], [123, 132], [123, 79], [123, 45], [123, 122], [124, 123], [125, 124], [126, 117], [126, 147], [127, 79], [127, 45], [127, 126], [127, 132], [128, 127], [129, 128], [130, 5], [131, 147], [131, 117], [132, 130], [132, 131], [133, 117], [133, 147], [134, 133], [134, 132], [135, 5], [136, 100], [136, 4], [137, 117], [137, 147], [138, 136], [139, 137], [140, 134], [141, 140], [142, 141], [145, 117], [145, 147], [146, 132], [146, 79], [146, 45], [146, 145], [147, 146], [148, 147], [148, 117], [149, 148], [154, 56], [154, 90], [154, 11], [154, 150], [154, 152], [154, 143]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_42A836", "query": "\n\n\n__int64 __fastcall sub_42A836(__int64 a1, const char *a2, __int64 a3)\n{\n__int64 result; // rax\nconst char *v4; // rax\nchar *s; // [rsp+10h] [rbp-30h]\nchar *v7; // [rsp+28h] [rbp-18h]\n__int64 i; // [rsp+30h] [rbp-10h]\n__int64 v9; // [rsp+38h] [rbp-8h]\n\ns = (char *)a2;\nif ( a3 )\n{\nif ( !(unsigned int)sub_42B1BC(a1, a3, a2) )\ngoto LABEL_31;\nv7 = strchr(a2, 47);\nif ( v7 )\n{\nv9 = *(_QWORD *)(a1 + 32);\nwhile ( v9 )\n{\nif ( **(_BYTE **)(v9 + 24) )\n{\nv9 = sub_42AFD9(v9, a2, (unsigned int)((_DWORD)v7 - (_DWORD)a2));\nif ( v9 )\n{\nif ( *(_QWORD *)v9 )\n{\n*(_QWORD *)(a3 + 256) = v9;\nif ( !(*(unsigned int (__fastcall **)(__int64, char *, __int64))v9)(v9, v7 + 1, a3) )\nreturn 0LL;\n}\nv9 = *(_QWORD *)(v9 + 16);\n}\n}\nelse\n{\nif ( *(_QWORD *)v9 )\n{\n*(_QWORD *)(a3 + 256) = v9;\nif ( !(*(unsigned int (__fastcall **)(__int64, const char *, __int64))v9)(v9, a2, a3) )\nreturn 0LL;\n}\nv9 = *(_QWORD *)(v9 + 16);\n}\n}\n}\nif ( v7 == a2 )\ns = (char *)(a2 + 1);\nv4 = *s ? s : \"index.html\";\nif ( (unsigned int)sub_42A75B(a1, v4, a3) )\n{\nfor ( i = *(_QWORD *)(a1 + 32); i; i = *(_QWORD *)(i + 16) )\n{\nif ( !**(_BYTE **)(i + 24) )\n{\nif ( *(_QWORD *)i )\n{\n*(_QWORD *)(a3 + 256) = i;\nif ( !(*(unsigned int (__fastcall **)(__int64, char *, __int64))i)(i, s, a3) )\nreturn 0LL;\n}\n}\n}\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nLABEL_31:\nresult = 0LL;\n}\n}\nelse\n{\nsub_42AAD9(a1);\nresult = 0LL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,s,v7,i,v9,sub_42A836,sub_42B1BC,sub_42AFD9,sub_42A75B,sub_42AAD9,]", "hints": "[]", "response": "{'a3': 'cmd', 'a1': 'o', 'a2': 'driverregister', 's': 'driverregistera', 'v7': 'ref', 'i': 'instructioncounter_0', 'v9': 'instructioncounter', 'sub_42A836': 'ioremapsetup', 'sub_42B1BC': 'HttpDir_authenticateAndAuthorize', 'sub_42AFD9': 'HttpDir_findDir', 'sub_42A75B': 'removechild', 'sub_42AAD9': 'HttpDir_destructor'}"} | [
[
0.7345758080482483,
0.7151293754577637,
0.6963922381401062,
0.6890077590942383,
0.6890077590942383,
0.687466561794281,
0.6845419406890869,
0.6834319829940796,
0.6816405653953552,
0.6814507246017456,
0.6749234795570374,
0.6741330623626709,
0.673789381980896,
0.6733418107032776,
0.6733418107032776,
0.6715710163116455,
0.671101987361908,
0.6706016063690186,
0.6684620976448059,
0.6678950190544128
],
[
10885,
139322,
7923,
259879,
21090,
149217,
186158,
87225,
201194,
216400,
244152,
236906,
68022,
16196,
238408,
190052,
21860,
139009,
69002,
179462
]
] |
|
set_addr | 1d055abe77fb6a5ce30c1ad5c524050818899c92ba813b1974197bd4010cb5a0 | SUSE | kernel | NA | static void set_addr(struct sockaddr_storage *ss, char *ip, char *port, int *len)
{
if (ss->ss_family == AF_INET) {
struct sockaddr_in *a = (struct sockaddr_in *)ss;
a->sin_addr.s_addr = inet_addr(ip);
a->sin_port = htons(atoi(port));
*len = sizeof(*a);
} else {
struct sockaddr_in6 *a = (struct sockaddr_in6 *)ss;
a->sin6_family = AF_INET6;
inet_pton(AF_INET6, ip, &a->sin6_addr);
a->sin6_port = htons(atoi(port));
*len = sizeof(*a);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401222", "function_addr": 4198946, "binary_name": "1d055abe77fb6a5ce30c1ad5c524050818899c92ba813b1974197bd4010cb5a0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+cp], rsi"], [5, "mov [rbp+nptr], rdx"], [6, "mov [rbp+var_30], rcx"], [7, "mov rax, [rbp+var_18]"], [8, "movzx eax, word ptr [rax]"], [9, "cmp ax, 2"], [10, "jnz short loc_40128C"], [11, "mov rax, [rbp+var_18]"], [12, "mov [rbp+var_10], rax"], [13, "mov rax, [rbp+cp]"], [14, "mov rdi, rax"], [15, "call _inet_addr"], [16, "mov rdx, [rbp+var_10]"], [17, "mov [rdx+4], eax"], [18, "mov rax, [rbp+nptr]"], [19, "mov rdi, rax"], [20, "call _atoi"], [21, "movzx eax, ax"], [22, "mov edi, eax"], [23, "call _htons"], [24, "mov rdx, [rbp+var_10]"], [25, "mov [rdx+2], ax"], [26, "mov rax, [rbp+var_30]"], [27, "mov dword ptr [rax], 10h"], [28, "jmp short loc_4012DE"], [29, "mov rax, [rbp+var_18]"], [30, "mov [rbp+var_8], rax"], [31, "mov rax, [rbp+var_8]"], [32, "mov word ptr [rax], 0Ah"], [33, "mov rax, [rbp+var_8]"], [34, "lea rdx, [rax+8]"], [35, "mov rax, [rbp+cp]"], [36, "mov rsi, rax"], [37, "mov edi, 0Ah"], [38, "call _inet_pton"], [39, "mov rax, [rbp+nptr]"], [40, "mov rdi, rax"], [41, "call _atoi"], [42, "movzx eax, ax"], [43, "mov edi, eax"], [44, "call _htons"], [45, "mov rdx, [rbp+var_8]"], [46, "mov [rdx+2], ax"], [47, "mov rax, [rbp+var_30]"], [48, "mov dword ptr [rax], 1Ch"], [49, "nop"], [50, "leave"], [51, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 8], [10, 9], [11, 3], [12, 11], [13, 4], [14, 13], [16, 12], [17, 15], [17, 16], [18, 5], [19, 18], [21, 20], [22, 21], [24, 12], [25, 23], [25, 24], [26, 6], [27, 26], [29, 3], [30, 29], [31, 30], [32, 31], [33, 30], [34, 33], [34, 32], [35, 4], [36, 35], [39, 5], [40, 39], [42, 41], [43, 42], [45, 30], [46, 45], [46, 44], [47, 6], [48, 47], [51, 47], [51, 26]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1d055abe77fb6a5ce30c1ad5c524050818899c92ba813b1974197bd4010cb5a0_1d055abe77fb6a5ce30c1ad5c524050818899c92ba813b1974197bd4010cb5a0.jsonl.gz", "strip_func_name": "sub_401222", "query": "\n\n\n_DWORD *__fastcall sub_401222(__int64 a1, const char *a2, const char *a3, _DWORD *a4)\n{\nuint16_t v4; // ax\n_DWORD *result; // rax\nuint16_t v6; // ax\n\nif ( *(_WORD *)a1 == 2 )\n{\n*(_DWORD *)(a1 + 4) = inet_addr(a2);\nv4 = atoi(a3);\n*(_WORD *)(a1 + 2) = htons(v4);\nresult = a4;\n*a4 = 16;\n}\nelse\n{\n*(_WORD *)a1 = 10;\ninet_pton(10, a2, (void *)(a1 + 8));\nv6 = atoi(a3);\n*(_WORD *)(a1 + 2) = htons(v6);\nresult = a4;\n*a4 = 28;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_401222,]", "hints": "[]", "response": "{'a3': 'port', 'a4': 'len', 'a1': 'ss_0', 'a2': 'ip_0', 'sub_401222': 'set_addr'}"} | [
[
0.7525852918624878,
0.7521523237228394,
0.7321446537971497,
0.7235063910484314,
0.7113595008850098,
0.6972390413284302,
0.6758041381835938,
0.6673178672790527,
0.6649656295776367,
0.664875864982605,
0.6626371741294861,
0.6608867645263672,
0.6534799337387085,
0.6500704288482666,
0.6474905014038086,
0.6465784311294556,
0.6441082954406738,
0.6436589956283569,
0.6430588960647583,
0.64227694272995
],
[
157886,
257009,
124048,
52525,
124628,
247,
62334,
155269,
46203,
201514,
156764,
127058,
143688,
38434,
33232,
96248,
142780,
187302,
96143,
48373
]
] |
|
mei_send_msg | e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a | mandiant | rvmi | NA | static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer,
ssize_t len, unsigned long timeout)
{
struct timeval tv;
ssize_t written;
ssize_t rc;
fd_set set;
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000000;
mei_msg(me, "call write length = %zd\n", len);
written = write(me->fd, buffer, len);
if (written < 0) {
rc = -errno;
mei_err(me, "write failed with status %zd %s\n",
written, strerror(errno));
goto out;
}
FD_ZERO(&set);
FD_SET(me->fd, &set);
rc = select(me->fd + 1 , &set, NULL, NULL, &tv);
if (rc > 0 && FD_ISSET(me->fd, &set)) {
mei_msg(me, "write success\n");
} else if (rc == 0) {
mei_err(me, "write failed on timeout with status\n");
goto out;
} else { /* rc < 0 */
mei_err(me, "write failed on select with status %zd\n", rc);
goto out;
}
rc = written;
out:
if (rc < 0)
mei_deinit(me);
return rc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401517", "function_addr": 4199703, "binary_name": "e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0D0h"], [3, "mov [rbp+var_B8], rdi"], [4, "mov [rbp+buf], rsi"], [5, "mov [rbp+n], rdx"], [6, "mov [rbp+var_D0], rcx"], [7, "mov rax, [rbp+var_D0]"], [8, "shr rax, 3"], [9, "mov rdx, 20C49BA5E353F7CFh"], [10, "mul rdx"], [11, "mov rax, rdx"], [12, "shr rax, 4"], [13, "mov [rbp+timeout.tv_sec], rax"], [14, "mov rcx, [rbp+var_D0]"], [15, "mov rax, rcx"], [16, "shr rax, 3"], [17, "mov rdx, 20C49BA5E353F7CFh"], [18, "mul rdx"], [19, "mov rax, rdx"], [20, "shr rax, 4"], [21, "imul rdx, rax, 3E8h"], [22, "mov rax, rcx"], [23, "sub rax, rdx"], [24, "imul rax, 0F4240h"], [25, "mov [rbp+timeout.tv_usec], rax"], [26, "mov rax, [rbp+var_B8]"], [27, "movzx eax, byte ptr [rax+11h]"], [28, "test al, al"], [29, "jz short loc_4015CA"], [30, "mov rax, cs:stderr"], [31, "mov rdx, [rbp+n]"], [32, "mov esi, offset aCallWriteLengt"], [33, "mov rdi, rax"], [34, "mov eax, 0"], [35, "call _fprintf"], [36, "mov rdx, [rbp+n]"], [37, "mov rax, [rbp+var_B8]"], [38, "mov eax, [rax+1Ch]"], [39, "mov rcx, [rbp+buf]"], [40, "mov rsi, rcx"], [41, "mov edi, eax"], [42, "call _write"], [43, "mov [rbp+var_10], rax"], [44, "cmp [rbp+var_10], 0"], [45, "jns short loc_401639"], [46, "call ___errno_location"], [47, "mov eax, [rax]"], [48, "neg eax"], [49, "cdqe"], [50, "mov [rbp+var_8], rax"], [51, "call ___errno_location"], [52, "mov eax, [rax]"], [53, "mov edi, eax"], [54, "call _strerror"], [55, "mov rcx, rax"], [56, "mov rax, cs:stderr"], [57, "mov rdx, [rbp+var_10]"], [58, "mov esi, offset aErrorWriteFail"], [59, "mov rdi, rax"], [60, "mov eax, 0"], [61, "call _fprintf"], [62, "jmp loc_4017B0"], [63, "mov eax, 0"], [64, "mov ecx, 10h"], [65, "lea rdx, [rbp+readfds]"], [66, "mov rdi, rdx"], [67, "cld"], [68, "rep stosq"], [69, "mov eax, edi"], [70, "mov edx, ecx"], [71, "mov [rbp+var_14], edx"], [72, "mov [rbp+var_18], eax"], [73, "mov rax, [rbp+var_B8]"], [74, "mov eax, [rax+1Ch]"], [75, "lea edx, [rax+3Fh]"], [76, "test eax, eax"], [77, "cmovs eax, edx"], [78, "sar eax, 6"], [79, "mov esi, eax"], [80, "movsxd rax, esi"], [81, "mov rdi, [rbp+rax*8+readfds.fds_bits]"], [82, "mov rax, [rbp+var_B8]"], [83, "mov eax, [rax+1Ch]"], [84, "cdq"], [85, "shr edx, 1Ah"], [86, "add eax, edx"], [87, "and eax, 3Fh"], [88, "sub eax, edx"], [89, "mov edx, 1"], [90, "mov ecx, eax"], [91, "shl rdx, cl"], [92, "mov rax, rdx"], [93, "or rdi, rax"], [94, "mov rdx, rdi"], [95, "movsxd rax, esi"], [96, "mov [rbp+rax*8+readfds.fds_bits], rdx"], [97, "mov rax, [rbp+var_B8]"], [98, "mov eax, [rax+1Ch]"], [99, "lea edi, [rax+1]"], [100, "lea rdx, [rbp+timeout]"], [101, "lea rax, [rbp+readfds]"], [102, "mov r8, rdx"], [103, "mov ecx, 0"], [104, "mov edx, 0"], [105, "mov rsi, rax"], [106, "call _select"], [107, "cdqe"], [108, "mov [rbp+var_8], rax"], [109, "cmp [rbp+var_8], 0"], [110, "jle short loc_401762"], [111, "mov rax, [rbp+var_B8]"], [112, "mov eax, [rax+1Ch]"], [113, "lea edx, [rax+3Fh]"], [114, "test eax, eax"], [115, "cmovs eax, edx"], [116, "sar eax, 6"], [117, "cdqe"], [118, "mov rsi, [rbp+rax*8+readfds.fds_bits]"], [119, "mov rax, [rbp+var_B8]"], [120, "mov eax, [rax+1Ch]"], [121, "cdq"], [122, "shr edx, 1Ah"], [123, "add eax, edx"], [124, "and eax, 3Fh"], [125, "sub eax, edx"], [126, "mov edx, 1"], [127, "mov ecx, eax"], [128, "shl rdx, cl"], [129, "mov rax, rdx"], [130, "and rax, rsi"], [131, "test rax, rax"], [132, "jz short loc_401762"], [133, "mov rax, [rbp+var_B8]"], [134, "movzx eax, byte ptr [rax+11h]"], [135, "test al, al"], [136, "jz short loc_4017A8"], [137, "mov rax, cs:stderr"], [138, "mov rcx, rax"], [139, "mov edx, 0Eh"], [140, "mov esi, 1"], [141, "mov edi, offset aWriteSuccess"], [142, "call _fwrite"], [143, "jmp short loc_4017A8"], [144, "cmp [rbp+var_8], 0"], [145, "jnz short loc_401789"], [146, "mov rax, cs:stderr"], [147, "mov rcx, rax"], [148, "mov edx, 2Bh "], [149, "mov esi, 1"], [150, "mov edi, offset aErrorWriteFail_0"], [151, "call _fwrite"], [152, "jmp short loc_4017B0"], [153, "mov rax, cs:stderr"], [154, "mov rdx, [rbp+var_8]"], [155, "mov esi, offset aErrorWriteFail_1"], [156, "mov rdi, rax"], [157, "mov eax, 0"], [158, "call _fprintf"], [159, "jmp short loc_4017B0"], [160, "mov rax, [rbp+var_10]"], [161, "mov [rbp+var_8], rax"], [162, "cmp [rbp+var_8], 0"], [163, "jns short loc_4017C6"], [164, "mov rax, [rbp+var_B8]"], [165, "mov rdi, rax"], [166, "call sub_401232"], [167, "mov rax, [rbp+var_8]"], [168, "leave"], [169, "retn"]], "data_dep": [[7, 6], [8, 7], [10, 9], [11, 10], [12, 11], [13, 12], [14, 6], [15, 14], [16, 15], [18, 17], [19, 18], [20, 19], [21, 18], [21, 20], [22, 14], [23, 22], [23, 21], [24, 23], [25, 24], [26, 3], [27, 26], [28, 27], [29, 28], [31, 5], [33, 30], [36, 5], [37, 3], [38, 37], [39, 4], [40, 39], [41, 38], [43, 42], [44, 43], [45, 44], [47, 46], [48, 47], [50, 48], [52, 51], [53, 52], [55, 54], [57, 43], [59, 56], [65, 36], [66, 65], [69, 66], [70, 64], [71, 70], [72, 69], [73, 3], [74, 73], [75, 74], [75, 70], [76, 74], [77, 76], [77, 75], [78, 77], [79, 78], [80, 79], [81, 80], [82, 3], [83, 82], [85, 75], [86, 83], [86, 85], [87, 86], [88, 85], [88, 87], [90, 88], [91, 89], [91, 90], [92, 91], [93, 81], [93, 92], [94, 93], [95, 79], [96, 95], [96, 94], [97, 3], [98, 97], [99, 93], [99, 98], [100, 94], [101, 98], [102, 100], [105, 101], [108, 106], [109, 108], [110, 109], [111, 3], [112, 111], [113, 112], [113, 104], [114, 112], [115, 114], [115, 113], [116, 115], [118, 96], [118, 116], [119, 3], [120, 119], [122, 113], [123, 120], [123, 122], [124, 123], [125, 122], [125, 124], [127, 125], [128, 126], [128, 127], [129, 128], [130, 118], [130, 129], [131, 130], [132, 131], [133, 3], [134, 133], [135, 134], [136, 135], [138, 137], [144, 108], [145, 144], [147, 146], [154, 108], [156, 153], [160, 43], [161, 160], [162, 161], [162, 108], [162, 50], [163, 162], [164, 3], [165, 164], [167, 161], [167, 108], [167, 50], [169, 167]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a_e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a.jsonl.gz", "strip_func_name": "sub_401517", "query": "\n\n\n__int64 __fastcall sub_401517(__int64 a1, const void *a2, size_t a3, unsigned __int64 a4)\n{\nint *v4; // rax\nchar *v5; // rax\nint v6; // eax\nfd_set readfds; // [rsp+20h] [rbp-B0h] BYREF\nstruct timeval timeout; // [rsp+A0h] [rbp-30h] BYREF\nunsigned int v11; // [rsp+B8h] [rbp-18h]\nint v12; // [rsp+BCh] [rbp-14h]\nssize_t v13; // [rsp+C0h] [rbp-10h]\n__int64 v14; // [rsp+C8h] [rbp-8h]\n\ntimeout.tv_sec = a4 / 0x3E8;\ntimeout.tv_usec = 1000000 * (a4 % 0x3E8);\nif ( *(_BYTE *)(a1 + 17) )\nfprintf(stderr, \"call write length = %zd\\n\", a3);\nv13 = write(*(_DWORD *)(a1 + 28), a2, a3);\nif ( v13 >= 0 )\n{\nmemset(&readfds, 0, sizeof(readfds));\nv12 = 0;\nv11 = (unsigned int)&timeout;\nreadfds.fds_bits[*(_DWORD *)(a1 + 28) / 64] |= 1LL << (*(_DWORD *)(a1 + 28) % 64);\nv6 = select(*(_DWORD *)(a1 + 28) + 1, &readfds, 0LL, 0LL, &timeout);\nv14 = v6;\nif ( v6 > 0 && (readfds.fds_bits[*(_DWORD *)(a1 + 28) / 64] & (1LL << (*(_DWORD *)(a1 + 28) % 64))) != 0 )\n{\nif ( *(_BYTE *)(a1 + 17) )\nfwrite(\"write success\\n\", 1uLL, 0xEuLL, stderr);\nv14 = v13;\n}\nelse if ( v14 )\n{\nfprintf(stderr, \"Error: write failed on select with status %zd\\n\", v14);\n}\nelse\n{\nfwrite(\"Error: write failed on timeout with status\\n\", 1uLL, 0x2BuLL, stderr);\n}\n}\nelse\n{\nv14 = -*__errno_location();\nv4 = __errno_location();\nv5 = strerror(*v4);\nfprintf(stderr, \"Error: write failed with status %zd %s\\n\", v13, v5);\n}\nif ( v14 < 0 )\nsub_401232(a1);\nreturn v14;\n}\n\n\n\nQ:[a3,a4,a1,a2,readfds,timeout,v11,v12,v13,v14,sub_401517,sub_401232,]", "hints": "[]", "response": "{'a3': 'len', 'a4': 'timeout', 'a1': 'me', 'a2': 'buffer', 'readfds': 'set', 'timeout': 'tv', 'v11': '__d1', 'v12': '__d0', 'v13': 'written', 'v14': 'rc', 'sub_401517': 'mei_send_msg', 'sub_401232': 'mei_deinit'}"} | [
[
0.7820836305618286,
0.7493473887443542,
0.7314818501472473,
0.7160226106643677,
0.7104201316833496,
0.7020106315612793,
0.7014593482017517,
0.6998546719551086,
0.697847843170166,
0.691948413848877,
0.690898060798645,
0.689109206199646,
0.6882868409156799,
0.6869411468505859,
0.6866675615310669,
0.6830066442489624,
0.6822705864906311,
0.6773824095726013,
0.6740577816963196,
0.6703925132751465
],
[
129148,
21593,
178326,
97427,
164777,
139039,
103658,
16403,
247910,
46869,
103170,
213380,
142929,
16501,
15042,
24562,
168740,
227082,
201468,
221435
]
] |
|
send_messages | f637935119c1bdb03eedc7decd0831d08a9e3938dba2bb795d373cad490d27d4 | aws | s2n-tls | NA | void send_messages(int write_fd, uint8_t *server_hello, uint32_t server_hello_len, uint8_t *server_cert, uint32_t server_cert_len)
{
uint8_t record_header[5] = { TLS_HANDSHAKE, 0x03, 0x03, (server_hello_len >> 8), server_hello_len & 0xff };
if (write(write_fd, record_header, 5) != 5) {
_exit(100);
}
if (write(write_fd, server_hello, server_hello_len) != server_hello_len) {
_exit(100);
}
record_header[3] = (server_cert_len >> 8);
record_header[4] = server_cert_len & 0xff;
if (write(write_fd, record_header, 5) != 5) {
_exit(100);
}
if (write(write_fd, server_cert, server_cert_len) != server_cert_len) {
_exit(100);
}
/* Close the pipe and exit */
close(write_fd);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407242", "function_addr": 4223554, "binary_name": "f637935119c1bdb03eedc7decd0831d08a9e3938dba2bb795d373cad490d27d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov dword ptr [rbp+n+4], edi"], [4, "mov [rbp+var_20], rsi"], [5, "mov dword ptr [rbp+n], edx"], [6, "mov [rbp+var_2C+4], rcx"], [7, "mov dword ptr [rbp+var_2C], r8d"], [8, "mov rax, fs:28h"], [9, "mov [rbp+var_8], rax"], [10, "xor eax, eax"], [11, "mov [rbp+buf], 16h"], [12, "mov [rbp+var_C], 3"], [13, "mov [rbp+var_B], 3"], [14, "mov eax, dword ptr [rbp+n]"], [15, "shr eax, 8"], [16, "mov [rbp+var_A], al"], [17, "mov eax, dword ptr [rbp+n]"], [18, "mov [rbp+var_9], al"], [19, "lea rcx, [rbp+buf]"], [20, "mov eax, dword ptr [rbp+n+4]"], [21, "mov edx, 5"], [22, "mov rsi, rcx"], [23, "mov edi, eax"], [24, "call _write"], [25, "cmp rax, 5"], [26, "jz short loc_4072AC"], [27, "mov edi, 64h "], [28, "call __exit"], [29, "mov edx, dword ptr [rbp+n]"], [30, "mov rcx, [rbp+var_20]"], [31, "mov eax, dword ptr [rbp+n+4]"], [32, "mov rsi, rcx"], [33, "mov edi, eax"], [34, "call _write"], [35, "mov edx, dword ptr [rbp+n]"], [36, "cmp rax, rdx"], [37, "jz short loc_4072D2"], [38, "mov edi, 64h "], [39, "call __exit"], [40, "mov eax, dword ptr [rbp+var_2C]"], [41, "shr eax, 8"], [42, "mov [rbp+var_A], al"], [43, "mov eax, dword ptr [rbp+var_2C]"], [44, "mov [rbp+var_9], al"], [45, "lea rcx, [rbp+buf]"], [46, "mov eax, dword ptr [rbp+n+4]"], [47, "mov edx, 5"], [48, "mov rsi, rcx"], [49, "mov edi, eax"], [50, "call _write"], [51, "cmp rax, 5"], [52, "jz short loc_407307"], [53, "mov edi, 64h "], [54, "call __exit"], [55, "mov edx, dword ptr [rbp+var_2C]"], [56, "mov rcx, [rbp+var_2C+4]"], [57, "mov eax, dword ptr [rbp+n+4]"], [58, "mov rsi, rcx"], [59, "mov edi, eax"], [60, "call _write"], [61, "mov edx, dword ptr [rbp+var_2C]"], [62, "cmp rax, rdx"], [63, "jz short loc_40732D"], [64, "mov edi, 64h "], [65, "call __exit"], [66, "mov eax, dword ptr [rbp+n+4]"], [67, "mov edi, eax"], [68, "call _close"], [69, "nop"], [70, "mov rax, [rbp+var_8]"], [71, "sub rax, fs:28h"], [72, "jz short locret_40734C"], [73, "call ___stack_chk_fail"], [74, "leave"], [75, "retn"]], "data_dep": [[9, 8], [14, 5], [15, 14], [16, 15], [17, 5], [18, 17], [19, 11], [20, 3], [22, 19], [23, 20], [25, 24], [26, 25], [29, 5], [30, 4], [31, 3], [32, 30], [33, 31], [35, 5], [36, 34], [36, 35], [37, 36], [40, 7], [41, 40], [42, 41], [43, 7], [44, 43], [45, 30], [45, 11], [46, 3], [48, 45], [49, 46], [51, 50], [52, 51], [55, 7], [56, 6], [57, 3], [58, 56], [59, 57], [61, 7], [62, 61], [62, 60], [63, 62], [66, 3], [67, 66], [70, 9], [71, 70], [72, 71], [75, 71]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f637935119c1bdb03eedc7decd0831d08a9e3938dba2bb795d373cad490d27d4_f637935119c1bdb03eedc7decd0831d08a9e3938dba2bb795d373cad490d27d4.jsonl.gz", "strip_func_name": "sub_407242", "query": "\n\n\nunsigned __int64 __fastcall sub_407242(int a1, const void *a2, unsigned int a3, const void *a4, unsigned int a5)\n{\nchar buf[3]; // [rsp+23h] [rbp-Dh] BYREF\nchar v10; // [rsp+26h] [rbp-Ah]\nchar v11; // [rsp+27h] [rbp-9h]\nunsigned __int64 v12; // [rsp+28h] [rbp-8h]\n\nv12 = __readfsqword(0x28u);\nbuf[0] = 22;\nbuf[1] = 3;\nbuf[2] = 3;\nv10 = BYTE1(a3);\nv11 = a3;\nif ( write(a1, buf, 5uLL) != 5 )\n_exit(100);\nif ( write(a1, a2, a3) != a3 )\n_exit(100);\nv10 = BYTE1(a5);\nv11 = a5;\nif ( write(a1, buf, 5uLL) != 5 )\n_exit(100);\nif ( write(a1, a4, a5) != a5 )\n_exit(100);\nclose(a1);\nreturn v12 - __readfsqword(0x28u);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,buf,sub_407242,]", "hints": "[]", "response": "{'a3': 'server_hello_len', 'a4': 'server_cert', 'a1': 'write_fd', 'a2': 'server_hello', 'a5': 'server_cert_len', 'buf': 'record_header', 'sub_407242': 'send_messages'}"} | [
[
0.7414088845252991,
0.7123773097991943,
0.7089396119117737,
0.6881596446037292,
0.6864873766899109,
0.6826704740524292,
0.6818821430206299,
0.6817342042922974,
0.6780257225036621,
0.6751399040222168,
0.6742891073226929,
0.672767162322998,
0.6726692914962769,
0.6720902323722839,
0.6693440079689026,
0.668637752532959,
0.6675874590873718,
0.6663798689842224,
0.6652940511703491,
0.6648315787315369
],
[
61846,
218110,
258082,
226721,
194876,
243311,
92102,
36429,
110815,
151747,
256656,
111217,
227634,
183023,
222603,
84135,
204825,
210776,
80355,
261731
]
] |
|
list_push | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static bool list_push (gravity_vm *vm, gravity_value_t *args, uint16_t nargs, uint32_t rindex) {
#pragma unused(nargs)
gravity_list_t *list = VALUE_AS_LIST(GET_VALUE(0));
gravity_value_t value = GET_VALUE(1);
marray_push(gravity_value_t, list->array, value);
RETURN_VALUE(VALUE_FROM_INT(marray_size(list->array)), rindex);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43C22E", "function_addr": 4440622, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "push rbx"], [5, "sub rsp, 48h"], [6, "mov [rbp+var_48], rdi"], [7, "mov [rbp+var_50], rsi"], [8, "mov eax, edx"], [9, "mov [rbp+var_58], ecx"], [10, "mov [rbp+var_54], ax"], [11, "mov rax, [rbp+var_50]"], [12, "mov rax, [rax+8]"], [13, "mov [rbp+var_28], rax"], [14, "mov rax, [rbp+var_50]"], [15, "mov rdx, [rax+18h]"], [16, "mov rax, [rax+10h]"], [17, "mov [rbp+var_40], rax"], [18, "mov [rbp+var_38], rdx"], [19, "mov rax, [rbp+var_28]"], [20, "mov rdx, [rax+30h]"], [21, "mov rax, [rbp+var_28]"], [22, "mov rax, [rax+38h]"], [23, "cmp rdx, rax"], [24, "jnz short loc_43C2D3"], [25, "mov rax, [rbp+var_28]"], [26, "mov rax, [rax+38h]"], [27, "test rax, rax"], [28, "jz short loc_43C29C"], [29, "mov rax, [rbp+var_28]"], [30, "mov rax, [rax+38h]"], [31, "lea rdx, [rax+rax]"], [32, "jmp short loc_43C2A1"], [33, "mov edx, 8"], [34, "mov rax, [rbp+var_28]"], [35, "mov [rax+38h], rdx"], [36, "mov rax, [rbp+var_28]"], [37, "mov rax, [rax+38h]"], [38, "shl rax, 4"], [39, "mov rdx, rax"], [40, "mov rax, [rbp+var_28]"], [41, "mov rax, [rax+40h]"], [42, "mov rsi, rdx"], [43, "mov rdi, rax"], [44, "call _realloc"], [45, "mov rdx, [rbp+var_28]"], [46, "mov [rdx+40h], rax"], [47, "mov rax, [rbp+var_28]"], [48, "mov rsi, [rax+40h]"], [49, "mov rax, [rbp+var_28]"], [50, "mov rax, [rax+30h]"], [51, "lea rcx, [rax+1]"], [52, "mov rdx, [rbp+var_28]"], [53, "mov [rdx+30h], rcx"], [54, "shl rax, 4"], [55, "lea rcx, [rsi+rax]"], [56, "mov rax, [rbp+var_40]"], [57, "mov rdx, [rbp+var_38]"], [58, "mov [rcx], rax"], [59, "mov [rcx+8], rdx"], [60, "mov rax, offset unk_47D880"], [61, "mov rax, [rax]"], [62, "mov r12, rax"], [63, "mov rax, [rbp+var_28]"], [64, "mov rax, [rax+30h]"], [65, "mov r13, rax"], [66, "mov edx, [rbp+var_58]"], [67, "mov rsi, r12"], [68, "mov rdi, r13"], [69, "mov rcx, r12"], [70, "mov rbx, r13"], [71, "mov rdi, rbx"], [72, "mov rax, [rbp+var_48]"], [73, "mov ecx, edx"], [74, "mov rdx, rdi"], [75, "mov rdi, rax"], [76, "call sub_43596C"], [77, "mov eax, 1"], [78, "add rsp, 48h"], [79, "pop rbx"], [80, "pop r12"], [81, "pop r13"], [82, "pop rbp"], [83, "retn"]], "data_dep": [[10, 8], [11, 7], [12, 11], [13, 12], [14, 7], [15, 14], [16, 14], [17, 16], [18, 15], [19, 13], [20, 19], [21, 13], [22, 21], [23, 20], [23, 22], [24, 23], [25, 13], [26, 25], [27, 26], [28, 27], [29, 13], [30, 29], [31, 30], [31, 20], [34, 13], [35, 33], [35, 34], [35, 31], [36, 13], [37, 35], [37, 36], [38, 37], [39, 38], [40, 13], [41, 40], [41, 35], [42, 39], [43, 41], [45, 13], [46, 45], [46, 44], [47, 13], [48, 47], [48, 58], [48, 35], [48, 53], [48, 46], [48, 59], [49, 13], [50, 49], [50, 35], [50, 58], [50, 53], [50, 46], [50, 59], [51, 50], [51, 59], [51, 58], [51, 35], [51, 53], [51, 46], [52, 13], [53, 52], [53, 51], [54, 50], [55, 54], [55, 51], [55, 53], [56, 17], [57, 18], [58, 56], [58, 55], [59, 55], [59, 57], [61, 60], [61, 59], [62, 61], [63, 13], [64, 59], [64, 63], [65, 64], [66, 9], [67, 62], [68, 65], [69, 62], [70, 65], [71, 70], [72, 6], [73, 66], [74, 71], [75, 72], [78, 5], [79, 4], [80, 3], [81, 2], [82, 0], [83, 77]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_43C22E", "query": "\n\n\n__int64 __fastcall sub_43C22E(__int64 a1, _QWORD *a2, __int64 a3, unsigned int a4)\n{\n__int64 v4; // rdx\n__int64 v5; // rsi\n__int64 v6; // rax\n_QWORD *v7; // rcx\n__int64 v10; // [rsp+20h] [rbp-40h]\n__int64 v11; // [rsp+28h] [rbp-38h]\n__int64 v12; // [rsp+38h] [rbp-28h]\n\nv12 = a2[1];\nv10 = a2[2];\nv11 = a2[3];\nif ( *(_QWORD *)(v12 + 48) == *(_QWORD *)(v12 + 56) )\n{\nif ( *(_QWORD *)(v12 + 56) )\nv4 = 2LL * *(_QWORD *)(v12 + 56);\nelse\nv4 = 8LL;\n*(_QWORD *)(v12 + 56) = v4;\n*(_QWORD *)(v12 + 64) = realloc(*(void **)(v12 + 64), 16LL * *(_QWORD *)(v12 + 56));\n}\nv5 = *(_QWORD *)(v12 + 64);\nv6 = *(_QWORD *)(v12 + 48);\n*(_QWORD *)(v12 + 48) = v6 + 1;\nv7 = (_QWORD *)(v5 + 16 * v6);\n*v7 = v10;\nv7[1] = v11;\nsub_43596C(a1, qword_47D880, *(_QWORD *)(v12 + 48), a4);\nreturn 1LL;\n}\n\n\n\nQ:[a4,a1,a2,a3,v7,v10,v12,sub_43C22E,sub_43596C,]", "hints": "[]", "response": "{'a4': 'rindex', 'a1': 'vm', 'a2': 'args', 'a3': 'nargs', 'v7': 'rindex', 'v10': 'value', 'v12': 'list', 'sub_43C22E': 'list_push', 'sub_43596C': 'gravity_vm_setslot'}"} | [
[
0.7054055333137512,
0.6973812580108643,
0.6852548718452454,
0.6819340586662292,
0.6762622594833374,
0.6661025285720825,
0.6637917757034302,
0.663406491279602,
0.6632035374641418,
0.6612634062767029,
0.6604474782943726,
0.6536890268325806,
0.6513110399246216,
0.6489924192428589,
0.6472011208534241,
0.6464245915412903,
0.6432295441627502,
0.6420391201972961,
0.6389152407646179,
0.6388379335403442
],
[
67837,
127512,
192381,
94276,
141861,
161101,
93537,
53048,
131508,
235028,
105667,
41548,
251571,
171947,
126916,
262576,
93287,
71547,
172658,
239979
]
] |
|
lexer_previous_token | 7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53 | kgabis | ape | NA | bool lexer_previous_token(lexer_t *lex) {
if (lex->prev_token.type == TOKEN_INVALID) {
return false;
}
lex->peek_token = lex->cur_token;
lex->cur_token = lex->prev_token;
token_init(&lex->prev_token, TOKEN_INVALID, NULL, 0);
lex->ch = lex->prev_token_state.ch;
lex->column = lex->prev_token_state.column;
lex->line = lex->prev_token_state.line;
lex->position = lex->prev_token_state.position;
lex->next_position = lex->prev_token_state.next_position;
return true;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40635C", "function_addr": 4219740, "binary_name": "7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 8"], [4, "mov [rbp+var_10], rdi"], [5, "mov rax, [rbp+var_10]"], [6, "mov eax, [rax+50h]"], [7, "test eax, eax"], [8, "jnz short loc_40637E"], [9, "mov eax, 0"], [10, "jmp loc_406470"], [11, "mov rax, [rbp+var_10]"], [12, "mov rdx, [rbp+var_10]"], [13, "mov rcx, [rdx+78h]"], [14, "mov rbx, [rdx+80h]"], [15, "mov [rax+0A0h], rcx"], [16, "mov [rax+0A8h], rbx"], [17, "mov rcx, [rdx+88h]"], [18, "mov rbx, [rdx+90h]"], [19, "mov [rax+0B0h], rcx"], [20, "mov [rax+0B8h], rbx"], [21, "mov rdx, [rdx+98h]"], [22, "mov [rax+0C0h], rdx"], [23, "mov rax, [rbp+var_10]"], [24, "mov rdx, [rbp+var_10]"], [25, "mov rcx, [rdx+50h]"], [26, "mov rbx, [rdx+58h]"], [27, "mov [rax+78h], rcx"], [28, "mov [rax+80h], rbx"], [29, "mov rcx, [rdx+60h]"], [30, "mov rbx, [rdx+68h]"], [31, "mov [rax+88h], rcx"], [32, "mov [rax+90h], rbx"], [33, "mov rdx, [rdx+70h]"], [34, "mov [rax+98h], rdx"], [35, "mov rax, [rbp+var_10]"], [36, "add rax, 50h "], [37, "mov ecx, 0"], [38, "mov edx, 0"], [39, "mov esi, 0"], [40, "mov rdi, rax"], [41, "call sub_405DF9"], [42, "mov rax, [rbp+var_10]"], [43, "movzx edx, byte ptr [rax+44h]"], [44, "mov rax, [rbp+var_10]"], [45, "mov [rax+24h], dl"], [46, "mov rax, [rbp+var_10]"], [47, "mov edx, [rax+4Ch]"], [48, "mov rax, [rbp+var_10]"], [49, "mov [rax+2Ch], edx"], [50, "mov rax, [rbp+var_10]"], [51, "mov edx, [rax+48h]"], [52, "mov rax, [rbp+var_10]"], [53, "mov [rax+28h], edx"], [54, "mov rax, [rbp+var_10]"], [55, "mov edx, [rax+3Ch]"], [56, "mov rax, [rbp+var_10]"], [57, "mov [rax+1Ch], edx"], [58, "mov rax, [rbp+var_10]"], [59, "mov edx, [rax+40h]"], [60, "mov rax, [rbp+var_10]"], [61, "mov [rax+20h], edx"], [62, "mov eax, 1"], [63, "mov rbx, [rbp+var_8]"], [64, "leave"], [65, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [8, 7], [11, 4], [12, 4], [13, 12], [14, 12], [15, 11], [15, 13], [16, 14], [16, 11], [17, 12], [17, 16], [18, 12], [18, 16], [19, 11], [19, 17], [20, 18], [20, 11], [21, 20], [21, 12], [22, 21], [22, 11], [23, 4], [24, 4], [25, 22], [25, 24], [26, 22], [26, 24], [27, 23], [27, 25], [28, 23], [28, 26], [29, 24], [29, 28], [30, 24], [30, 28], [31, 29], [31, 23], [32, 30], [32, 23], [33, 24], [33, 32], [34, 23], [34, 33], [35, 4], [36, 35], [40, 36], [42, 4], [43, 34], [43, 42], [44, 4], [45, 43], [45, 44], [46, 4], [47, 45], [47, 46], [48, 4], [49, 48], [49, 47], [50, 4], [51, 50], [51, 49], [52, 4], [53, 52], [53, 51], [54, 4], [55, 54], [55, 53], [56, 4], [57, 56], [57, 55], [58, 4], [59, 57], [59, 58], [60, 4], [61, 60], [61, 59], [65, 62], [65, 9]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53_7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.jsonl.gz", "strip_func_name": "sub_40635C", "query": "\n\n\n__int64 __fastcall sub_40635C(__int64 a1)\n{\n__int64 v2; // rbx\n__int64 v3; // rbx\n__int64 v4; // rbx\n__int64 v5; // rbx\n\nif ( !*(_DWORD *)(a1 + 80) )\nreturn 0LL;\nv2 = *(_QWORD *)(a1 + 128);\n*(_QWORD *)(a1 + 160) = *(_QWORD *)(a1 + 120);\n*(_QWORD *)(a1 + 168) = v2;\nv3 = *(_QWORD *)(a1 + 144);\n*(_QWORD *)(a1 + 176) = *(_QWORD *)(a1 + 136);\n*(_QWORD *)(a1 + 184) = v3;\n*(_QWORD *)(a1 + 192) = *(_QWORD *)(a1 + 152);\nv4 = *(_QWORD *)(a1 + 88);\n*(_QWORD *)(a1 + 120) = *(_QWORD *)(a1 + 80);\n*(_QWORD *)(a1 + 128) = v4;\nv5 = *(_QWORD *)(a1 + 104);\n*(_QWORD *)(a1 + 136) = *(_QWORD *)(a1 + 96);\n*(_QWORD *)(a1 + 144) = v5;\n*(_QWORD *)(a1 + 152) = *(_QWORD *)(a1 + 112);\nsub_405DF9(a1 + 80, 0, 0LL, 0);\n*(_BYTE *)(a1 + 36) = *(_BYTE *)(a1 + 68);\n*(_DWORD *)(a1 + 44) = *(_DWORD *)(a1 + 76);\n*(_DWORD *)(a1 + 40) = *(_DWORD *)(a1 + 72);\n*(_DWORD *)(a1 + 28) = *(_DWORD *)(a1 + 60);\n*(_DWORD *)(a1 + 32) = *(_DWORD *)(a1 + 64);\nreturn 1LL;\n}\n\n\n\nQ:[a1,sub_40635C,sub_405DF9,]", "hints": "[]", "response": "{'a1': 'lex', 'sub_40635C': 'lexer_previous_token', 'sub_405DF9': 'token_init'}"} | [
[
0.7621296644210815,
0.7554808855056763,
0.7552401423454285,
0.7502880096435547,
0.7401561737060547,
0.7356066703796387,
0.7339105010032654,
0.7303512096405029,
0.7294756770133972,
0.7289316058158875,
0.7289067506790161,
0.7211963534355164,
0.7201001048088074,
0.7172738909721375,
0.7167448997497559,
0.7146851420402527,
0.7138077616691589,
0.7102716565132141,
0.7080456018447876,
0.703730583190918
],
[
53054,
176612,
66627,
79460,
118881,
131249,
143474,
238627,
55362,
138558,
173378,
126041,
146498,
201282,
115971,
46176,
130288,
263206,
152039,
130792
]
] |
|
js_transport_write | 3e4338d977a219b3df46eee1e2336460ff20b0f3a7fe6e3c963fab7d3db30557 | koush | quickjs | NA | static size_t js_transport_write(void *udata, const char *buffer, size_t length) {
struct js_transport_data* data = (struct js_transport_data *)udata;
if (data->handle <= 0)
return -1;
if (length == 0)
return -2;
if (buffer == NULL)
return -3;
size_t ret = write(data->handle, (const void *) buffer, length);
if (ret <= 0 || ret > (ssize_t) length)
return -4;
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4BF663", "function_addr": 4978275, "binary_name": "3e4338d977a219b3df46eee1e2336460ff20b0f3a7fe6e3c963fab7d3db30557.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+buf], rsi"], [5, "mov [rbp+n], rdx"], [6, "mov rax, [rbp+var_18]"], [7, "mov [rbp+var_8], rax"], [8, "mov rax, [rbp+var_8]"], [9, "mov eax, [rax]"], [10, "test eax, eax"], [11, "jg short loc_4BF692"], [12, "mov rax, 0FFFFFFFFFFFFFFFFh"], [13, "jmp short locret_4BF6EC"], [14, "cmp [rbp+n], 0"], [15, "jnz short loc_4BF6A2"], [16, "mov rax, 0FFFFFFFFFFFFFFFEh"], [17, "jmp short locret_4BF6EC"], [18, "cmp [rbp+buf], 0"], [19, "jnz short loc_4BF6B2"], [20, "mov rax, 0FFFFFFFFFFFFFFFDh"], [21, "jmp short locret_4BF6EC"], [22, "mov rax, [rbp+var_8]"], [23, "mov eax, [rax]"], [24, "mov rdx, [rbp+n]"], [25, "mov rcx, [rbp+buf]"], [26, "mov rsi, rcx"], [27, "mov edi, eax"], [28, "call _write"], [29, "mov [rbp+var_10], rax"], [30, "cmp [rbp+var_10], 0"], [31, "jz short loc_4BF6DF"], [32, "mov rax, [rbp+var_10]"], [33, "cmp rax, [rbp+n]"], [34, "jbe short loc_4BF6E8"], [35, "mov rax, 0FFFFFFFFFFFFFFFCh"], [36, "jmp short locret_4BF6EC"], [37, "mov rax, [rbp+var_10]"], [38, "leave"], [39, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [14, 5], [15, 14], [18, 4], [19, 18], [22, 7], [23, 22], [24, 5], [25, 4], [26, 25], [27, 23], [29, 28], [30, 29], [31, 30], [32, 29], [33, 5], [33, 32], [34, 33], [37, 29], [39, 12], [39, 20], [39, 35], [39, 16], [39, 37]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3e4338d977a219b3df46eee1e2336460ff20b0f3a7fe6e3c963fab7d3db30557_3e4338d977a219b3df46eee1e2336460ff20b0f3a7fe6e3c963fab7d3db30557.jsonl.gz", "strip_func_name": "sub_4BF663", "query": "\n\n\n__int64 __fastcall sub_4BF663(int *a1, const void *a2, size_t a3)\n{\n__int64 result; // rax\nunsigned __int64 v5; // [rsp+20h] [rbp-10h]\n\nif ( *a1 <= 0 )\nreturn -1LL;\nif ( !a3 )\nreturn -2LL;\nif ( !a2 )\nreturn -3LL;\nv5 = write(*a1, a2, a3);\nif ( v5 && v5 <= a3 )\nresult = v5;\nelse\nresult = -4LL;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_4BF663,]", "hints": "[]", "response": "{'a3': 'length', 'a1': 'udata', 'a2': 'buffer', 'sub_4BF663': 'js_transport_write'}"} | [
[
0.8152006268501282,
0.8093075156211853,
0.8066527843475342,
0.8034539222717285,
0.8026789426803589,
0.7902272939682007,
0.7877455353736877,
0.7820242047309875,
0.7755037546157837,
0.7749766111373901,
0.7706211805343628,
0.7706037759780884,
0.7678611278533936,
0.7666797041893005,
0.7633737921714783,
0.7621591091156006,
0.7617324590682983,
0.7592735290527344,
0.7587541341781616,
0.7582058310508728
],
[
259160,
227724,
136224,
73223,
187694,
162424,
120486,
41085,
119022,
237291,
255794,
217891,
184695,
37341,
184425,
27063,
158058,
193722,
242689,
222690
]
] |
|
is_object | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int is_object(bvm *vm, const char *class, int idx)
{
if (be_isinstance(vm, idx)) {
be_pushvalue(vm, idx);
while (1) {
be_getsuper(vm, -1);
if (be_isnil(vm, -1)) {
be_pop(vm, 1);
break;
}
be_remove(vm, -2);
}
const char *name = be_classname(vm, -1);
bbool ret = !strcmp(name, class);
be_pop(vm, 1);
return ret;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B04A", "function_addr": 4239434, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+s2], rsi"], [5, "mov [rbp+var_24], edx"], [6, "mov edx, [rbp+var_24]"], [7, "mov rax, [rbp+var_18]"], [8, "mov esi, edx"], [9, "mov rdi, rax"], [10, "call be_isinstance"], [11, "test al, al"], [12, "jz loc_40B11C"], [13, "mov edx, [rbp+var_24]"], [14, "mov rax, [rbp+var_18]"], [15, "mov esi, edx"], [16, "mov rdi, rax"], [17, "call be_pushvalue"], [18, "mov rax, [rbp+var_18]"], [19, "mov esi, 0FFFFFFFFh"], [20, "mov rdi, rax"], [21, "call be_getsuper"], [22, "mov rax, [rbp+var_18]"], [23, "mov esi, 0FFFFFFFFh"], [24, "mov rdi, rax"], [25, "call be_isnil"], [26, "test al, al"], [27, "jz short loc_40B106"], [28, "mov rax, [rbp+var_18]"], [29, "mov esi, 1"], [30, "mov rdi, rax"], [31, "call be_pop"], [32, "nop"], [33, "mov rax, [rbp+var_18]"], [34, "mov esi, 0FFFFFFFFh"], [35, "mov rdi, rax"], [36, "call be_classname"], [37, "mov [rbp+s1], rax"], [38, "mov rdx, [rbp+s2]"], [39, "mov rax, [rbp+s1]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _strcmp"], [43, "test eax, eax"], [44, "setz al"], [45, "mov [rbp+var_9], al"], [46, "mov rax, [rbp+var_18]"], [47, "mov esi, 1"], [48, "mov rdi, rax"], [49, "call be_pop"], [50, "movzx eax, [rbp+var_9]"], [51, "jmp short locret_40B121"], [52, "mov rax, [rbp+var_18]"], [53, "mov esi, 0FFFFFFFEh"], [54, "mov rdi, rax"], [55, "call be_remove"], [56, "jmp loc_40B087"], [57, "mov eax, 0"], [58, "leave"], [59, "retn"]], "data_dep": [[6, 5], [7, 3], [8, 6], [9, 7], [11, 10], [12, 11], [13, 5], [14, 3], [15, 13], [16, 14], [18, 3], [20, 18], [22, 3], [24, 22], [26, 25], [27, 26], [28, 3], [30, 28], [33, 3], [35, 33], [37, 36], [38, 4], [39, 37], [40, 38], [41, 39], [43, 42], [44, 43], [45, 44], [46, 3], [48, 46], [50, 45], [52, 3], [54, 52], [59, 57], [59, 50]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_40B04A", "query": "\n\n\n_BOOL8 __fastcall sub_40B04A(__int64 a1, const char *a2, unsigned int a3)\n{\nbool v5; // [rsp+27h] [rbp-9h]\nchar *s1; // [rsp+28h] [rbp-8h]\n\nif ( !(unsigned __int8)be_isinstance(a1, a3) )\nreturn 0LL;\nbe_pushvalue(a1, a3);\nwhile ( 1 )\n{\nbe_getsuper(a1, 0xFFFFFFFFLL);\nif ( (unsigned __int8)be_isnil(a1, 0xFFFFFFFFLL) )\nbreak;\nbe_remove(a1, 4294967294LL);\n}\nbe_pop(a1, 1LL);\ns1 = (char *)be_classname(a1, 0xFFFFFFFFLL);\nv5 = strcmp(s1, a2) == 0;\nbe_pop(a1, 1LL);\nreturn v5;\n}\n\n\n\nQ:[a3,a1,s1,sub_40B04A,]", "hints": "[]", "response": "{'a3': 'idx', 'a1': 'vm', 's1': 'name', 'sub_40B04A': 'is_object'}"} | [
[
0.7168694734573364,
0.7029595375061035,
0.7015801668167114,
0.6806803941726685,
0.6761999130249023,
0.6722126007080078,
0.6693480610847473,
0.6680704951286316,
0.6641831994056702,
0.659247100353241,
0.6545509696006775,
0.6545461416244507,
0.6486488580703735,
0.6450216174125671,
0.6439329981803894,
0.6433078050613403,
0.642845869064331,
0.6410020589828491,
0.6393334865570068,
0.6384873986244202
],
[
7170,
168789,
123422,
62513,
128570,
190138,
152721,
194349,
241655,
80315,
34751,
117793,
68152,
187189,
144839,
169289,
149278,
75392,
175253,
21613
]
] |
|
adpcm_driver_play | 9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f | vampirefrog | mdxtools | NA | int adpcm_driver_play(struct adpcm_driver *d, uint8_t channel, uint8_t *data, int len, uint8_t freq, uint8_t vol) {
if(d->play)
return d->play(d, channel, data, len, freq, vol);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40273D", "function_addr": 4204349, "binary_name": "9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_18], rdx"], [6, "mov [rbp+var_10], ecx"], [7, "mov ecx, r8d"], [8, "mov edx, r9d"], [9, "mov [rbp+var_C], al"], [10, "mov eax, ecx"], [11, "mov [rbp+var_1C], al"], [12, "mov eax, edx"], [13, "mov [rbp+var_20], al"], [14, "mov rax, [rbp+var_8]"], [15, "mov rax, [rax+8]"], [16, "test rax, rax"], [17, "jz short loc_4027A0"], [18, "mov rax, [rbp+var_8]"], [19, "mov r10, [rax+8]"], [20, "movzx r8d, [rbp+var_20]"], [21, "movzx edi, [rbp+var_1C]"], [22, "movzx esi, [rbp+var_C]"], [23, "mov ecx, [rbp+var_10]"], [24, "mov rdx, [rbp+var_18]"], [25, "mov rax, [rbp+var_8]"], [26, "mov r9d, r8d"], [27, "mov r8d, edi"], [28, "mov rdi, rax"], [29, "call r10"], [30, "jmp short locret_4027A5"], [31, "mov eax, 0"], [32, "leave"], [33, "retn"]], "data_dep": [[9, 4], [10, 7], [11, 10], [12, 8], [13, 12], [14, 3], [15, 14], [16, 15], [17, 16], [18, 3], [19, 18], [20, 13], [21, 11], [22, 9], [23, 6], [24, 5], [25, 3], [26, 20], [27, 21], [28, 25], [29, 19], [33, 29], [33, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f_9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.jsonl.gz", "strip_func_name": "sub_40273D", "query": "\n\n\n__int64 __fastcall sub_40273D(__int64 a1, unsigned __int8 a2, __int64 a3, unsigned int a4, unsigned __int8 a5, unsigned __int8 a6)\n{\n__int64 result; // rax\n\nif ( *(_QWORD *)(a1 + 8) )\nresult = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64, _QWORD, _QWORD, _QWORD))(a1 + 8))(\na1,\na2,\na3,\na4,\na5,\na6);\nelse\nresult = 0LL;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,sub_40273D,]", "hints": "[]", "response": "{'a3': 'data', 'a4': 'len', 'a1': 'd', 'a2': 'channel', 'a5': 'freq', 'a6': 'vol', 'sub_40273D': 'adpcm_driver_play'}"} | [
[
0.8416574597358704,
0.8190845251083374,
0.8160732984542847,
0.8096667528152466,
0.8079628944396973,
0.8075514435768127,
0.8047652244567871,
0.7974827289581299,
0.771845817565918,
0.7718147039413452,
0.7666528224945068,
0.7583713531494141,
0.7546644806861877,
0.7530504465103149,
0.7508351802825928,
0.7488663196563721,
0.7480250000953674,
0.7464235424995422,
0.7459229826927185,
0.7428398132324219
],
[
72046,
154089,
126675,
174503,
14361,
118706,
14875,
123368,
44103,
86639,
174604,
239660,
126185,
205623,
94069,
26315,
94023,
264535,
101328,
107029
]
] |
|
get_max_len | b2466b98adfb661c7db8f1029e8197476866518b14ea5b95c0fc31a045550050 | dudik | herbe | NA | int get_max_len(char *string, XftFont *font, int max_text_width)
{
int eol = strlen(string);
XGlyphInfo info;
XftTextExtentsUtf8(display, font, (FcChar8 *)string, eol, &info);
if (info.width > max_text_width)
{
eol = max_text_width / font->max_advance_width;
info.width = 0;
while (info.width < max_text_width)
{
eol++;
XftTextExtentsUtf8(display, font, (FcChar8 *)string, eol, &info);
}
eol--;
}
for (int i = 0; i < eol; i++)
if (string[i] == '\n')
{
string[i] = ' ';
return ++i;
}
if (info.width <= max_text_width)
return eol;
int temp = eol;
while (string[eol] != ' ' && eol)
--eol;
if (eol == 0)
return temp;
else
return ++eol;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013E6", "function_addr": 4199398, "binary_name": "b2466b98adfb661c7db8f1029e8197476866518b14ea5b95c0fc31a045550050.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov rax, [rbp+s]"], [7, "mov rdi, rax"], [8, "call _strlen"], [9, "mov [rbp+var_4], eax"], [10, "mov rax, cs:qword_404170"], [11, "lea rdi, [rbp+var_18]"], [12, "mov ecx, [rbp+var_4]"], [13, "mov rdx, [rbp+s]"], [14, "mov rsi, [rbp+var_30]"], [15, "mov r8, rdi"], [16, "mov rdi, rax"], [17, "call _XftTextExtentsUtf8"], [18, "movzx eax, [rbp+var_18]"], [19, "movzx eax, ax"], [20, "cmp [rbp+var_34], eax"], [21, "jge short loc_401482"], [22, "mov rax, [rbp+var_30]"], [23, "mov ecx, [rax+0Ch]"], [24, "mov eax, [rbp+var_34]"], [25, "cdq"], [26, "idiv ecx"], [27, "mov [rbp+var_4], eax"], [28, "mov [rbp+var_18], 0"], [29, "jmp short loc_401472"], [30, "add [rbp+var_4], 1"], [31, "mov rax, cs:qword_404170"], [32, "lea rdi, [rbp+var_18]"], [33, "mov ecx, [rbp+var_4]"], [34, "mov rdx, [rbp+s]"], [35, "mov rsi, [rbp+var_30]"], [36, "mov r8, rdi"], [37, "mov rdi, rax"], [38, "call _XftTextExtentsUtf8"], [39, "movzx eax, [rbp+var_18]"], [40, "movzx eax, ax"], [41, "cmp [rbp+var_34], eax"], [42, "jg short loc_40144D"], [43, "sub [rbp+var_4], 1"], [44, "mov [rbp+var_8], 0"], [45, "jmp short loc_4014BC"], [46, "mov eax, [rbp+var_8]"], [47, "movsxd rdx, eax"], [48, "mov rax, [rbp+s]"], [49, "add rax, rdx"], [50, "movzx eax, byte ptr [rax]"], [51, "cmp al, 0Ah"], [52, "jnz short loc_4014B8"], [53, "mov eax, [rbp+var_8]"], [54, "movsxd rdx, eax"], [55, "mov rax, [rbp+s]"], [56, "add rax, rdx"], [57, "mov byte ptr [rax], 20h "], [58, "add [rbp+var_8], 1"], [59, "mov eax, [rbp+var_8]"], [60, "jmp short locret_40150D"], [61, "add [rbp+var_8], 1"], [62, "mov eax, [rbp+var_8]"], [63, "cmp eax, [rbp+var_4]"], [64, "jl short loc_40148B"], [65, "movzx eax, [rbp+var_18]"], [66, "movzx eax, ax"], [67, "cmp [rbp+var_34], eax"], [68, "jl short loc_4014D5"], [69, "mov eax, [rbp+var_4]"], [70, "jmp short locret_40150D"], [71, "mov eax, [rbp+var_4]"], [72, "mov [rbp+var_C], eax"], [73, "jmp short loc_4014E1"], [74, "sub [rbp+var_4], 1"], [75, "mov eax, [rbp+var_4]"], [76, "movsxd rdx, eax"], [77, "mov rax, [rbp+s]"], [78, "add rax, rdx"], [79, "movzx eax, byte ptr [rax]"], [80, "cmp al, 20h "], [81, "jz short loc_4014FB"], [82, "cmp [rbp+var_4], 0"], [83, "jnz short loc_4014DD"], [84, "cmp [rbp+var_4], 0"], [85, "jnz short loc_401506"], [86, "mov eax, [rbp+var_C]"], [87, "jmp short locret_40150D"], [88, "add [rbp+var_4], 1"], [89, "mov eax, [rbp+var_4]"], [90, "leave"], [91, "retn"]], "data_dep": [[6, 3], [7, 6], [9, 8], [11, 7], [12, 9], [13, 3], [14, 4], [15, 11], [16, 10], [19, 18], [20, 19], [20, 5], [21, 20], [22, 4], [23, 22], [24, 5], [26, 23], [27, 24], [30, 27], [30, 30], [32, 37], [32, 16], [32, 28], [33, 30], [34, 3], [35, 4], [36, 32], [37, 31], [39, 28], [40, 39], [41, 40], [41, 5], [42, 41], [43, 30], [43, 27], [46, 61], [46, 44], [47, 46], [48, 3], [49, 48], [49, 47], [50, 49], [51, 50], [52, 51], [53, 61], [53, 44], [54, 53], [55, 3], [56, 55], [56, 54], [57, 56], [58, 44], [58, 61], [59, 58], [61, 61], [61, 44], [62, 44], [62, 61], [63, 43], [63, 62], [63, 9], [64, 63], [65, 28], [66, 65], [67, 5], [67, 66], [68, 67], [69, 9], [69, 43], [71, 9], [71, 43], [72, 71], [74, 9], [74, 43], [74, 74], [75, 74], [75, 9], [75, 43], [76, 75], [77, 3], [78, 77], [78, 76], [79, 78], [80, 79], [81, 80], [82, 74], [82, 9], [82, 43], [83, 82], [84, 43], [84, 74], [84, 9], [85, 84], [86, 72], [88, 74], [88, 9], [88, 43], [89, 88], [91, 89], [91, 59], [91, 86], [91, 69]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2466b98adfb661c7db8f1029e8197476866518b14ea5b95c0fc31a045550050_b2466b98adfb661c7db8f1029e8197476866518b14ea5b95c0fc31a045550050.jsonl.gz", "strip_func_name": "sub_4013E6", "query": "\n\n\n__int64 __fastcall sub_4013E6(const char *a1, __int64 a2, int a3)\n{\n__int64 result; // rax\nunsigned __int16 v5; // [rsp+28h] [rbp-18h]\nunsigned int v6; // [rsp+34h] [rbp-Ch]\nint i; // [rsp+38h] [rbp-8h]\nint v8; // [rsp+3Ch] [rbp-4h]\nint v9; // [rsp+3Ch] [rbp-4h]\n\nv8 = strlen(a1);\nXftTextExtentsUtf8();\nif ( a3 < v5 )\n{\nv9 = a3 / *(_DWORD *)(a2 + 12);\nv5 = 0;\nwhile ( a3 > 0 )\n{\n++v9;\nXftTextExtentsUtf8();\n}\nv8 = v9 - 1;\n}\nfor ( i = 0; i < v8; ++i )\n{\nif ( a1[i] == 10 )\n{\na1[i] = 32;\nreturn (unsigned int)(i + 1);\n}\n}\nif ( a3 >= v5 )\nreturn (unsigned int)v8;\nv6 = v8;\nwhile ( a1[v8] != 32 && v8 )\n--v8;\nif ( v8 )\nresult = (unsigned int)(v8 + 1);\nelse\nresult = v6;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,v6,v8,sub_4013E6,]", "hints": "[]", "response": "{'a3': 'max_text_width', 'a1': 'string', 'a2': 'font', 'v5': 'info', 'v6': 'temp', 'v8': 'eola', 'sub_4013E6': 'get_max_len'}"} | [
[
0.701167106628418,
0.6844111680984497,
0.6799126267433167,
0.677228569984436,
0.6663222312927246,
0.6544023156166077,
0.6537408828735352,
0.6506014466285706,
0.6493082642555237,
0.6492413878440857,
0.6484212875366211,
0.6476279497146606,
0.6467586755752563,
0.6446205377578735,
0.6419700384140015,
0.6415964961051941,
0.6405757665634155,
0.6405618190765381,
0.6393635272979736,
0.6363767385482788
],
[
243430,
3014,
184020,
218228,
201007,
229459,
30917,
29310,
122755,
126544,
104348,
57435,
119402,
145081,
66235,
119197,
236343,
105673,
193298,
205296
]
] |
|
coproc_open | dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b | lavabit | pahoehoe | NA | pid_t coproc_open(int *to, int *from, int *err, const char *cmd, char * const *argv, char * const *envv, void (*action)(void *data), void *data)
{
int to_pipe[2]; /* pipe for writing to the coprocess */
int from_pipe[2]; /* pipe for reading from the coprocess */
int err_pipe[2]; /* pipe for reading errors from the coprocess */
pid_t pid; /* process id of the coprocess */
int has_meta; /* does cmd contain shell meta characters? */
/* Check arguments */
if (!to || !from || !err || !cmd)
return set_errno(EINVAL);
has_meta = (cmd[strcspn(cmd, SHELL_META_CHARACTERS)] != '\0');
if ((has_meta && argv) || (!has_meta && !argv))
return set_errno(EINVAL);
/* Create pipes */
if (pipe(to_pipe) == -1)
return -1;
if (pipe(from_pipe) == -1)
{
close(to_pipe[RD]);
close(to_pipe[WR]);
return -1;
}
if (pipe(err_pipe) == -1)
{
close(to_pipe[RD]);
close(to_pipe[WR]);
close(from_pipe[RD]);
close(from_pipe[WR]);
return -1;
}
/* Create child process */
switch (pid = fork())
{
case -1:
{
close(to_pipe[RD]);
close(to_pipe[WR]);
close(from_pipe[RD]);
close(from_pipe[WR]);
close(err_pipe[RD]);
close(err_pipe[WR]);
return -1;
}
case 0:
{
/* Adjust process attributes */
if (action)
action(data);
/* Attach pipes to stdin, stdout and stderr */
close(to_pipe[WR]);
close(from_pipe[RD]);
close(err_pipe[RD]);
if (to_pipe[RD] != STDIN_FILENO)
{
if (dup2(to_pipe[RD], STDIN_FILENO) == -1)
_exit(1);
close(to_pipe[RD]);
}
if (from_pipe[WR] != STDOUT_FILENO)
{
if (dup2(from_pipe[WR], STDOUT_FILENO) == -1)
_exit(1);
close(from_pipe[WR]);
}
if (err_pipe[WR] != STDERR_FILENO)
{
if (dup2(err_pipe[WR], STDERR_FILENO) == -1)
_exit(1);
close(err_pipe[WR]);
}
/* Execute co-process */
do_exec(has_meta, cmd, argv, envv);
_exit(EXIT_FAILURE);
}
default:
{
/* Return the pipe descriptors and the coprocess id to the caller */
close(to_pipe[RD]);
close(from_pipe[WR]);
close(err_pipe[WR]);
*to = to_pipe[WR];
*from = from_pipe[RD];
*err = err_pipe[RD];
return pid;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B709", "function_addr": 4241161, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_38], rdx"], [6, "mov [rbp+s], rcx"], [7, "mov [rbp+var_48], r8"], [8, "mov [rbp+var_50], r9"], [9, "cmp [rbp+var_28], 0"], [10, "jz short loc_40B745"], [11, "cmp [rbp+var_30], 0"], [12, "jz short loc_40B745"], [13, "cmp [rbp+var_38], 0"], [14, "jz short loc_40B745"], [15, "cmp [rbp+s], 0"], [16, "jnz short loc_40B754"], [17, "mov edi, 16h"], [18, "call sub_40E241"], [19, "jmp locret_40B9AC"], [20, "mov rax, [rbp+s]"], [21, "mov esi, offset asc_427DF3"], [22, "mov rdi, rax"], [23, "call _strcspn"], [24, "mov rdx, [rbp+s]"], [25, "add rax, rdx"], [26, "movzx eax, byte ptr [rax]"], [27, "test al, al"], [28, "setnz al"], [29, "movzx eax, al"], [30, "mov [rbp+var_4], eax"], [31, "cmp [rbp+var_4], 0"], [32, "jz short loc_40B787"], [33, "cmp [rbp+var_48], 0"], [34, "jnz short loc_40B794"], [35, "cmp [rbp+var_4], 0"], [36, "jnz short loc_40B7A3"], [37, "cmp [rbp+var_48], 0"], [38, "jnz short loc_40B7A3"], [39, "mov edi, 16h"], [40, "call sub_40E241"], [41, "jmp locret_40B9AC"], [42, "lea rax, [rbp+pipedes]"], [43, "mov rdi, rax"], [44, "call _pipe"], [45, "cmp eax, 0FFFFFFFFh"], [46, "jnz short loc_40B7BE"], [47, "mov eax, 0FFFFFFFFh"], [48, "jmp locret_40B9AC"], [49, "lea rax, [rbp+var_18]"], [50, "mov rdi, rax"], [51, "call _pipe"], [52, "cmp eax, 0FFFFFFFFh"], [53, "jnz short loc_40B7ED"], [54, "mov eax, [rbp+pipedes]"], [55, "mov edi, eax"], [56, "call _close"], [57, "mov eax, [rbp+pipedes+4]"], [58, "mov edi, eax"], [59, "call _close"], [60, "mov eax, 0FFFFFFFFh"], [61, "jmp locret_40B9AC"], [62, "lea rax, [rbp+var_20]"], [63, "mov rdi, rax"], [64, "call _pipe"], [65, "cmp eax, 0FFFFFFFFh"], [66, "jnz short loc_40B830"], [67, "mov eax, [rbp+pipedes]"], [68, "mov edi, eax"], [69, "call _close"], [70, "mov eax, [rbp+pipedes+4]"], [71, "mov edi, eax"], [72, "call _close"], [73, "mov eax, [rbp+var_18]"], [74, "mov edi, eax"], [75, "call _close"], [76, "mov eax, [rbp+var_18+4]"], [77, "mov edi, eax"], [78, "call _close"], [79, "mov eax, 0FFFFFFFFh"], [80, "jmp locret_40B9AC"], [81, "call _fork"], [82, "mov [rbp+var_8], eax"], [83, "cmp [rbp+var_8], 0FFFFFFFFh"], [84, "jz short loc_40B849"], [85, "cmp [rbp+var_8], 0"], [86, "jz short loc_40B88F"], [87, "jmp loc_40B970"], [88, "mov eax, [rbp+pipedes]"], [89, "mov edi, eax"], [90, "call _close"], [91, "mov eax, [rbp+pipedes+4]"], [92, "mov edi, eax"], [93, "call _close"], [94, "mov eax, [rbp+var_18]"], [95, "mov edi, eax"], [96, "call _close"], [97, "mov eax, [rbp+var_18+4]"], [98, "mov edi, eax"], [99, "call _close"], [100, "mov eax, [rbp+var_20]"], [101, "mov edi, eax"], [102, "call _close"], [103, "mov eax, [rbp+var_20+4]"], [104, "mov edi, eax"], [105, "call _close"], [106, "mov eax, 0FFFFFFFFh"], [107, "jmp locret_40B9AC"], [108, "cmp [rbp+arg_0], 0"], [109, "jz short loc_40B8A3"], [110, "mov rax, [rbp+arg_8]"], [111, "mov rdx, [rbp+arg_0]"], [112, "mov rdi, rax"], [113, "call rdx"], [114, "mov eax, [rbp+pipedes+4]"], [115, "mov edi, eax"], [116, "call _close"], [117, "mov eax, [rbp+var_18]"], [118, "mov edi, eax"], [119, "call _close"], [120, "mov eax, [rbp+var_20]"], [121, "mov edi, eax"], [122, "call _close"], [123, "mov eax, [rbp+pipedes]"], [124, "test eax, eax"], [125, "jz short loc_40B8F0"], [126, "mov eax, [rbp+pipedes]"], [127, "mov esi, 0"], [128, "mov edi, eax"], [129, "call _dup2"], [130, "cmp eax, 0FFFFFFFFh"], [131, "jnz short loc_40B8E6"], [132, "mov edi, 1"], [133, "call __exit"], [134, "mov eax, [rbp+pipedes]"], [135, "mov edi, eax"], [136, "call _close"], [137, "mov eax, [rbp+var_18+4]"], [138, "cmp eax, 1"], [139, "jz short loc_40B920"], [140, "mov eax, [rbp+var_18+4]"], [141, "mov esi, 1"], [142, "mov edi, eax"], [143, "call _dup2"], [144, "cmp eax, 0FFFFFFFFh"], [145, "jnz short loc_40B916"], [146, "mov edi, 1"], [147, "call __exit"], [148, "mov eax, [rbp+var_18+4]"], [149, "mov edi, eax"], [150, "call _close"], [151, "mov eax, [rbp+var_20+4]"], [152, "cmp eax, 2"], [153, "jz short loc_40B950"], [154, "mov eax, [rbp+var_20+4]"], [155, "mov esi, 2"], [156, "mov edi, eax"], [157, "call _dup2"], [158, "cmp eax, 0FFFFFFFFh"], [159, "jnz short loc_40B946"], [160, "mov edi, 1"], [161, "call __exit"], [162, "mov eax, [rbp+var_20+4]"], [163, "mov edi, eax"], [164, "call _close"], [165, "mov rcx, [rbp+var_50]"], [166, "mov rdx, [rbp+var_48]"], [167, "mov rsi, [rbp+s]"], [168, "mov eax, [rbp+var_4]"], [169, "mov edi, eax"], [170, "call sub_40B410"], [171, "mov edi, 1"], [172, "call __exit"], [173, "mov eax, [rbp+pipedes]"], [174, "mov edi, eax"], [175, "call _close"], [176, "mov eax, [rbp+var_18+4]"], [177, "mov edi, eax"], [178, "call _close"], [179, "mov eax, [rbp+var_20+4]"], [180, "mov edi, eax"], [181, "call _close"], [182, "mov edx, [rbp+pipedes+4]"], [183, "mov rax, [rbp+var_28]"], [184, "mov [rax], edx"], [185, "mov edx, [rbp+var_18]"], [186, "mov rax, [rbp+var_30]"], [187, "mov [rax], edx"], [188, "mov edx, [rbp+var_20]"], [189, "mov rax, [rbp+var_38]"], [190, "mov [rax], edx"], [191, "mov eax, [rbp+var_8]"], [192, "leave"], [193, "retn"]], "data_dep": [[9, 3], [10, 9], [11, 4], [12, 11], [13, 5], [14, 13], [15, 6], [16, 15], [20, 6], [22, 20], [24, 6], [25, 23], [25, 24], [26, 25], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 7], [34, 33], [35, 30], [36, 35], [37, 7], [38, 37], [42, 29], [43, 42], [45, 44], [46, 45], [49, 44], [50, 49], [52, 51], [53, 52], [55, 54], [58, 57], [62, 51], [63, 62], [65, 64], [66, 65], [68, 67], [71, 70], [74, 73], [77, 76], [82, 81], [83, 82], [84, 83], [85, 82], [86, 85], [89, 88], [92, 91], [95, 94], [98, 97], [101, 100], [104, 103], [109, 108], [110, 82], [112, 110], [113, 111], [115, 114], [118, 117], [121, 120], [124, 123], [125, 124], [128, 126], [130, 129], [131, 130], [135, 134], [138, 137], [139, 138], [142, 140], [144, 143], [145, 144], [149, 148], [152, 151], [153, 152], [156, 154], [158, 157], [159, 158], [163, 162], [165, 8], [166, 7], [167, 6], [168, 30], [169, 168], [174, 173], [177, 176], [180, 179], [183, 3], [184, 182], [184, 183], [186, 4], [187, 185], [187, 186], [189, 5], [190, 188], [190, 189], [191, 82], [193, 18], [193, 47], [193, 40], [193, 79], [193, 106], [193, 191], [193, 60]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b_dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.jsonl.gz", "strip_func_name": "sub_40B709", "query": "\n\n\n__int64 __fastcall sub_40B709(_DWORD *a1, _DWORD *a2, _DWORD *a3, char *a4, char *const *a5, char **a6, void (__fastcall *a7)(__int64), __int64 a8)\n{\n__int64 result; // rax\nint v13[2]; // [rsp+30h] [rbp-20h] BYREF\nint v14[2]; // [rsp+38h] [rbp-18h] BYREF\nint pipedes[2]; // [rsp+40h] [rbp-10h] BYREF\nunsigned int v16; // [rsp+48h] [rbp-8h]\nint v17; // [rsp+4Ch] [rbp-4h]\n\nif ( !a1 )\nreturn sub_40E241(22LL);\nif ( !a2 )\nreturn sub_40E241(22LL);\nif ( !a3 )\nreturn sub_40E241(22LL);\nif ( !a4 )\nreturn sub_40E241(22LL);\nv17 = a4[strcspn(a4, \"|&;()<>[]{}$`'~\\\"\\\\*? \\t\\r\\n\")] != 0;\nif ( v17 )\n{\nif ( a5 )\nreturn sub_40E241(22LL);\n}\nif ( !v17 && !a5 )\nreturn sub_40E241(22LL);\nif ( pipe(pipedes) == -1 )\nreturn 0xFFFFFFFFLL;\nif ( pipe(v14) == -1 )\n{\nclose(pipedes[0]);\nclose(pipedes[1]);\nresult = 0xFFFFFFFFLL;\n}\nelse if ( pipe(v13) == -1 )\n{\nclose(pipedes[0]);\nclose(pipedes[1]);\nclose(v14[0]);\nclose(v14[1]);\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nv16 = fork();\nif ( v16 == -1 )\n{\nclose(pipedes[0]);\nclose(pipedes[1]);\nclose(v14[0]);\nclose(v14[1]);\nclose(v13[0]);\nclose(v13[1]);\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nif ( !v16 )\n{\nif ( a7 )\na7(a8);\nclose(pipedes[1]);\nclose(v14[0]);\nclose(v13[0]);\nif ( pipedes[0] )\n{\nif ( dup2(pipedes[0], 0) == -1 )\n_exit(1);\nclose(pipedes[0]);\n}\nif ( v14[1] != 1 )\n{\nif ( dup2(v14[1], 1) == -1 )\n_exit(1);\nclose(v14[1]);\n}\nif ( v13[1] != 2 )\n{\nif ( dup2(v13[1], 2) == -1 )\n_exit(1);\nclose(v13[1]);\n}\nsub_40B410(v17, a4, a5, a6);\n_exit(1);\n}\nclose(pipedes[0]);\nclose(v14[1]);\nclose(v13[1]);\n*a1 = pipedes[1];\n*a2 = v14[0];\n*a3 = v13[0];\nresult = v16;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,v13,v14,pipedes,v16,v17,sub_40B709,sub_40E241,sub_40B410,]", "hints": "[]", "response": "{'a3': 'err', 'a4': 'cmd', 'a1': 'to', 'a2': 'from', 'a5': 'argv', 'a6': 'envv', 'a7': 'action', 'a8': 'data', 'v13': 'err_pipe', 'v14': 'from_pipe', 'pipedes': 'to_pipe', 'v16': 'pid', 'v17': 'has_meta', 'sub_40B709': 'coproc_open', 'sub_40E241': 'set_errno', 'sub_40B410': 'do_exec'}"} | [
[
0.7729426622390747,
0.7729167938232422,
0.7692835927009583,
0.7549914121627808,
0.7393785715103149,
0.7309702634811401,
0.7263342142105103,
0.7208329439163208,
0.7207251787185669,
0.7115413546562195,
0.7098983526229858,
0.7069927453994751,
0.7032359838485718,
0.7020801305770874,
0.7011942863464355,
0.7004607915878296,
0.6955747008323669,
0.6952561736106873,
0.6948211789131165,
0.6944939494132996
],
[
193960,
151246,
14681,
235000,
8325,
83782,
180441,
144168,
170810,
226345,
181917,
22936,
119280,
57671,
71199,
172355,
240946,
191627,
191593,
127480
]
] |
|
mei_deinit | 5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53 | mjg59 | mei-amt-check | NA | static void mei_deinit(struct mei *cl)
{
if (cl->fd != -1)
close(cl->fd);
cl->fd = -1;
cl->buf_size = 0;
cl->prot_ver = 0;
cl->initialized = false;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401242", "function_addr": 4198978, "binary_name": "5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+var_8], rdi"], [4, "mov rax, [rbp+var_8]"], [5, "mov eax, [rax+1Ch]"], [6, "cmp eax, 0FFFFFFFFh"], [7, "jz short loc_401268"], [8, "mov rax, [rbp+var_8]"], [9, "mov eax, [rax+1Ch]"], [10, "mov edi, eax"], [11, "call _close"], [12, "mov rax, [rbp+var_8]"], [13, "mov dword ptr [rax+1Ch], 0FFFFFFFFh"], [14, "mov rax, [rbp+var_8]"], [15, "mov dword ptr [rax+14h], 0"], [16, "mov rax, [rbp+var_8]"], [17, "mov byte ptr [rax+18h], 0"], [18, "mov rax, [rbp+var_8]"], [19, "mov byte ptr [rax+10h], 0"], [20, "nop"], [21, "leave"], [22, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [12, 3], [13, 12], [14, 3], [15, 14], [16, 3], [17, 16], [18, 3], [19, 18], [22, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53_5344094cf97126c3fb7806ec8518450fc7cccda2d3265eb837ffbe6600a73e53.jsonl.gz", "strip_func_name": "sub_401242", "query": "\n\n\n__int64 __fastcall sub_401242(__int64 a1)\n{\n__int64 result; // rax\n\nif ( *(_DWORD *)(a1 + 28) != -1 )\nclose(*(_DWORD *)(a1 + 28));\n*(_DWORD *)(a1 + 28) = -1;\n*(_DWORD *)(a1 + 20) = 0;\n*(_BYTE *)(a1 + 24) = 0;\nresult = a1;\n*(_BYTE *)(a1 + 16) = 0;\nreturn result;\n}\n\n\n\nQ:[a1,sub_401242,]", "hints": "[]", "response": "{'a1': 'cl_0', 'sub_401242': 'mei_deinit'}"} | [
[
0.8553515672683716,
0.8512439727783203,
0.848578155040741,
0.8426312804222107,
0.8425430655479431,
0.8334157466888428,
0.8300715088844299,
0.8279614448547363,
0.8236338496208191,
0.8184341788291931,
0.813439130783081,
0.8122280836105347,
0.8120170831680298,
0.8094691038131714,
0.808424711227417,
0.7986693978309631,
0.7881946563720703,
0.7851004600524902,
0.7818628549575806,
0.7811998724937439
],
[
194376,
21863,
223746,
147009,
90464,
131672,
97672,
25527,
87998,
10450,
69619,
90871,
74706,
151767,
175494,
91144,
95827,
141667,
193712,
153010
]
] |
|
csv_fwrite2 | 78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a | fenugrec | nissutils | NA | int
csv_fwrite2 (FILE *fp, const void *src, size_t src_size, unsigned char quote)
{
const unsigned char *csrc = src;
if (fp == NULL || src == NULL)
return 0;
if (fputc(quote, fp) == EOF)
return EOF;
while (src_size) {
if (*csrc == quote) {
if (fputc(quote, fp) == EOF)
return EOF;
}
if (fputc(*csrc, fp) == EOF)
return EOF;
src_size--;
csrc++;
}
if (fputc(quote, fp) == EOF) {
return EOF;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40CC3A", "function_addr": 4246586, "binary_name": "78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+stream], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+var_28], rdx"], [6, "mov eax, ecx"], [7, "mov [rbp+var_2C], al"], [8, "mov rax, [rbp+var_20]"], [9, "mov [rbp+var_8], rax"], [10, "cmp [rbp+stream], 0"], [11, "jz short loc_40CC69"], [12, "cmp [rbp+var_20], 0"], [13, "jnz short loc_40CC73"], [14, "mov eax, 0"], [15, "jmp locret_40CD16"], [16, "movzx eax, [rbp+var_2C]"], [17, "mov rdx, [rbp+stream]"], [18, "mov rsi, rdx"], [19, "mov edi, eax"], [20, "call _fputc"], [21, "cmp eax, 0FFFFFFFFh"], [22, "jnz short loc_40CCEC"], [23, "mov eax, 0FFFFFFFFh"], [24, "jmp locret_40CD16"], [25, "mov rax, [rbp+var_8]"], [26, "movzx eax, byte ptr [rax]"], [27, "cmp [rbp+var_2C], al"], [28, "jnz short loc_40CCBE"], [29, "movzx eax, [rbp+var_2C]"], [30, "mov rdx, [rbp+stream]"], [31, "mov rsi, rdx"], [32, "mov edi, eax"], [33, "call _fputc"], [34, "cmp eax, 0FFFFFFFFh"], [35, "jnz short loc_40CCBE"], [36, "mov eax, 0FFFFFFFFh"], [37, "jmp short locret_40CD16"], [38, "mov rax, [rbp+var_8]"], [39, "movzx eax, byte ptr [rax]"], [40, "movzx eax, al"], [41, "mov rdx, [rbp+stream]"], [42, "mov rsi, rdx"], [43, "mov edi, eax"], [44, "call _fputc"], [45, "cmp eax, 0FFFFFFFFh"], [46, "jnz short loc_40CCE2"], [47, "mov eax, 0FFFFFFFFh"], [48, "jmp short locret_40CD16"], [49, "sub [rbp+var_28], 1"], [50, "add [rbp+var_8], 1"], [51, "cmp [rbp+var_28], 0"], [52, "jnz short loc_40CC94"], [53, "movzx eax, [rbp+var_2C]"], [54, "mov rdx, [rbp+stream]"], [55, "mov rsi, rdx"], [56, "mov edi, eax"], [57, "call _fputc"], [58, "cmp eax, 0FFFFFFFFh"], [59, "jnz short loc_40CD11"], [60, "mov eax, 0FFFFFFFFh"], [61, "jmp short locret_40CD16"], [62, "mov eax, 0"], [63, "leave"], [64, "retn"]], "data_dep": [[7, 6], [8, 4], [9, 8], [10, 3], [11, 10], [12, 4], [13, 12], [16, 7], [17, 3], [18, 17], [19, 16], [21, 20], [22, 21], [25, 50], [25, 9], [26, 25], [27, 7], [27, 26], [28, 27], [29, 7], [30, 3], [31, 30], [32, 29], [34, 33], [35, 34], [38, 50], [38, 9], [39, 38], [40, 39], [41, 3], [42, 41], [43, 40], [45, 44], [46, 45], [49, 49], [49, 5], [50, 9], [50, 50], [51, 49], [51, 5], [52, 51], [53, 7], [54, 3], [55, 54], [56, 53], [58, 57], [59, 58], [64, 14], [64, 23], [64, 47], [64, 62], [64, 36], [64, 60]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a_78c4a902adf21624cf3c639643216bacefd02dfba6dbb4858507e84011e00a6a.jsonl.gz", "strip_func_name": "sub_40CC3A", "query": "\n\n\n__int64 __fastcall sub_40CC3A(FILE *a1, _BYTE *a2, __int64 a3, unsigned __int8 a4)\n{\n__int64 result; // rax\n_BYTE *v7; // [rsp+28h] [rbp-8h]\n\nv7 = a2;\nif ( !a1 || !a2 )\nreturn 0LL;\nif ( fputc(a4, a1) == -1 )\nreturn 0xFFFFFFFFLL;\nwhile ( a3 )\n{\nif ( a4 == *v7 && fputc(a4, a1) == -1 )\nreturn 0xFFFFFFFFLL;\nif ( fputc((unsigned __int8)*v7, a1) == -1 )\nreturn 0xFFFFFFFFLL;\n--a3;\n++v7;\n}\nif ( fputc(a4, a1) == -1 )\nresult = 0xFFFFFFFFLL;\nelse\nresult = 0LL;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v7,sub_40CC3A,]", "hints": "[]", "response": "{'a3': 'src_size', 'a4': 'quote', 'a1': 'fp', 'a2': 'src', 'v7': 'csrc', 'sub_40CC3A': 'csv_fwrite2'}"} | [
[
0.7975965738296509,
0.7597225308418274,
0.7510836124420166,
0.7293433547019958,
0.7281262874603271,
0.7095113396644592,
0.7070757150650024,
0.7062621116638184,
0.7052401304244995,
0.7049510478973389,
0.7039158940315247,
0.7022984027862549,
0.6987464427947998,
0.6918891668319702,
0.6844677925109863,
0.6795641183853149,
0.6780832409858704,
0.6778895258903503,
0.6774712204933167,
0.6757707595825195
],
[
8141,
198452,
145721,
107661,
126390,
8339,
233902,
251330,
94130,
141378,
183062,
210214,
190342,
94136,
108326,
73402,
109702,
198570,
87514,
26813
]
] |
|
checkForHelp | 3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f | yquake2 | yquake2 | NA | static qboolean checkForHelp(int argc, char **argv)
{
const char* helpArgs[] = { "--help", "-h", "-help", "-?", "/?" };
const int numHelpArgs = sizeof(helpArgs)/sizeof(helpArgs[0]);
for (int i=1; i<argc; ++i)
{
const char* arg = argv[i];
for (int h=0; h<numHelpArgs; ++h)
{
if (Q_stricmp(arg, helpArgs[h]) == 0)
{
printf("Yamagi Quake II v%s\n", YQ2VERSION);
printf("Most interesting commandline arguments:\n");
printf("-h or --help: Show this help\n");
printf("-cfgdir <path>\n");
printf(" set the name of your config directory\n");
printf("-datadir <path>\n");
printf(" set path to your Quake2 game data (the directory baseq2/ is in)\n");
printf("-portable\n");
printf(" Write (savegames, configs, ...) in the binary directory\n");
printf("+exec <config>\n");
printf(" execute the given config (mainly relevant for dedicated servers)\n");
printf("+set <cvarname> <value>\n");
printf(" Set the given cvar to the given value, e.g. +set vid_fullscreen 0\n");
printf("\nSome interesting cvars:\n");
printf("+set game <gamename>\n");
printf(" start the given addon/mod, e.g. +set game xatrix\n");
#ifndef DEDICATED_ONLY
printf("+set vid_fullscreen <0 or 1>\n");
printf(" start game in windowed (0) or desktop fullscreen (1)\n");
printf(" or classic fullscreen (2) mode\n");
printf("+set r_mode <modenumber>\n");
printf(" start game in resolution belonging to <modenumber>,\n");
printf(" use -1 for custom resolutions:\n");
printf("+set r_customwidth <size in pixels>\n");
printf("+set r_customheight <size in pixels>\n");
printf(" if r_mode is set to -1, these cvars allow you to specify the\n");
printf(" width/height of your custom resolution\n");
printf("+set vid_renderer <renderer>\n");
printf(" Selects the render backend. Currently available:\n");
printf(" 'gl1' (the OpenGL 1.x renderer),\n");
printf(" 'gl3' (the OpenGL 3.2 renderer),\n");
printf(" 'soft' (the software renderer)\n");
#endif // DEDICATED_ONLY
printf("\nSee https://github.com/yquake2/yquake2/blob/master/doc/04_cvarlist.md\nfor some more cvars\n");
return true;
}
}
}
return false;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_471FCE", "function_addr": 4661198, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "sub rsp, 58h"], [1, "mov [rsp+58h+var_4C], edi"], [2, "mov [rsp+58h+var_58], rsi"], [3, "mov [rsp+58h+var_48], offset aHelp"], [4, "mov [rsp+58h+var_40], offset asc_4C1C89"], [5, "mov [rsp+58h+var_38], offset aHelp_0"], [6, "mov [rsp+58h+var_30], offset asc_4C1C92"], [7, "mov [rsp+58h+var_28], offset asc_4C1C95"], [8, "mov [rsp+58h+var_14], 5"], [9, "mov [rsp+58h+var_C], 1"], [10, "jmp loc_4721D2"], [11, "mov eax, [rsp+58h+var_C]"], [12, "cdqe"], [13, "lea rdx, ds:0[rax*8]"], [14, "mov rax, [rsp+58h+var_58]"], [15, "add rax, rdx"], [16, "mov rax, [rax]"], [17, "mov [rsp+58h+var_20], rax"], [18, "mov [rsp+58h+var_10], 0"], [19, "jmp loc_4721BF"], [20, "mov eax, [rsp+58h+var_10]"], [21, "cdqe"], [22, "mov rdx, [rsp+rax*8+58h+var_48]"], [23, "mov rax, [rsp+58h+var_20]"], [24, "mov rsi, rdx"], [25, "mov rdi, rax"], [26, "call sub_47A62C"], [27, "test eax, eax"], [28, "jnz loc_4721BA"], [29, "mov esi, offset a821pre_0"], [30, "mov edi, offset aYamagiQuakeIiV_1"], [31, "mov eax, 0"], [32, "call _printf"], [33, "mov edi, offset aMostInterestin"], [34, "call _puts"], [35, "mov edi, offset aHOrHelpShowThi"], [36, "call _puts"], [37, "mov edi, offset aCfgdirPath"], [38, "call _puts"], [39, "mov edi, offset aSetTheNameOfYo"], [40, "call _puts"], [41, "mov edi, offset aDatadirPath"], [42, "call _puts"], [43, "mov edi, offset aSetPathToYourQ"], [44, "call _puts"], [45, "mov edi, offset aPortable"], [46, "call _puts"], [47, "mov edi, offset aWriteSavegames"], [48, "call _puts"], [49, "mov edi, offset aExecConfig"], [50, "call _puts"], [51, "mov edi, offset aExecuteTheGive"], [52, "call _puts"], [53, "mov edi, offset aSetCvarnameVal"], [54, "call _puts"], [55, "mov edi, offset aSetTheGivenCva"], [56, "call _puts"], [57, "mov edi, offset aSomeInterestin"], [58, "call _puts"], [59, "mov edi, offset aSetGameGamenam"], [60, "call _puts"], [61, "mov edi, offset aStartTheGivenA"], [62, "call _puts"], [63, "mov edi, offset aSetVidFullscre"], [64, "call _puts"], [65, "mov edi, offset aStartGameInWin"], [66, "call _puts"], [67, "mov edi, offset aOrClassicFulls"], [68, "call _puts"], [69, "mov edi, offset aSetRModeModenu"], [70, "call _puts"], [71, "mov edi, offset aStartGameInRes"], [72, "call _puts"], [73, "mov edi, offset aUse1ForCustomR"], [74, "call _puts"], [75, "mov edi, offset aSetRCustomwidt"], [76, "call _puts"], [77, "mov edi, offset aSetRCustomheig"], [78, "call _puts"], [79, "mov edi, offset aIfRModeIsSetTo"], [80, "call _puts"], [81, "mov edi, offset aWidthHeightOfY"], [82, "call _puts"], [83, "mov edi, offset aSetVidRenderer"], [84, "call _puts"], [85, "mov edi, offset aSelectsTheRend"], [86, "call _puts"], [87, "mov edi, offset aGl1TheOpengl1X"], [88, "call _puts"], [89, "mov edi, offset aGl3TheOpengl32"], [90, "call _puts"], [91, "mov edi, offset aSoftTheSoftwar"], [92, "call _puts"], [93, "mov edi, offset aSeeHttpsGithub"], [94, "call _puts"], [95, "mov eax, 1"], [96, "jmp short loc_4721E5"], [97, "add [rsp+58h+var_10], 1"], [98, "mov eax, [rsp+58h+var_10]"], [99, "cmp eax, [rsp+58h+var_14]"], [100, "jl loc_472046"], [101, "add [rsp+58h+var_C], 1"], [102, "mov eax, [rsp+58h+var_C]"], [103, "cmp eax, [rsp+58h+var_4C]"], [104, "jl loc_47201C"], [105, "mov eax, 0"], [106, "add rsp, 58h"], [107, "retn"]], "data_dep": [[11, 101], [11, 9], [13, 13], [13, 22], [14, 2], [15, 14], [15, 13], [16, 15], [17, 16], [20, 18], [20, 97], [22, 20], [23, 17], [24, 22], [25, 23], [27, 26], [28, 27], [97, 18], [97, 97], [98, 18], [98, 97], [99, 8], [99, 98], [100, 99], [101, 101], [101, 9], [102, 101], [102, 9], [103, 102], [103, 1], [104, 103], [106, 0], [107, 95], [107, 105]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_471FCE", "query": "\n\n\n__int64 __fastcall sub_471FCE(int a1, __int64 a2)\n{\n__int64 v3[5]; // [rsp+10h] [rbp-48h]\n__int64 v4; // [rsp+38h] [rbp-20h]\nint v5; // [rsp+44h] [rbp-14h]\nint j; // [rsp+48h] [rbp-10h]\nint i; // [rsp+4Ch] [rbp-Ch]\n\nv3[0] = (__int64)\"--help\";\nv3[1] = (__int64)\"-h\";\nv3[2] = (__int64)\"-help\";\nv3[3] = (__int64)\"-?\";\nv3[4] = (__int64)\"/?\";\nv5 = 5;\nfor ( i = 1; i < a1; ++i )\n{\nv4 = *(_QWORD *)(8LL * i + a2);\nfor ( j = 0; j < v5; ++j )\n{\nif ( !(unsigned int)sub_47A62C(v4, v3[j]) )\n{\nprintf(\"Yamagi Quake II v%s\\n\", \"8.21pre\");\nputs(\"Most interesting commandline arguments:\");\nputs(\"-h or --help: Show this help\");\nputs(\"-cfgdir <path>\");\nputs(\" set the name of your config directory\");\nputs(\"-datadir <path>\");\nputs(\" set path to your Quake2 game data (the directory baseq2/ is in)\");\nputs(\"-portable\");\nputs(\" Write (savegames, configs, ...) in the binary directory\");\nputs(\"+exec <config>\");\nputs(\" execute the given config (mainly relevant for dedicated servers)\");\nputs(\"+set <cvarname> <value>\");\nputs(\" Set the given cvar to the given value, e.g. +set vid_fullscreen 0\");\nputs(\"\\nSome interesting cvars:\");\nputs(\"+set game <gamename>\");\nputs(\" start the given addon/mod, e.g. +set game xatrix\");\nputs(\"+set vid_fullscreen <0 or 1>\");\nputs(\" start game in windowed (0) or desktop fullscreen (1)\");\nputs(\" or classic fullscreen (2) mode\");\nputs(\"+set r_mode <modenumber>\");\nputs(\" start game in resolution belonging to <modenumber>,\");\nputs(\" use -1 for custom resolutions:\");\nputs(\"+set r_customwidth <size in pixels>\");\nputs(\"+set r_customheight <size in pixels>\");\nputs(\" if r_mode is set to -1, these cvars allow you to specify the\");\nputs(\" width/height of your custom resolution\");\nputs(\"+set vid_renderer <renderer>\");\nputs(\" Selects the render backend. Currently available:\");\nputs(\" 'gl1' (the OpenGL 1.x renderer),\");\nputs(\" 'gl3' (the OpenGL 3.2 renderer),\");\nputs(\" 'soft' (the software renderer)\");\nputs(\"\\nSee https://github.com/yquake2/yquake2/blob/master/doc/04_cvarlist.md\\nfor some more cvars\");\nreturn 1LL;\n}\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,j,sub_471FCE,sub_47A62C,]", "hints": "[]", "response": "{'a1': 'argc', 'a2': 'argv', 'v3': 'helpArgs', 'v4': 'arg', 'v5': 'numHelpArgs', 'j': 'h', 'sub_471FCE': 'checkForHelp', 'sub_47A62C': 'Q_stricmp'}"} | [
[
0.7527451515197754,
0.7446539402008057,
0.7359663248062134,
0.7339101433753967,
0.7214949727058411,
0.7199229598045349,
0.7151939272880554,
0.713756799697876,
0.7119066119194031,
0.7115477323532104,
0.7110849618911743,
0.709014892578125,
0.7080073952674866,
0.7066780924797058,
0.7065485119819641,
0.7060779333114624,
0.7058629989624023,
0.7052891850471497,
0.7047788500785828,
0.7011778950691223
],
[
99720,
118035,
154908,
254690,
247870,
220510,
257443,
151726,
35435,
233420,
145546,
57387,
188024,
14500,
69841,
43308,
133182,
232515,
187605,
103442
]
] |
|
RC_Encode | 18c124801b8d2991dad24c70f42dc6e8ede577f0ee961d770635ac454b0f0bde | jkbonfield | rans_static | NA | static inline void RC_Encode(RngCoder *rc, uint32_t cumFreq, uint32_t freq) {
rc->low += cumFreq * (rc->range >>= TF_SHIFT);
rc->range*= freq;
//if (cumFreq + freq > TOTFREQ) abort();
if (rc->range>=TOP) return;
do {
if ( (uc)((rc->low^(rc->low+rc->range))>>56) )
rc->range = (((uint32_t)rc->low | (TOP-1))-(uint32_t)rc->low);
*rc->out_buf++ = rc->low>>56, rc->range<<=8, rc->low<<=8;
} while (rc->range<TOP);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40146C", "function_addr": 4199532, "binary_name": "18c124801b8d2991dad24c70f42dc6e8ede577f0ee961d770635ac454b0f0bde.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_C], esi"], [4, "mov [rbp+var_10], edx"], [5, "mov rax, [rbp+var_8]"], [6, "mov eax, [rax+8]"], [7, "shr eax, 10h"], [8, "mov edx, eax"], [9, "mov rax, [rbp+var_8]"], [10, "mov [rax+8], edx"], [11, "mov rax, [rbp+var_8]"], [12, "mov eax, [rax+8]"], [13, "imul eax, [rbp+var_C]"], [14, "mov edx, eax"], [15, "mov rax, [rbp+var_8]"], [16, "mov rax, [rax]"], [17, "mov edx, edx"], [18, "add rdx, rax"], [19, "mov rax, [rbp+var_8]"], [20, "mov [rax], rdx"], [21, "mov rax, [rbp+var_8]"], [22, "mov eax, [rax+8]"], [23, "imul eax, [rbp+var_10]"], [24, "mov edx, eax"], [25, "mov rax, [rbp+var_8]"], [26, "mov [rax+8], edx"], [27, "mov rax, [rbp+var_8]"], [28, "mov eax, [rax+8]"], [29, "cmp eax, 0FFFFFFh"], [30, "ja loc_401578"], [31, "mov rax, [rbp+var_8]"], [32, "mov rdx, [rax]"], [33, "mov rax, [rbp+var_8]"], [34, "mov rcx, [rax]"], [35, "mov rax, [rbp+var_8]"], [36, "mov eax, [rax+8]"], [37, "mov eax, eax"], [38, "add rax, rcx"], [39, "xor rax, rdx"], [40, "shr rax, 38h"], [41, "test al, al"], [42, "jz short loc_401516"], [43, "mov rax, [rbp+var_8]"], [44, "mov rax, [rax]"], [45, "or eax, 0FFFFFFh"], [46, "mov edx, eax"], [47, "mov rax, [rbp+var_8]"], [48, "mov rax, [rax]"], [49, "sub edx, eax"], [50, "mov rax, [rbp+var_8]"], [51, "mov [rax+8], edx"], [52, "mov rax, [rbp+var_8]"], [53, "mov rax, [rax]"], [54, "shr rax, 38h"], [55, "mov rsi, rax"], [56, "mov rax, [rbp+var_8]"], [57, "mov rax, [rax+18h]"], [58, "lea rcx, [rax+1]"], [59, "mov rdx, [rbp+var_8]"], [60, "mov [rdx+18h], rcx"], [61, "mov edx, esi"], [62, "mov [rax], dl"], [63, "mov rax, [rbp+var_8]"], [64, "mov eax, [rax+8]"], [65, "shl eax, 8"], [66, "mov edx, eax"], [67, "mov rax, [rbp+var_8]"], [68, "mov [rax+8], edx"], [69, "mov rax, [rbp+var_8]"], [70, "mov rax, [rax]"], [71, "shl rax, 8"], [72, "mov rdx, rax"], [73, "mov rax, [rbp+var_8]"], [74, "mov [rax], rdx"], [75, "mov rax, [rbp+var_8]"], [76, "mov eax, [rax+8]"], [77, "cmp eax, 0FFFFFFh"], [78, "jbe loc_4014D3"], [79, "jmp short loc_401579"], [80, "nop"], [81, "pop rbp"], [82, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 7], [9, 2], [10, 8], [10, 9], [11, 2], [12, 10], [12, 11], [13, 3], [13, 12], [14, 13], [15, 2], [16, 15], [16, 10], [17, 14], [18, 17], [18, 16], [19, 2], [20, 19], [20, 18], [21, 2], [22, 10], [22, 21], [22, 20], [23, 4], [23, 22], [24, 23], [25, 2], [26, 25], [26, 24], [27, 2], [28, 27], [28, 26], [29, 28], [30, 29], [31, 2], [32, 60], [32, 62], [32, 20], [32, 68], [32, 31], [32, 51], [32, 26], [32, 10], [32, 74], [33, 2], [34, 10], [34, 74], [34, 60], [34, 62], [34, 68], [34, 20], [34, 33], [34, 51], [34, 26], [35, 2], [36, 62], [36, 20], [36, 68], [36, 51], [36, 26], [36, 35], [36, 10], [36, 74], [36, 60], [37, 36], [38, 34], [38, 37], [39, 32], [39, 38], [40, 39], [41, 40], [42, 41], [43, 2], [44, 20], [44, 51], [44, 26], [44, 10], [44, 74], [44, 60], [44, 62], [44, 68], [44, 43], [45, 44], [46, 45], [47, 2], [48, 47], [48, 51], [48, 26], [48, 10], [48, 74], [48, 60], [48, 62], [48, 20], [48, 68], [49, 46], [49, 48], [50, 2], [51, 50], [51, 49], [52, 2], [53, 62], [53, 20], [53, 68], [53, 52], [53, 51], [53, 26], [53, 10], [53, 74], [53, 60], [54, 53], [55, 54], [56, 2], [57, 20], [57, 68], [57, 56], [57, 51], [57, 26], [57, 10], [57, 74], [57, 60], [57, 62], [58, 51], [58, 26], [58, 10], [58, 74], [58, 60], [58, 62], [58, 34], [58, 57], [58, 20], [58, 68], [59, 2], [60, 59], [60, 58], [61, 55], [62, 57], [62, 61], [63, 2], [64, 62], [64, 68], [64, 63], [64, 51], [64, 26], [65, 64], [66, 65], [67, 2], [68, 66], [68, 67], [69, 2], [70, 68], [70, 69], [70, 62], [71, 70], [72, 71], [73, 2], [74, 73], [74, 72], [75, 2], [76, 74], [76, 75], [76, 68], [77, 76], [78, 77], [81, 0], [82, 28], [82, 76]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/18c124801b8d2991dad24c70f42dc6e8ede577f0ee961d770635ac454b0f0bde_18c124801b8d2991dad24c70f42dc6e8ede577f0ee961d770635ac454b0f0bde.jsonl.gz", "strip_func_name": "sub_40146C", "query": "\n\n\n__int64 __fastcall sub_40146C(__int64 a1, int a2, int a3)\n{\n__int64 result; // rax\n__int64 v4; // rsi\n_BYTE *v5; // rax\n\n*(_DWORD *)(a1 + 8) >>= 16;\n*(_QWORD *)a1 += (unsigned int)(a2 * *(_DWORD *)(a1 + 8));\n*(_DWORD *)(a1 + 8) *= a3;\nfor ( result = *(unsigned int *)(a1 + 8); (unsigned int)result <= 0xFFFFFF; result = *(unsigned int *)(a1 + 8) )\n{\nif ( (*(_QWORD *)a1 ^ (*(_QWORD *)a1 + (unsigned __int64)*(unsigned int *)(a1 + 8))) >> 56 )\n*(_DWORD *)(a1 + 8) = (*(_QWORD *)a1 | 0xFFFFFF) - *(_QWORD *)a1;\nv4 = HIBYTE(*(_QWORD *)a1);\nv5 = *(_BYTE **)(a1 + 24);\n*(_QWORD *)(a1 + 24) = v5 + 1;\n*v5 = v4;\n*(_DWORD *)(a1 + 8) <<= 8;\n*(_QWORD *)a1 <<= 8;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_40146C,]", "hints": "[]", "response": "{'a3': 'freq', 'a1': 'rc', 'a2': 'cumFreq', 'sub_40146C': 'RC_Encode'}"} | [
[
0.766512930393219,
0.7647221088409424,
0.7617805600166321,
0.7614721059799194,
0.75581955909729,
0.7474192976951599,
0.744801938533783,
0.7432593107223511,
0.7350975275039673,
0.7323363423347473,
0.7303906679153442,
0.7287242412567139,
0.7180432081222534,
0.7138866186141968,
0.7135922908782959,
0.7132901549339294,
0.713250458240509,
0.7131228446960449,
0.712286114692688,
0.7113322019577026
],
[
96310,
41402,
258612,
204701,
9048,
258606,
55281,
110199,
183408,
53623,
105779,
66396,
231793,
118778,
153999,
99181,
198523,
242939,
92287,
214500
]
] |
|
arm_fir_interpolate_init_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | arm_status arm_fir_interpolate_init_q31(
arm_fir_interpolate_instance_q31 * S,
uint8_t L,
uint16_t numTaps,
const q31_t * pCoeffs,
q31_t * pState,
uint32_t blockSize)
{
arm_status status;
/* The filter length must be a multiple of the interpolation factor */
if ((numTaps % L) != 0U)
{
/* Set status as ARM_MATH_LENGTH_ERROR */
status = ARM_MATH_LENGTH_ERROR;
}
else
{
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Assign Interpolation factor */
S->L = L;
/* Assign polyPhaseLength */
S->phaseLength = numTaps / L;
/* Clear state buffer and size of buffer is always phaseLength + blockSize - 1 */
memset(pState, 0, (blockSize + ((uint32_t) S->phaseLength - 1U)) * sizeof(q31_t));
/* Assign state pointer */
S->pState = pState;
status = ARM_MATH_SUCCESS;
}
return (status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41913D", "function_addr": 4297021, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_18], rdi"], [4, "mov eax, edx"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+s], r8"], [7, "mov [rbp+var_34], r9d"], [8, "mov edx, esi"], [9, "mov [rbp+var_1C], dl"], [10, "mov [rbp+var_20], ax"], [11, "movzx eax, [rbp+var_20]"], [12, "movzx ecx, [rbp+var_1C]"], [13, "cdq"], [14, "idiv ecx"], [15, "mov eax, edx"], [16, "test eax, eax"], [17, "jz short loc_41917A"], [18, "mov [rbp+var_4], 0FFFFFFFEh"], [19, "jmp short loc_4191E6"], [20, "mov rax, [rbp+var_18]"], [21, "mov rdx, [rbp+var_28]"], [22, "mov [rax+8], rdx"], [23, "mov rax, [rbp+var_18]"], [24, "movzx edx, [rbp+var_1C]"], [25, "mov [rax], dl"], [26, "movzx eax, [rbp+var_20]"], [27, "movzx edi, [rbp+var_1C]"], [28, "cdq"], [29, "idiv edi"], [30, "mov edx, eax"], [31, "mov rax, [rbp+var_18]"], [32, "mov [rax+2], dx"], [33, "mov rax, [rbp+var_18]"], [34, "movzx eax, word ptr [rax+2]"], [35, "movzx edx, ax"], [36, "mov eax, [rbp+var_34]"], [37, "add eax, edx"], [38, "sub eax, 1"], [39, "mov eax, eax"], [40, "lea rdx, ds:0[rax*4]"], [41, "mov rax, [rbp+s]"], [42, "mov esi, 0"], [43, "mov rdi, rax"], [44, "call _memset"], [45, "mov rax, [rbp+var_18]"], [46, "mov rdx, [rbp+s]"], [47, "mov [rax+10h], rdx"], [48, "mov [rbp+var_4], 0"], [49, "mov eax, [rbp+var_4]"], [50, "leave"], [51, "retn"]], "data_dep": [[9, 8], [10, 4], [11, 10], [12, 9], [14, 12], [15, 8], [16, 15], [17, 16], [20, 3], [21, 5], [22, 20], [22, 21], [23, 3], [24, 9], [25, 23], [25, 24], [26, 10], [27, 9], [29, 27], [30, 26], [31, 3], [32, 31], [32, 30], [33, 3], [34, 33], [34, 32], [35, 34], [36, 7], [37, 36], [37, 35], [38, 37], [39, 38], [40, 35], [41, 6], [43, 41], [45, 3], [46, 6], [47, 46], [47, 45], [49, 18], [49, 48], [51, 49]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_41913D", "query": "\n\n\n__int64 __fastcall sub_41913D(__int64 a1, unsigned __int8 a2, unsigned __int16 a3, __int64 a4, void *a5, int a6)\n{\nif ( a3 % (int)a2 )\nreturn (unsigned int)-2;\n*(_QWORD *)(a1 + 8) = a4;\n*(_BYTE *)a1 = a2;\n*(_WORD *)(a1 + 2) = a3 / (int)a2;\nmemset(a5, 0, 4LL * ((unsigned int)*(unsigned __int16 *)(a1 + 2) + a6 - 1));\n*(_QWORD *)(a1 + 16) = a5;\nreturn 0;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,sub_41913D,]", "hints": "[]", "response": "{'a3': 'numTaps', 'a4': 'pCoeffs', 'a1': 'S', 'a2': 'L', 'a5': 'pState', 'a6': 'blockSize', 'sub_41913D': 'arm_fir_interpolate_init_q31'}"} | [
[
0.7308623194694519,
0.7229623198509216,
0.7189342379570007,
0.7086124420166016,
0.7083099484443665,
0.7081888914108276,
0.7076329588890076,
0.7014592885971069,
0.697819173336029,
0.6973770260810852,
0.6967742443084717,
0.6956947445869446,
0.6947121620178223,
0.6932346820831299,
0.6922996640205383,
0.6919543743133545,
0.6918739080429077,
0.6911787986755371,
0.690116286277771,
0.6860147714614868
],
[
188413,
11583,
177926,
86221,
42487,
20582,
42193,
137487,
35326,
4639,
165357,
61581,
96161,
35605,
89451,
43450,
244743,
130565,
100630,
217717
]
] |
|
intset_get | 0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10 | git-hulk | rdbtools | NA | uint8_t
intset_get(intset *is, int pos, int64_t *v)
{
int64_t v64;
int32_t v32;
int16_t v16;
if(pos >= is->length) return 0;
if (is->encoding == sizeof(int64_t)) {
memcpy(&v64, (int64_t*)is->contents + pos, sizeof(int64_t));
memrev64ifbe(&v64);
*v = v64;
} else if (is->encoding == sizeof(int32_t)) {
memcpy(&v32, (int32_t*)is->contents + pos, sizeof(int32_t));
memrev32ifbe(&v32);
*v = v32;
} else {
memcpy(&v16, (int16_t*)is->contents + pos, sizeof(int16_t));
memrev16ifbe(&v16);
*v = v16;
}
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40514A", "function_addr": 4215114, "binary_name": "0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_1C], esi"], [4, "mov [rbp+var_28], rdx"], [5, "mov rax, [rbp+var_18]"], [6, "mov edx, [rax+4]"], [7, "mov eax, [rbp+var_1C]"], [8, "cmp edx, eax"], [9, "ja short loc_405171"], [10, "mov eax, 0"], [11, "jmp loc_405205"], [12, "mov rax, [rbp+var_18]"], [13, "mov eax, [rax]"], [14, "cmp eax, 8"], [15, "jnz short loc_4051A4"], [16, "mov rax, [rbp+var_18]"], [17, "lea rdx, [rax+8]"], [18, "mov eax, [rbp+var_1C]"], [19, "cdqe"], [20, "shl rax, 3"], [21, "add rax, rdx"], [22, "mov rax, [rax]"], [23, "mov [rbp+var_8], rax"], [24, "mov rdx, [rbp+var_8]"], [25, "mov rax, [rbp+var_28]"], [26, "mov [rax], rdx"], [27, "jmp short loc_405200"], [28, "mov rax, [rbp+var_18]"], [29, "mov eax, [rax]"], [30, "cmp eax, 4"], [31, "jnz short loc_4051D7"], [32, "mov rax, [rbp+var_18]"], [33, "lea rdx, [rax+8]"], [34, "mov eax, [rbp+var_1C]"], [35, "cdqe"], [36, "shl rax, 2"], [37, "add rax, rdx"], [38, "mov eax, [rax]"], [39, "mov [rbp+var_C], eax"], [40, "mov eax, [rbp+var_C]"], [41, "movsxd rdx, eax"], [42, "mov rax, [rbp+var_28]"], [43, "mov [rax], rdx"], [44, "jmp short loc_405200"], [45, "mov rax, [rbp+var_18]"], [46, "lea rdx, [rax+8]"], [47, "mov eax, [rbp+var_1C]"], [48, "cdqe"], [49, "add rax, rax"], [50, "add rax, rdx"], [51, "movzx eax, word ptr [rax]"], [52, "mov [rbp+var_E], ax"], [53, "movzx eax, [rbp+var_E]"], [54, "movsx rdx, ax"], [55, "mov rax, [rbp+var_28]"], [56, "mov [rax], rdx"], [57, "mov eax, 1"], [58, "pop rbp"], [59, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 3], [8, 6], [8, 7], [9, 8], [12, 2], [13, 12], [14, 13], [15, 14], [16, 2], [17, 6], [17, 16], [18, 3], [20, 18], [21, 17], [21, 20], [22, 21], [23, 22], [24, 23], [25, 4], [26, 24], [26, 25], [28, 2], [29, 28], [30, 29], [31, 30], [32, 2], [33, 32], [33, 6], [34, 3], [36, 34], [37, 33], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 4], [43, 42], [43, 41], [45, 2], [46, 45], [46, 6], [47, 3], [49, 47], [50, 49], [50, 46], [51, 50], [52, 51], [53, 52], [54, 53], [55, 4], [56, 55], [56, 54], [58, 0], [59, 57], [59, 10]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10_0c27da15d5dd45985a08bca35522fdf320d5f2cd6f861b50d35132c427dded10.jsonl.gz", "strip_func_name": "sub_40514A", "query": "\n\n\n__int64 __fastcall sub_40514A(_DWORD *a1, unsigned int a2, _QWORD *a3)\n{\nif ( a1[1] <= a2 )\nreturn 0LL;\nif ( *a1 == 8 )\n{\n*a3 = *(_QWORD *)&a1[2 * a2 + 2];\n}\nelse if ( *a1 == 4 )\n{\n*a3 = (int)a1[a2 + 2];\n}\nelse\n{\n*a3 = *((__int16 *)a1 + (int)a2 + 4);\n}\nreturn 1LL;\n}\n\n\n\nQ:[a3,a1,a2,sub_40514A,]", "hints": "[]", "response": "{'a3': 'v', 'a1': 'is', 'a2': 'pos', 'sub_40514A': 'intset_get'}"} | [
[
0.7441542148590088,
0.73896324634552,
0.7237886190414429,
0.7099647521972656,
0.6898396611213684,
0.6888028383255005,
0.6830295324325562,
0.6816149353981018,
0.6796045303344727,
0.6759095191955566,
0.6754772663116455,
0.6722359657287598,
0.6708160042762756,
0.6691627502441406,
0.6665699481964111,
0.6527160406112671,
0.6523497700691223,
0.6517382860183716,
0.6468292474746704,
0.6465950012207031
],
[
93537,
161101,
25305,
86815,
209392,
231747,
93485,
47418,
19865,
208337,
63065,
140385,
78669,
1870,
80607,
232574,
59964,
215720,
49721,
211495
]
] |
|
lsi_open | 88c501a41d9851acc25937b22e4b2c2f42f4fb74f846a5aa6506acc26f42bbba | marcan | lsirec | NA | static int lsi_open(const char *pci_id, lsi_dev_t *d)
{
char path[128];
memset(d, 0, sizeof(*d));
if (strlen(pci_id) > 15)
return -1;
strcpy(d->pci_id, pci_id);
sprintf(path, "/sys/bus/pci/devices/%s/resource1", pci_id);
int fd = open(path, O_RDWR);
if (fd < 0) {
perror("open bar1");
return fd;
}
d->bar1 = mmap(NULL, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (d->bar1 == MAP_FAILED) {
perror("mmap bar1");
return -1;
}
close(fd);
return lsi_reopen(d);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4016C2", "function_addr": 4200130, "binary_name": "88c501a41d9851acc25937b22e4b2c2f42f4fb74f846a5aa6506acc26f42bbba.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+src], rdi"], [4, "mov [rbp+s], rsi"], [5, "mov rax, [rbp+s]"], [6, "mov edx, 40h "], [7, "mov esi, 0"], [8, "mov rdi, rax"], [9, "call _memset"], [10, "mov rax, [rbp+src]"], [11, "mov rdi, rax"], [12, "call _strlen"], [13, "cmp rax, 0Fh"], [14, "jbe short loc_401713"], [15, "mov eax, 0FFFFFFFFh"], [16, "jmp locret_4017E8"], [17, "mov rax, [rbp+s]"], [18, "mov rdx, [rbp+src]"], [19, "mov rsi, rdx"], [20, "mov rdi, rax"], [21, "call _strcpy"], [22, "mov rdx, [rbp+src]"], [23, "lea rax, [rbp+file]"], [24, "mov esi, offset format"], [25, "mov rdi, rax"], [26, "mov eax, 0"], [27, "call _sprintf"], [28, "lea rax, [rbp+file]"], [29, "mov esi, 2"], [30, "mov rdi, rax"], [31, "mov eax, 0"], [32, "call _open"], [33, "mov [rbp+fd], eax"], [34, "cmp [rbp+fd], 0"], [35, "jns short loc_40177D"], [36, "mov edi, offset aOpenBar1"], [37, "call _perror"], [38, "mov eax, [rbp+fd]"], [39, "jmp short locret_4017E8"], [40, "mov eax, [rbp+fd]"], [41, "mov r9d, 0"], [42, "mov r8d, eax"], [43, "mov ecx, 1"], [44, "mov edx, 3"], [45, "mov esi, 1000h"], [46, "mov edi, 0"], [47, "call _mmap"], [48, "mov rdx, [rbp+s]"], [49, "mov [rdx+10h], rax"], [50, "mov rax, [rbp+s]"], [51, "mov rax, [rax+10h]"], [52, "cmp rax, 0FFFFFFFFFFFFFFFFh"], [53, "jnz short loc_4017CF"], [54, "mov edi, offset aMmapBar1"], [55, "call _perror"], [56, "mov eax, 0FFFFFFFFh"], [57, "jmp short locret_4017E8"], [58, "mov eax, [rbp+fd]"], [59, "mov edi, eax"], [60, "call _close"], [61, "mov rax, [rbp+s]"], [62, "mov rdi, rax"], [63, "call sub_401488"], [64, "leave"], [65, "retn"]], "data_dep": [[5, 4], [8, 5], [10, 3], [11, 10], [13, 12], [14, 13], [17, 4], [18, 3], [19, 18], [20, 17], [22, 3], [23, 21], [25, 23], [28, 27], [30, 28], [33, 32], [34, 33], [35, 34], [38, 33], [40, 33], [42, 40], [48, 4], [49, 47], [49, 48], [50, 4], [51, 50], [51, 49], [52, 51], [53, 52], [58, 33], [59, 58], [61, 4], [62, 61], [65, 15], [65, 63], [65, 38], [65, 56]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/88c501a41d9851acc25937b22e4b2c2f42f4fb74f846a5aa6506acc26f42bbba_88c501a41d9851acc25937b22e4b2c2f42f4fb74f846a5aa6506acc26f42bbba.jsonl.gz", "strip_func_name": "sub_4016C2", "query": "\n\n\n__int64 __fastcall sub_4016C2(const char *a1, _QWORD *a2)\n{\n__int64 result; // rax\nchar file[140]; // [rsp+10h] [rbp-90h] BYREF\nint fd; // [rsp+9Ch] [rbp-4h]\n\nmemset(a2, 0, 0x40uLL);\nif ( strlen(a1) > 0xF )\nreturn 0xFFFFFFFFLL;\nstrcpy((char *)a2, a1);\nsprintf(file, \"/sys/bus/pci/devices/%s/resource1\", a1);\nfd = open(file, 2);\nif ( fd >= 0 )\n{\na2[2] = mmap(0LL, 0x1000uLL, 3, 1, fd, 0LL);\nif ( a2[2] == -1LL )\n{\nperror(\"mmap bar1\");\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nclose(fd);\nresult = sub_401488((unsigned int *)a2);\n}\n}\nelse\n{\nperror(\"open bar1\");\nresult = (unsigned int)fd;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,file,sub_4016C2,sub_401488,]", "hints": "[]", "response": "{'a1': 'pci_id', 'a2': 'd', 'file': 'path', 'sub_4016C2': 'lsi_open', 'sub_401488': 'lsi_reopen'}"} | [
[
0.8268500566482544,
0.8204723596572876,
0.8089803457260132,
0.7764920592308044,
0.767683744430542,
0.7561803460121155,
0.7492296099662781,
0.7400152087211609,
0.7368617653846741,
0.7337899804115295,
0.7334499359130859,
0.7332984805107117,
0.7325351238250732,
0.7236751914024353,
0.7194262146949768,
0.7188645601272583,
0.714198112487793,
0.7131921648979187,
0.7107380032539368,
0.7074659466743469
],
[
108723,
210363,
56740,
240178,
93214,
181162,
114891,
202883,
58689,
221600,
264088,
131402,
193472,
196895,
110009,
147219,
74338,
1077,
159715,
137974
]
] |
|
removePitchSamples | d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f | waywardgeek | sonic | NA | static void removePitchSamples(sonicStream stream, int numSamples) {
int numChannels = stream->numChannels;
short* source = stream->pitchBuffer + numSamples * numChannels;
if (numSamples == 0) {
return;
}
if (numSamples != stream->numPitchSamples) {
memmove(
stream->pitchBuffer, source,
(stream->numPitchSamples - numSamples) * sizeof(short) * numChannels);
}
stream->numPitchSamples -= numSamples;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403C4D", "function_addr": 4209741, "binary_name": "d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_1C], esi"], [5, "mov rax, [rbp+var_18]"], [6, "mov eax, [rax+50h]"], [7, "mov [rbp+var_4], eax"], [8, "mov rax, [rbp+var_18]"], [9, "mov rdx, [rax+10h]"], [10, "mov eax, [rbp+var_1C]"], [11, "imul eax, [rbp+var_4]"], [12, "cdqe"], [13, "add rax, rax"], [14, "add rax, rdx"], [15, "mov [rbp+src], rax"], [16, "cmp [rbp+var_1C], 0"], [17, "jz short loc_403CD9"], [18, "mov rax, [rbp+var_18]"], [19, "mov eax, [rax+68h]"], [20, "cmp [rbp+var_1C], eax"], [21, "jz short loc_403CC4"], [22, "mov rax, [rbp+var_18]"], [23, "mov eax, [rax+68h]"], [24, "sub eax, [rbp+var_1C]"], [25, "movsxd rdx, eax"], [26, "mov eax, [rbp+var_4]"], [27, "cdqe"], [28, "imul rax, rdx"], [29, "lea rdx, [rax+rax]"], [30, "mov rax, [rbp+var_18]"], [31, "mov rax, [rax+10h]"], [32, "mov rcx, [rbp+src]"], [33, "mov rsi, rcx"], [34, "mov rdi, rax"], [35, "call _memmove"], [36, "mov rax, [rbp+var_18]"], [37, "mov eax, [rax+68h]"], [38, "sub eax, [rbp+var_1C]"], [39, "mov edx, eax"], [40, "mov rax, [rbp+var_18]"], [41, "mov [rax+68h], edx"], [42, "jmp short locret_403CDA"], [43, "nop"], [44, "leave"], [45, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 3], [9, 8], [10, 4], [11, 7], [11, 10], [13, 11], [14, 13], [14, 9], [15, 14], [16, 4], [17, 16], [18, 3], [19, 18], [20, 4], [20, 19], [21, 20], [22, 3], [23, 22], [24, 23], [24, 4], [25, 24], [26, 7], [28, 26], [28, 25], [29, 25], [29, 28], [30, 3], [31, 30], [32, 15], [33, 32], [34, 31], [36, 3], [37, 36], [38, 4], [38, 37], [39, 38], [40, 3], [41, 40], [41, 39], [45, 40], [45, 14]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f_d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f.jsonl.gz", "strip_func_name": "sub_403C4D", "query": "\n\n\n__int64 __fastcall sub_403C4D(__int64 a1, int a2)\n{\n__int64 result; // rax\nint v3; // [rsp+1Ch] [rbp-4h]\n\nv3 = *(_DWORD *)(a1 + 80);\nresult = *(_QWORD *)(a1 + 16) + 2LL * v3 * a2;\nif ( a2 )\n{\nif ( a2 != *(_DWORD *)(a1 + 104) )\nmemmove(\n*(void **)(a1 + 16),\n(const void *)(*(_QWORD *)(a1 + 16) + 2LL * v3 * a2),\n2 * (*(_DWORD *)(a1 + 104) - a2) * (__int64)v3);\nresult = a1;\n*(_DWORD *)(a1 + 104) -= a2;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_403C4D,]", "hints": "[]", "response": "{'a1': 'stream', 'a2': 'numSamples', 'sub_403C4D': 'removePitchSamples'}"} | [
[
0.8084685802459717,
0.7893750071525574,
0.7857092618942261,
0.7857069969177246,
0.7811076045036316,
0.7756469249725342,
0.7641301155090332,
0.7638410925865173,
0.7545207738876343,
0.7540786266326904,
0.7501762509346008,
0.745856761932373,
0.7445055842399597,
0.7407365441322327,
0.7372089624404907,
0.7339162826538086,
0.7337645292282104,
0.7328070998191833,
0.7273545861244202,
0.7271228432655334
],
[
168609,
105432,
211196,
182112,
154422,
25526,
145631,
243705,
241033,
161462,
36912,
136295,
69719,
98894,
77938,
186151,
72729,
141538,
204859,
108073
]
] |
|
utf8_nbytes | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | uint32_t utf8_nbytes (uint32_t n) {
if (n <= 0x7f) return 1; // 127
if (n <= 0x7ff) return 2; // 2047
if (n <= 0xffff) return 3; // 65535
if (n <= 0x10ffff) return 4; // 1114111
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_45F861", "function_addr": 4585569, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "cmp [rbp+var_4], 7Fh"], [4, "ja short loc_45F875"], [5, "mov eax, 1"], [6, "jmp short loc_45F8AA"], [7, "cmp [rbp+var_4], 7FFh"], [8, "ja short loc_45F885"], [9, "mov eax, 2"], [10, "jmp short loc_45F8AA"], [11, "cmp [rbp+var_4], 0FFFFh"], [12, "ja short loc_45F895"], [13, "mov eax, 3"], [14, "jmp short loc_45F8AA"], [15, "cmp [rbp+var_4], 10FFFFh"], [16, "ja short loc_45F8A5"], [17, "mov eax, 4"], [18, "jmp short loc_45F8AA"], [19, "mov eax, 0"], [20, "pop rbp"], [21, "retn"]], "data_dep": [[3, 2], [4, 3], [7, 2], [8, 7], [11, 2], [12, 11], [15, 2], [16, 15], [20, 0], [21, 19], [21, 9], [21, 13], [21, 5], [21, 17]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_45F861", "query": "\n\n\n__int64 __fastcall sub_45F861(unsigned int a1)\n{\nif ( a1 <= 0x7F )\nreturn 1LL;\nif ( a1 <= 0x7FF )\nreturn 2LL;\nif ( a1 <= 0xFFFF )\nreturn 3LL;\nif ( a1 > 0x10FFFF )\nreturn 0LL;\nreturn 4LL;\n}\n\n\n\nQ:[a1,sub_45F861,]", "hints": "[]", "response": "{'a1': 'n', 'sub_45F861': 'utf8_nbytes'}"} | [
[
0.8573290109634399,
0.8542485237121582,
0.8454738259315491,
0.8307126760482788,
0.8128742575645447,
0.8123088479042053,
0.8107717037200928,
0.8104982376098633,
0.8092803955078125,
0.8061350584030151,
0.8050591945648193,
0.798660159111023,
0.7950607538223267,
0.791621744632721,
0.7896085977554321,
0.7862898707389832,
0.7751560211181641,
0.7698922157287598,
0.7683383226394653,
0.7584840059280396
],
[
40556,
155759,
72780,
66563,
156803,
44146,
115787,
4202,
256719,
36600,
129465,
165274,
14301,
161222,
90657,
254167,
85100,
65943,
73605,
151608
]
] |
|
jsont_reset | 47f71cd70792a360c9603b3c792c3a37bd79dc8802def80796c67c9fb467a470 | rsms | jsont | NA | void jsont_reset(jsont_ctx_t* ctx, const uint8_t* bytes, size_t length) {
ctx->input_buf_ptr = ctx->input_buf = bytes;
ctx->input_len = length;
ctx->st_stack_len = 0;
ctx->curr_tok = JSONT_END;
ctx->input_buf_value_start = 0;
ctx->input_buf_value_end = 0;
ctx->value_buf.length = 0;
ctx->value_buf.inuse = false;
ctx->error_info = 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40131D", "function_addr": 4199197, "binary_name": "47f71cd70792a360c9603b3c792c3a37bd79dc8802def80796c67c9fb467a470.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov [rbp+var_18], rdx"], [5, "mov rax, [rbp+var_8]"], [6, "mov rdx, [rbp+var_10]"], [7, "mov [rax+8], rdx"], [8, "mov rax, [rbp+var_8]"], [9, "mov rdx, [rax+8]"], [10, "mov rax, [rbp+var_8]"], [11, "mov [rax+10h], rdx"], [12, "mov rax, [rbp+var_8]"], [13, "mov rdx, [rbp+var_18]"], [14, "mov [rax+18h], rdx"], [15, "mov rax, [rbp+var_8]"], [16, "mov qword ptr [rax+68h], 0"], [17, "mov rax, [rbp+var_8]"], [18, "mov byte ptr [rax+58h], 0"], [19, "mov rax, [rbp+var_8]"], [20, "mov qword ptr [rax+20h], 0"], [21, "mov rax, [rbp+var_8]"], [22, "mov qword ptr [rax+28h], 0"], [23, "mov rax, [rbp+var_8]"], [24, "mov qword ptr [rax+40h], 0"], [25, "mov rax, [rbp+var_8]"], [26, "mov byte ptr [rax+48h], 0"], [27, "mov rax, [rbp+var_8]"], [28, "mov qword ptr [rax+50h], 0"], [29, "nop"], [30, "pop rbp"], [31, "retn"]], "data_dep": [[5, 2], [6, 3], [7, 6], [7, 5], [8, 2], [9, 8], [9, 7], [10, 2], [11, 10], [11, 9], [12, 2], [13, 4], [14, 13], [14, 12], [15, 2], [16, 15], [17, 2], [18, 17], [19, 2], [20, 19], [21, 2], [22, 21], [23, 2], [24, 23], [25, 2], [26, 25], [27, 2], [28, 27], [30, 0], [31, 27]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/47f71cd70792a360c9603b3c792c3a37bd79dc8802def80796c67c9fb467a470_47f71cd70792a360c9603b3c792c3a37bd79dc8802def80796c67c9fb467a470.jsonl.gz", "strip_func_name": "sub_40131D", "query": "\n\n\n__int64 __fastcall sub_40131D(__int64 a1, __int64 a2, __int64 a3)\n{\n__int64 result; // rax\n\n*(_QWORD *)(a1 + 8) = a2;\n*(_QWORD *)(a1 + 16) = *(_QWORD *)(a1 + 8);\n*(_QWORD *)(a1 + 24) = a3;\n*(_QWORD *)(a1 + 104) = 0LL;\n*(_BYTE *)(a1 + 88) = 0;\n*(_QWORD *)(a1 + 32) = 0LL;\n*(_QWORD *)(a1 + 40) = 0LL;\n*(_QWORD *)(a1 + 64) = 0LL;\n*(_BYTE *)(a1 + 72) = 0;\nresult = a1;\n*(_QWORD *)(a1 + 80) = 0LL;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_40131D,]", "hints": "[]", "response": "{'a3': 'length', 'a1': 'ctx', 'a2': 'bytes', 'sub_40131D': 'jsont_reset'}"} | [
[
0.8139806985855103,
0.8009896874427795,
0.7919498085975647,
0.7902147769927979,
0.788057267665863,
0.7852168083190918,
0.7812656760215759,
0.7776405811309814,
0.7759997844696045,
0.7757362723350525,
0.7748986482620239,
0.7744154930114746,
0.7728422284126282,
0.771955668926239,
0.7711000442504883,
0.7681828141212463,
0.7668355703353882,
0.7652944326400757,
0.7641829252243042,
0.7641760110855103
],
[
205869,
197269,
131558,
236691,
246990,
201715,
212099,
247419,
229636,
91783,
49467,
103631,
121394,
15540,
231686,
21872,
167566,
205244,
257213,
254102
]
] |
|
StdioFprintfWord | 001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13 | larryhe | tiny-c-interpreter | NA | void StdioFprintfWord(StdOutStream *Stream, const char *Format, unsigned int Value)
{
if (Stream->FilePtr != NULL)
Stream->CharCount += fprintf(Stream->FilePtr, Format, Value);
else if (Stream->StrOutLen >= 0)
{
int CCount = snprintf(Stream->StrOutPtr, Stream->StrOutLen, Format, Value);
Stream->StrOutPtr += CCount;
Stream->StrOutLen -= CCount;
Stream->CharCount += CCount;
}
else
{
int CCount = sprintf(Stream->StrOutPtr, Format, Value);
Stream->CharCount += CCount;
Stream->StrOutPtr += CCount;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_411D3A", "function_addr": 4267322, "binary_name": "001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+format], rsi"], [5, "mov [rbp+var_24], edx"], [6, "mov rax, [rbp+var_18]"], [7, "mov rax, [rax]"], [8, "test rax, rax"], [9, "jz short loc_411D8E"], [10, "mov rax, [rbp+var_18]"], [11, "mov rax, [rax]"], [12, "mov edx, [rbp+var_24]"], [13, "mov rcx, [rbp+format]"], [14, "mov rsi, rcx"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _fprintf"], [18, "mov edx, eax"], [19, "mov rax, [rbp+var_18]"], [20, "mov eax, [rax+14h]"], [21, "add edx, eax"], [22, "mov rax, [rbp+var_18]"], [23, "mov [rax+14h], edx"], [24, "jmp loc_411E4F"], [25, "mov rax, [rbp+var_18]"], [26, "mov eax, [rax+10h]"], [27, "test eax, eax"], [28, "js short loc_411E02"], [29, "mov rax, [rbp+var_18]"], [30, "mov eax, [rax+10h]"], [31, "movsxd rsi, eax"], [32, "mov rax, [rbp+var_18]"], [33, "mov rax, [rax+8]"], [34, "mov ecx, [rbp+var_24]"], [35, "mov rdx, [rbp+format]"], [36, "mov rdi, rax"], [37, "mov eax, 0"], [38, "call _snprintf"], [39, "mov [rbp+var_8], eax"], [40, "mov rax, [rbp+var_18]"], [41, "mov rdx, [rax+8]"], [42, "mov eax, [rbp+var_8]"], [43, "cdqe"], [44, "add rdx, rax"], [45, "mov rax, [rbp+var_18]"], [46, "mov [rax+8], rdx"], [47, "mov rax, [rbp+var_18]"], [48, "mov eax, [rax+10h]"], [49, "sub eax, [rbp+var_8]"], [50, "mov edx, eax"], [51, "mov rax, [rbp+var_18]"], [52, "mov [rax+10h], edx"], [53, "mov rax, [rbp+var_18]"], [54, "mov edx, [rax+14h]"], [55, "mov eax, [rbp+var_8]"], [56, "add edx, eax"], [57, "mov rax, [rbp+var_18]"], [58, "mov [rax+14h], edx"], [59, "jmp short loc_411E4F"], [60, "mov rax, [rbp+var_18]"], [61, "mov rax, [rax+8]"], [62, "mov edx, [rbp+var_24]"], [63, "mov rcx, [rbp+format]"], [64, "mov rsi, rcx"], [65, "mov rdi, rax"], [66, "mov eax, 0"], [67, "call _sprintf"], [68, "mov [rbp+var_4], eax"], [69, "mov rax, [rbp+var_18]"], [70, "mov edx, [rax+14h]"], [71, "mov eax, [rbp+var_4]"], [72, "add edx, eax"], [73, "mov rax, [rbp+var_18]"], [74, "mov [rax+14h], edx"], [75, "mov rax, [rbp+var_18]"], [76, "mov rdx, [rax+8]"], [77, "mov eax, [rbp+var_4]"], [78, "cdqe"], [79, "add rdx, rax"], [80, "mov rax, [rbp+var_18]"], [81, "mov [rax+8], rdx"], [82, "nop"], [83, "leave"], [84, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 3], [11, 10], [12, 5], [13, 4], [14, 13], [15, 11], [18, 17], [19, 3], [20, 19], [21, 18], [21, 20], [22, 3], [23, 22], [23, 21], [25, 3], [26, 25], [27, 26], [28, 27], [29, 3], [30, 29], [31, 30], [32, 3], [33, 32], [34, 5], [35, 4], [36, 33], [39, 38], [40, 3], [41, 40], [42, 39], [44, 42], [44, 41], [45, 3], [46, 45], [46, 44], [47, 3], [48, 47], [48, 46], [49, 39], [49, 48], [50, 49], [51, 3], [52, 51], [52, 50], [53, 3], [54, 53], [54, 52], [55, 39], [56, 55], [56, 54], [57, 3], [58, 56], [58, 57], [60, 3], [61, 60], [62, 5], [63, 4], [64, 63], [65, 61], [68, 67], [69, 3], [70, 69], [71, 68], [72, 70], [72, 71], [73, 3], [74, 73], [74, 72], [75, 3], [76, 74], [76, 75], [77, 68], [79, 76], [79, 77], [80, 3], [81, 80], [81, 79], [84, 22], [84, 57], [84, 80]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13_001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13.jsonl.gz", "strip_func_name": "sub_411D3A", "query": "\n\n\n__int64 __fastcall sub_411D3A(__int64 a1, const char *a2, unsigned int a3)\n{\nint v3; // edx\n__int64 result; // rax\nint v5; // eax\nint v6; // edx\nint v7; // eax\n__int64 v8; // rdx\n\nif ( *(_QWORD *)a1 )\n{\nv3 = *(_DWORD *)(a1 + 20) + fprintf(*(FILE **)a1, a2, a3);\nresult = a1;\n*(_DWORD *)(a1 + 20) = v3;\n}\nelse if ( *(int *)(a1 + 16) < 0 )\n{\nv7 = sprintf(*(char **)(a1 + 8), a2, a3);\n*(_DWORD *)(a1 + 20) += v7;\nv8 = v7 + *(_QWORD *)(a1 + 8);\nresult = a1;\n*(_QWORD *)(a1 + 8) = v8;\n}\nelse\n{\nv5 = snprintf(*(char **)(a1 + 8), *(int *)(a1 + 16), a2, a3);\n*(_QWORD *)(a1 + 8) += v5;\n*(_DWORD *)(a1 + 16) -= v5;\nv6 = v5 + *(_DWORD *)(a1 + 20);\nresult = a1;\n*(_DWORD *)(a1 + 20) = v6;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v8,sub_411D3A,]", "hints": "[]", "response": "{'a3': 'Value', 'a1': 'Stream', 'a2': 'Format', 'v8': 'Value', 'sub_411D3A': 'StdioFprintfWord'}"} | [
[
0.7549539804458618,
0.7519282102584839,
0.7429950833320618,
0.7266712784767151,
0.7257161140441895,
0.7216858863830566,
0.7183545827865601,
0.7116407155990601,
0.7070876359939575,
0.7032099962234497,
0.7010251879692078,
0.7000652551651001,
0.6994086503982544,
0.6990728974342346,
0.6990728974342346,
0.6973063945770264,
0.695027768611908,
0.6946048736572266,
0.6939595937728882,
0.6932953000068665
],
[
30917,
47302,
19403,
98113,
190816,
203865,
82361,
253192,
188929,
107011,
114892,
110291,
61705,
25018,
179756,
154422,
124179,
259253,
131834,
46875
]
] |
|
setup_regs | ef6b4f95e3562335c5d08e18e7bf907d0be250d8b01d1e188e121c3a5f912f9f | david942j | kvm-kernel-example | NA | void setup_regs(VM *vm, size_t entry) {
struct kvm_regs regs;
if(ioctl(vm->vcpufd, KVM_GET_REGS, ®s) < 0) pexit("ioctl(KVM_GET_REGS)");
regs.rip = entry;
regs.rsp = PS_LIMIT; /* temporary stack */
regs.rdi = PS_LIMIT; /* start of free pages */
regs.rsi = MEM_SIZE - regs.rdi; /* total length of free pages */
regs.rflags = 0x2;
if(ioctl(vm->vcpufd, KVM_SET_REGS, ®s) < 0) pexit("ioctl(KVM_SET_REGS");
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40141E", "function_addr": 4199454, "binary_name": "ef6b4f95e3562335c5d08e18e7bf907d0be250d8b01d1e188e121c3a5f912f9f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+var_98], rdi"], [4, "mov [rbp+var_A0], rsi"], [5, "mov rax, [rbp+var_98]"], [6, "mov eax, [rax+10h]"], [7, "lea rdx, [rbp+var_90]"], [8, "mov esi, 8090AE81h"], [9, "mov edi, eax"], [10, "mov eax, 0"], [11, "call _ioctl"], [12, "test eax, eax"], [13, "jns short loc_401471"], [14, "mov edi, offset aIoctlKvmGetReg"], [15, "call _perror"], [16, "mov edi, 1"], [17, "call _exit"], [18, "mov rax, [rbp+var_A0]"], [19, "mov [rbp+var_10], rax"], [20, "mov [rbp+var_60], 200000h"], [21, "mov [rbp+var_68], 200000h"], [22, "mov rdx, [rbp+var_68]"], [23, "mov eax, offset dword_400000"], [24, "sub rax, rdx"], [25, "mov [rbp+var_70], rax"], [26, "mov [rbp+var_8], 2"], [27, "mov rax, [rbp+var_98]"], [28, "mov eax, [rax+10h]"], [29, "lea rdx, [rbp+var_90]"], [30, "mov esi, 4090AE82h"], [31, "mov edi, eax"], [32, "mov eax, 0"], [33, "call _ioctl"], [34, "test eax, eax"], [35, "jns short loc_4014DE"], [36, "mov edi, offset aIoctlKvmSetReg"], [37, "call _perror"], [38, "mov edi, 1"], [39, "call _exit"], [40, "nop"], [41, "leave"], [42, "retn"]], "data_dep": [[5, 3], [6, 5], [9, 6], [12, 11], [13, 12], [18, 4], [19, 18], [22, 21], [24, 23], [24, 22], [25, 24], [27, 3], [28, 27], [29, 22], [31, 28], [34, 33], [35, 34], [42, 34]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ef6b4f95e3562335c5d08e18e7bf907d0be250d8b01d1e188e121c3a5f912f9f_ef6b4f95e3562335c5d08e18e7bf907d0be250d8b01d1e188e121c3a5f912f9f.jsonl.gz", "strip_func_name": "sub_40141E", "query": "\n\n\nint __fastcall sub_40141E(__int64 a1, __int64 a2)\n{\nint result; // eax\nchar v3[32]; // [rsp+10h] [rbp-90h] BYREF\nint *v4; // [rsp+30h] [rbp-70h]\n__int64 v5; // [rsp+38h] [rbp-68h]\n__int64 v6; // [rsp+40h] [rbp-60h]\n__int64 v7; // [rsp+90h] [rbp-10h]\n__int64 v8; // [rsp+98h] [rbp-8h]\n\nif ( ioctl(*(_DWORD *)(a1 + 16), 0x8090AE81uLL, v3) < 0 )\n{\nperror(\"ioctl(KVM_GET_REGS)\");\nexit(1);\n}\nv7 = a2;\nv6 = 0x200000LL;\nv5 = 0x200000LL;\nv4 = &dword_400000 - 0x80000;\nv8 = 2LL;\nresult = ioctl(*(_DWORD *)(a1 + 16), 0x4090AE82uLL, v3);\nif ( result < 0 )\n{\nperror(\"ioctl(KVM_SET_REGS\");\nexit(1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,sub_40141E,]", "hints": "[]", "response": "{'a1': 'vm', 'a2': 'entry', 'v3': 'regs', 'sub_40141E': 'setup_regs'}"} | [
[
0.8213226199150085,
0.7019180059432983,
0.6839205026626587,
0.676522970199585,
0.6722120046615601,
0.6656995415687561,
0.664865255355835,
0.6617373824119568,
0.6596800088882446,
0.6571910977363586,
0.6504321694374084,
0.6464678049087524,
0.6438654661178589,
0.6415371894836426,
0.6411195993423462,
0.6408328413963318,
0.6405913829803467,
0.639130711555481,
0.6369460225105286,
0.6358280181884766
],
[
116958,
20430,
67023,
141350,
201814,
246197,
210782,
99082,
189005,
178332,
249169,
97454,
208432,
188451,
211018,
144990,
92742,
161825,
65296,
193204
]
] |
|
readUnsignedLeb128 | a0f399891273e23a58e7e3b5a6240aa97832171291b259173fe1fd16b1d0f5db | poliva | dexinfo | NA | int readUnsignedLeb128(u1** pStream)
{
/* taken from dalvik's libdex/Leb128.h */
u1* ptr = *pStream;
int result = *(ptr++);
if (result > 0x7f) {
int cur = *(ptr++);
result = (result & 0x7f) | ((cur & 0x7f) << 7);
if (cur > 0x7f) {
cur = *(ptr++);
result |= (cur & 0x7f) << 14;
if (cur > 0x7f) {
cur = *(ptr++);
result |= (cur & 0x7f) << 21;
if (cur > 0x7f) {
/*
* Note: We don't check to see if cur is out of
* range here, meaning we tolerate garbage in the
* high four-order bits.
*/
cur = *(ptr++);
result |= cur << 28;
}
}
}
}
*pStream = ptr;
return result;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401202", "function_addr": 4198914, "binary_name": "a0f399891273e23a58e7e3b5a6240aa97832171291b259173fe1fd16b1d0f5db.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov rax, [rbp+var_18]"], [4, "mov rax, [rax]"], [5, "mov [rbp+var_8], rax"], [6, "mov rax, [rbp+var_8]"], [7, "lea rdx, [rax+1]"], [8, "mov [rbp+var_8], rdx"], [9, "movzx eax, byte ptr [rax]"], [10, "movzx eax, al"], [11, "mov [rbp+var_C], eax"], [12, "cmp [rbp+var_C], 7Fh"], [13, "jle loc_4012D7"], [14, "mov rax, [rbp+var_8]"], [15, "lea rdx, [rax+1]"], [16, "mov [rbp+var_8], rdx"], [17, "movzx eax, byte ptr [rax]"], [18, "movzx eax, al"], [19, "mov [rbp+var_10], eax"], [20, "mov eax, [rbp+var_C]"], [21, "and eax, 7Fh"], [22, "mov edx, eax"], [23, "mov eax, [rbp+var_10]"], [24, "shl eax, 7"], [25, "and eax, 3F80h"], [26, "or eax, edx"], [27, "mov [rbp+var_C], eax"], [28, "cmp [rbp+var_10], 7Fh"], [29, "jle short loc_4012D7"], [30, "mov rax, [rbp+var_8]"], [31, "lea rdx, [rax+1]"], [32, "mov [rbp+var_8], rdx"], [33, "movzx eax, byte ptr [rax]"], [34, "movzx eax, al"], [35, "mov [rbp+var_10], eax"], [36, "mov eax, [rbp+var_10]"], [37, "shl eax, 0Eh"], [38, "and eax, 1FC000h"], [39, "or [rbp+var_C], eax"], [40, "cmp [rbp+var_10], 7Fh"], [41, "jle short loc_4012D7"], [42, "mov rax, [rbp+var_8]"], [43, "lea rdx, [rax+1]"], [44, "mov [rbp+var_8], rdx"], [45, "movzx eax, byte ptr [rax]"], [46, "movzx eax, al"], [47, "mov [rbp+var_10], eax"], [48, "mov eax, [rbp+var_10]"], [49, "shl eax, 15h"], [50, "and eax, 0FE00000h"], [51, "or [rbp+var_C], eax"], [52, "cmp [rbp+var_10], 7Fh"], [53, "jle short loc_4012D7"], [54, "mov rax, [rbp+var_8]"], [55, "lea rdx, [rax+1]"], [56, "mov [rbp+var_8], rdx"], [57, "movzx eax, byte ptr [rax]"], [58, "movzx eax, al"], [59, "mov [rbp+var_10], eax"], [60, "mov eax, [rbp+var_10]"], [61, "shl eax, 1Ch"], [62, "or [rbp+var_C], eax"], [63, "mov rax, [rbp+var_18]"], [64, "mov rdx, [rbp+var_8]"], [65, "mov [rax], rdx"], [66, "mov eax, [rbp+var_C]"], [67, "pop rbp"], [68, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 6], [10, 9], [11, 10], [12, 11], [13, 12], [14, 8], [15, 14], [15, 7], [16, 15], [17, 14], [18, 17], [19, 18], [20, 11], [21, 20], [22, 21], [23, 19], [24, 23], [25, 24], [26, 25], [26, 22], [27, 26], [28, 19], [29, 28], [30, 16], [31, 22], [31, 30], [32, 31], [33, 30], [34, 33], [35, 34], [36, 35], [37, 36], [38, 37], [39, 27], [39, 38], [40, 35], [41, 40], [42, 32], [43, 31], [43, 42], [44, 43], [45, 42], [46, 45], [47, 46], [48, 47], [49, 48], [50, 49], [51, 50], [51, 39], [52, 47], [53, 52], [54, 44], [55, 43], [55, 54], [56, 55], [57, 54], [58, 57], [59, 58], [60, 59], [61, 60], [62, 61], [62, 51], [63, 2], [64, 32], [64, 16], [64, 8], [64, 56], [64, 44], [65, 63], [65, 64], [66, 39], [66, 62], [66, 11], [66, 27], [66, 51], [67, 0], [68, 66]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a0f399891273e23a58e7e3b5a6240aa97832171291b259173fe1fd16b1d0f5db_a0f399891273e23a58e7e3b5a6240aa97832171291b259173fe1fd16b1d0f5db.jsonl.gz", "strip_func_name": "sub_401202", "query": "\n\n\n__int64 __fastcall sub_401202(__int64 *a1)\n{\nunsigned __int8 *v1; // rax\nunsigned __int8 *v2; // rax\nunsigned __int8 *v3; // rax\nunsigned int v5; // [rsp+Ch] [rbp-Ch]\n__int64 v6; // [rsp+10h] [rbp-8h]\n\nv6 = *a1 + 1;\nv5 = *(unsigned __int8 *)*a1;\nif ( v5 > 0x7F )\n{\nv1 = (unsigned __int8 *)(*a1 + 1);\nv6 = *a1 + 2;\nv5 = v5 & 0x7F | (*v1 << 7) & 0x3F80;\nif ( *v1 > 0x7Fu )\n{\nv2 = (unsigned __int8 *)(*a1 + 2);\nv6 = *a1 + 3;\nv5 |= (*v2 << 14) & 0x1FC000;\nif ( *v2 > 0x7Fu )\n{\nv3 = (unsigned __int8 *)(*a1 + 3);\nv6 = *a1 + 4;\nv5 |= (*v3 << 21) & 0xFE00000;\nif ( *v3 > 0x7Fu )\n{\nv6 = *a1 + 5;\nv5 |= *(unsigned __int8 *)(*a1 + 4) << 28;\n}\n}\n}\n}\n*a1 = v6;\nreturn v5;\n}\n\n\n\nQ:[a1,v5,v6,sub_401202,]", "hints": "[]", "response": "{'a1': 'pStream', 'v5': 'result', 'v6': 'ptr', 'sub_401202': 'readUnsignedLeb128'}"} | [
[
0.9390816688537598,
0.9321156740188599,
0.9304934740066528,
0.9304863214492798,
0.8515752553939819,
0.7968735694885254,
0.7720983624458313,
0.7706669569015503,
0.7321922779083252,
0.7305864095687866,
0.727292537689209,
0.7262465953826904,
0.7249040007591248,
0.7228514552116394,
0.7202056646347046,
0.7198195457458496,
0.7189924716949463,
0.7186892032623291,
0.7169750332832336,
0.7148501873016357
],
[
57633,
246359,
130498,
90367,
12056,
225772,
107521,
171070,
258698,
115093,
179119,
99299,
50659,
204011,
183984,
172511,
70402,
82682,
148504,
226628
]
] |
|
strike | 2901034b1c1a3c4f50cb14bdef15ccddfd1f9ed7456083acd69316c84c222a18 | 42Paris | remote-challenges | NA | static char strike(char row, char col)
{
char shoot[3];
char result;
char tmp;
shoot[0] = row + 'A';
shoot[1] = col + '0';
shoot[2] = '\n';
tmp = 0;
write(1, shoot, 3);
read(0, &result, 1);
while (tmp != '\n')
read(0, &tmp, 1);
return (result);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401132", "function_addr": 4198706, "binary_name": "2901034b1c1a3c4f50cb14bdef15ccddfd1f9ed7456083acd69316c84c222a18.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov edx, edi"], [4, "mov eax, esi"], [5, "mov [rbp+var_14], dl"], [6, "mov [rbp+var_18], al"], [7, "movzx eax, [rbp+var_14]"], [8, "add eax, 41h "], [9, "mov [rbp+buf], al"], [10, "movzx eax, [rbp+var_18]"], [11, "add eax, 30h "], [12, "mov [rbp+var_2], al"], [13, "mov [rbp+var_1], 0Ah"], [14, "mov [rbp+var_5], 0"], [15, "lea rax, [rbp+buf]"], [16, "mov edx, 3"], [17, "mov rsi, rax"], [18, "mov edi, 1"], [19, "call _write"], [20, "lea rax, [rbp+var_4]"], [21, "mov edx, 1"], [22, "mov rsi, rax"], [23, "mov edi, 0"], [24, "call _read"], [25, "jmp short loc_4011A4"], [26, "lea rax, [rbp+var_5]"], [27, "mov edx, 1"], [28, "mov rsi, rax"], [29, "mov edi, 0"], [30, "call _read"], [31, "movzx eax, [rbp+var_5]"], [32, "cmp al, 0Ah"], [33, "jnz short loc_40118E"], [34, "movzx eax, [rbp+var_4]"], [35, "leave"], [36, "retn"]], "data_dep": [[5, 3], [6, 4], [7, 5], [8, 7], [9, 8], [10, 6], [11, 10], [12, 11], [15, 11], [15, 9], [17, 15], [20, 19], [22, 20], [26, 14], [26, 31], [28, 26], [31, 14], [32, 31], [33, 32], [36, 34]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2901034b1c1a3c4f50cb14bdef15ccddfd1f9ed7456083acd69316c84c222a18_2901034b1c1a3c4f50cb14bdef15ccddfd1f9ed7456083acd69316c84c222a18.jsonl.gz", "strip_func_name": "sub_401132", "query": "\n\n\n__int64 __fastcall sub_401132(char a1, char a2)\n{\nchar v3; // [rsp+1Bh] [rbp-5h] BYREF\nunsigned __int8 v4; // [rsp+1Ch] [rbp-4h] BYREF\nchar buf[3]; // [rsp+1Dh] [rbp-3h] BYREF\n\nbuf[0] = a1 + 65;\nbuf[1] = a2 + 48;\nbuf[2] = 10;\nv3 = 0;\nwrite(1, buf, 3uLL);\nread(0, &v4, 1uLL);\nwhile ( v3 != 10 )\nread(0, &v3, 1uLL);\nreturn v4;\n}\n\n\n\nQ:[a1,a2,v3,v4,buf,sub_401132,]", "hints": "[]", "response": "{'a1': 'row', 'a2': 'col', 'v3': 'tmp', 'v4': 'result', 'buf': 'shoot', 'sub_401132': 'strike'}"} | [
[
0.7585017681121826,
0.7499324083328247,
0.7399752140045166,
0.7292631268501282,
0.7264795303344727,
0.7242138385772705,
0.7238437533378601,
0.7090492844581604,
0.7044499516487122,
0.7032485008239746,
0.7029045820236206,
0.7004446983337402,
0.6971487402915955,
0.6945767998695374,
0.6944359540939331,
0.6940064430236816,
0.6933139562606812,
0.6931931376457214,
0.6926189661026001,
0.6925276517868042
],
[
89300,
116877,
226013,
8425,
122834,
193014,
60507,
51218,
256796,
105118,
63600,
33055,
174225,
139367,
226351,
254067,
91640,
36735,
230506,
152244
]
] |
|
redisCheckConnectDone | b7232c793ccb361e9214e8aefbedc9a386078660a5051d69532bd38ecf2040f0 | redis | hiredis | NA | int redisCheckConnectDone(redisContext *c, int *completed) {
int rc = connect(c->fd, (const struct sockaddr *)c->saddr, c->addrlen);
if (rc == 0) {
*completed = 1;
return REDIS_OK;
}
int error = errno;
if (error == EINPROGRESS) {
/* must check error to see if connect failed. Get the socket error */
int fail, so_error;
socklen_t optlen = sizeof(so_error);
fail = getsockopt(c->fd, SOL_SOCKET, SO_ERROR, &so_error, &optlen);
if (fail == 0) {
if (so_error == 0) {
/* Socket is connected! */
*completed = 1;
return REDIS_OK;
}
/* connection error; */
errno = so_error;
error = so_error;
}
}
switch (error) {
case EISCONN:
*completed = 1;
return REDIS_OK;
case EALREADY:
case EWOULDBLOCK:
*completed = 0;
return REDIS_OK;
default:
return REDIS_ERR;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_417084", "function_addr": 4288644, "binary_name": "b7232c793ccb361e9214e8aefbedc9a386078660a5051d69532bd38ecf2040f0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov rax, [rax+0E8h]"], [7, "mov edx, eax"], [8, "mov rax, [rbp+var_28]"], [9, "mov rcx, [rax+0E0h]"], [10, "mov rax, [rbp+var_28]"], [11, "mov eax, [rax+8Ch]"], [12, "mov rsi, rcx"], [13, "mov edi, eax"], [14, "call _connect"], [15, "mov [rbp+var_8], eax"], [16, "cmp [rbp+var_8], 0"], [17, "jnz short loc_4170DD"], [18, "mov rax, [rbp+var_30]"], [19, "mov dword ptr [rax], 1"], [20, "mov eax, 0"], [21, "jmp locret_41718D"], [22, "call ___errno_location"], [23, "mov eax, [rax]"], [24, "mov [rbp+var_4], eax"], [25, "cmp [rbp+var_4], 73h "], [26, "jnz short loc_41714E"], [27, "mov [rbp+optlen], 4"], [28, "mov rax, [rbp+var_28]"], [29, "mov eax, [rax+8Ch]"], [30, "lea rcx, [rbp+optlen]"], [31, "lea rdx, [rbp+optval]"], [32, "mov r8, rcx"], [33, "mov rcx, rdx"], [34, "mov edx, 4"], [35, "mov esi, 1"], [36, "mov edi, eax"], [37, "call _getsockopt"], [38, "mov [rbp+var_C], eax"], [39, "cmp [rbp+var_C], 0"], [40, "jnz short loc_41714E"], [41, "mov eax, [rbp+optval]"], [42, "test eax, eax"], [43, "jnz short loc_41713E"], [44, "mov rax, [rbp+var_30]"], [45, "mov dword ptr [rax], 1"], [46, "mov eax, 0"], [47, "jmp short locret_41718D"], [48, "call ___errno_location"], [49, "mov edx, [rbp+optval]"], [50, "mov [rax], edx"], [51, "mov eax, [rbp+optval]"], [52, "mov [rbp+var_4], eax"], [53, "cmp [rbp+var_4], 72h "], [54, "jz short loc_417177"], [55, "cmp [rbp+var_4], 72h "], [56, "jg short loc_417188"], [57, "cmp [rbp+var_4], 0Bh"], [58, "jz short loc_417177"], [59, "cmp [rbp+var_4], 6Ah "], [60, "jnz short loc_417188"], [61, "mov rax, [rbp+var_30]"], [62, "mov dword ptr [rax], 1"], [63, "mov eax, 0"], [64, "jmp short locret_41718D"], [65, "mov rax, [rbp+var_30]"], [66, "mov dword ptr [rax], 0"], [67, "mov eax, 0"], [68, "jmp short locret_41718D"], [69, "mov eax, 0FFFFFFFFh"], [70, "leave"], [71, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 3], [9, 8], [10, 3], [11, 10], [12, 9], [13, 11], [15, 14], [16, 15], [17, 16], [18, 4], [19, 18], [23, 22], [24, 23], [25, 24], [26, 25], [28, 3], [29, 28], [30, 9], [30, 27], [31, 7], [32, 30], [33, 31], [36, 29], [38, 37], [39, 38], [40, 39], [42, 41], [43, 42], [44, 4], [45, 44], [50, 49], [50, 48], [52, 51], [53, 52], [53, 24], [54, 53], [55, 52], [55, 24], [56, 55], [57, 24], [57, 52], [58, 57], [59, 24], [59, 52], [60, 59], [61, 4], [62, 61], [65, 4], [66, 65], [71, 20], [71, 46], [71, 67], [71, 63], [71, 69]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b7232c793ccb361e9214e8aefbedc9a386078660a5051d69532bd38ecf2040f0_b7232c793ccb361e9214e8aefbedc9a386078660a5051d69532bd38ecf2040f0.jsonl.gz", "strip_func_name": "sub_417084", "query": "\n\n\n__int64 __fastcall sub_417084(__int64 a1, _DWORD *a2)\n{\nsocklen_t optlen; // [rsp+1Ch] [rbp-14h] BYREF\nint optval; // [rsp+20h] [rbp-10h] BYREF\nint v7; // [rsp+2Ch] [rbp-4h]\n\nif ( !connect(*(_DWORD *)(a1 + 140), *(const struct sockaddr **)(a1 + 224), *(_QWORD *)(a1 + 232)) )\n{\n*a2 = 1;\nreturn 0LL;\n}\nv7 = *__errno_location();\nif ( v7 == 115 )\n{\noptlen = 4;\nif ( !getsockopt(*(_DWORD *)(a1 + 140), 1, 4, &optval, &optlen) )\n{\nif ( !optval )\n{\n*a2 = 1;\nreturn 0LL;\n}\n*__errno_location() = optval;\nv7 = optval;\n}\n}\nif ( v7 == 114 )\ngoto LABEL_13;\nif ( v7 <= 114 )\n{\nif ( v7 != 11 )\n{\nif ( v7 == 106 )\n{\n*a2 = 1;\nreturn 0LL;\n}\nreturn 0xFFFFFFFFLL;\n}\nLABEL_13:\n*a2 = 0;\nreturn 0LL;\n}\nreturn 0xFFFFFFFFLL;\n}\n\n\n\nQ:[a1,a2,optval,v7,sub_417084,]", "hints": "[]", "response": "{'a1': 'c', 'a2': 'completed', 'optval': 'so_error', 'v7': 'error', 'sub_417084': 'redisCheckConnectDone'}"} | [
[
0.7726110219955444,
0.7515571117401123,
0.7338265180587769,
0.7236834764480591,
0.71192866563797,
0.7077253460884094,
0.7053824663162231,
0.7040122747421265,
0.7033711671829224,
0.7014992237091064,
0.7011454105377197,
0.6997978687286377,
0.6970743536949158,
0.6940113306045532,
0.6906945705413818,
0.6894246339797974,
0.6871578693389893,
0.6864356994628906,
0.6840530633926392,
0.6816835403442383
],
[
257666,
9825,
50131,
204059,
125139,
34021,
222933,
14902,
223484,
185038,
200935,
195601,
156383,
92474,
179729,
199460,
245062,
35549,
179212,
19336
]
] |
|
send_binary_file | afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4 | michael-lazar | hn-gopher | NA | void send_binary_file(state *st)
{
/* Faster sendfile() version */
#ifdef HAVE_SENDFILE
int fd;
off_t offset = 0;
if (st->debug) syslog(LOG_INFO, "outputting binary file \"%s\"", st->req_realpath);
if ((fd = open(st->req_realpath, O_RDONLY)) == ERROR) return;
sendfile(1, fd, &offset, st->req_filesize);
close(fd);
/* More compatible POSIX fread()/fwrite() version */
#else
FILE *fp;
char buf[BUFSIZE];
int bytes;
if (st->debug) syslog(LOG_INFO, "outputting binary file \"%s\"", st->req_realpath);
if ((fp = fopen(st->req_realpath , "r")) == NULL) return;
while ((bytes = fread(buf, 1, sizeof(buf), fp)) > 0)
fwrite(buf, bytes, 1, stdout);
fclose(fp);
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404262", "function_addr": 4211298, "binary_name": "afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 420h"], [3, "mov [rbp+var_418], rdi"], [4, "mov rax, [rbp+var_418]"], [5, "movzx eax, byte ptr [rax+13D8Ch]"], [6, "test al, al"], [7, "jz short loc_4042AA"], [8, "mov rax, [rbp+var_418]"], [9, "add rax, 400h"], [10, "mov rdx, rax"], [11, "mov esi, offset aOutputtingBina"], [12, "mov edi, 6"], [13, "mov eax, 0"], [14, "call _syslog"], [15, "mov rax, [rbp+var_418]"], [16, "add rax, 400h"], [17, "mov esi, offset aR"], [18, "mov rdi, rax"], [19, "call _fopen64"], [20, "mov [rbp+stream], rax"], [21, "cmp [rbp+stream], 0"], [22, "jz short loc_40432C"], [23, "jmp short loc_4042F5"], [24, "mov rdx, cs:stdout"], [25, "mov eax, [rbp+var_C]"], [26, "movsxd rsi, eax"], [27, "lea rax, [rbp+ptr]"], [28, "mov rcx, rdx"], [29, "mov edx, 1"], [30, "mov rdi, rax"], [31, "call _fwrite"], [32, "mov rdx, [rbp+stream]"], [33, "lea rax, [rbp+ptr]"], [34, "mov rcx, rdx"], [35, "mov edx, 400h"], [36, "mov esi, 1"], [37, "mov rdi, rax"], [38, "call _fread"], [39, "mov [rbp+var_C], eax"], [40, "cmp [rbp+var_C], 0"], [41, "jg short loc_4042D1"], [42, "mov rax, [rbp+stream]"], [43, "mov rdi, rax"], [44, "call _fclose"], [45, "jmp short locret_40432D"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [15, 3], [16, 15], [18, 16], [20, 19], [21, 20], [22, 21], [25, 39], [26, 25], [27, 25], [28, 24], [30, 27], [32, 20], [33, 19], [33, 31], [34, 32], [37, 33], [39, 38], [40, 39], [41, 40], [42, 20], [43, 42], [48, 44], [48, 19]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4_afacd2886605ed9cc7c713ccbfe9b543c82a146172cfda04c07bad88bb9581d4.jsonl.gz", "strip_func_name": "sub_404262", "query": "\n\n\nint __fastcall sub_404262(__int64 a1)\n{\nFILE *v1; // rax\nchar ptr[1028]; // [rsp+10h] [rbp-410h] BYREF\nint v4; // [rsp+414h] [rbp-Ch]\nFILE *stream; // [rsp+418h] [rbp-8h]\n\nif ( *(_BYTE *)(a1 + 81292) )\nsyslog(6, \"outputting binary file \\\"%s\\\"\", (const char *)(a1 + 1024));\nv1 = fopen64((const char *)(a1 + 1024), \"r\");\nstream = v1;\nif ( v1 )\n{\nwhile ( 1 )\n{\nv4 = fread(ptr, 1uLL, 0x400uLL, stream);\nif ( v4 <= 0 )\nbreak;\nfwrite(ptr, v4, 1uLL, stdout);\n}\nLODWORD(v1) = fclose(stream);\n}\nreturn (int)v1;\n}\n\n\n\nQ:[a1,ptr,v4,stream,sub_404262,]", "hints": "[]", "response": "{'a1': 'st', 'ptr': 'buf', 'v4': 'bytes', 'stream': 'fp', 'sub_404262': 'send_binary_file'}"} | [
[
0.7187653183937073,
0.7122845649719238,
0.7002856135368347,
0.6973617076873779,
0.6879146099090576,
0.6845664978027344,
0.6834411025047302,
0.6761870980262756,
0.6715298891067505,
0.6636261940002441,
0.6626089215278625,
0.6618854403495789,
0.6617835760116577,
0.6588268876075745,
0.6557440161705017,
0.6547783017158508,
0.6539813876152039,
0.6519652605056763,
0.651100754737854,
0.650740921497345
],
[
68267,
251829,
223625,
3036,
186904,
163146,
164072,
43191,
44160,
4672,
53021,
205252,
148106,
139629,
134330,
203610,
60525,
12587,
11169,
123923
]
] |
|
SharkSslSha256Ctx_finish | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | SHARKSSL_API void SharkSslSha256Ctx_finish(SharkSslSha256Ctx *registermcasp, U8 secondaryentry[SHARKSSL_SHA256_HASH_LEN])
{
U32 timerenable, dummywrites;
U32 timer0start, checkcontext;
U8 usbgadgetresource[8];
timer0start = (registermcasp->total[0] >> 29) | (registermcasp->total[1] << 3);
checkcontext = (registermcasp->total[0] << 3);
inputlevel(timer0start, usbgadgetresource, 0);
inputlevel(checkcontext, usbgadgetresource, 4);
timerenable = registermcasp->total[0] & 0x3F;
dummywrites = (timerenable < 56) ? (56 - timerenable) : (120 - timerenable);
SharkSslSha256Ctx_append(registermcasp, (U8*)prusspdata, dummywrites);
SharkSslSha256Ctx_append(registermcasp, usbgadgetresource, 8);
inputlevel(registermcasp->state[0], secondaryentry, 0);
inputlevel(registermcasp->state[1], secondaryentry, 4);
inputlevel(registermcasp->state[2], secondaryentry, 8);
inputlevel(registermcasp->state[3], secondaryentry, 12);
inputlevel(registermcasp->state[4], secondaryentry, 16);
inputlevel(registermcasp->state[5], secondaryentry, 20);
inputlevel(registermcasp->state[6], secondaryentry, 24);
inputlevel(registermcasp->state[7], secondaryentry, 28);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_44C546", "function_addr": 4506950, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov eax, [rax]"], [7, "shr eax, 1Dh"], [8, "mov edx, eax"], [9, "mov rax, [rbp+var_28]"], [10, "mov eax, [rax+4]"], [11, "shl eax, 3"], [12, "or eax, edx"], [13, "mov [rbp+var_4], eax"], [14, "mov rax, [rbp+var_28]"], [15, "mov eax, [rax]"], [16, "shl eax, 3"], [17, "mov [rbp+var_8], eax"], [18, "mov eax, [rbp+var_4]"], [19, "shr eax, 18h"], [20, "mov [rbp+var_18], al"], [21, "mov eax, [rbp+var_4]"], [22, "shr eax, 10h"], [23, "mov [rbp+var_17], al"], [24, "mov eax, [rbp+var_4]"], [25, "shr eax, 8"], [26, "mov [rbp+var_16], al"], [27, "mov eax, [rbp+var_4]"], [28, "mov [rbp+var_15], al"], [29, "mov eax, [rbp+var_8]"], [30, "shr eax, 18h"], [31, "mov [rbp+var_14], al"], [32, "mov eax, [rbp+var_8]"], [33, "shr eax, 10h"], [34, "mov [rbp+var_13], al"], [35, "mov eax, [rbp+var_8]"], [36, "shr eax, 8"], [37, "mov [rbp+var_12], al"], [38, "mov eax, [rbp+var_8]"], [39, "mov [rbp+var_11], al"], [40, "mov rax, [rbp+var_28]"], [41, "mov eax, [rax]"], [42, "and eax, 3Fh"], [43, "mov [rbp+var_C], eax"], [44, "cmp [rbp+var_C], 37h "], [45, "ja short loc_44C5DA"], [46, "mov eax, 38h "], [47, "sub eax, [rbp+var_C]"], [48, "jmp short loc_44C5E2"], [49, "mov eax, 78h "], [50, "sub eax, [rbp+var_C]"], [51, "mov [rbp+var_10], eax"], [52, "mov edx, [rbp+var_10]"], [53, "mov rax, [rbp+var_28]"], [54, "mov esi, offset unk_47E720"], [55, "mov rdi, rax"], [56, "call sub_44C449"], [57, "lea rcx, [rbp+var_18]"], [58, "mov rax, [rbp+var_28]"], [59, "mov edx, 8"], [60, "mov rsi, rcx"], [61, "mov rdi, rax"], [62, "call sub_44C449"], [63, "mov rax, [rbp+var_28]"], [64, "mov eax, [rax+8]"], [65, "shr eax, 18h"], [66, "mov edx, eax"], [67, "mov rax, [rbp+var_30]"], [68, "mov [rax], dl"], [69, "mov rax, [rbp+var_28]"], [70, "mov eax, [rax+8]"], [71, "shr eax, 10h"], [72, "mov edx, eax"], [73, "mov rax, [rbp+var_30]"], [74, "add rax, 1"], [75, "mov [rax], dl"], [76, "mov rax, [rbp+var_28]"], [77, "mov eax, [rax+8]"], [78, "shr eax, 8"], [79, "mov edx, eax"], [80, "mov rax, [rbp+var_30]"], [81, "add rax, 2"], [82, "mov [rax], dl"], [83, "mov rax, [rbp+var_28]"], [84, "mov edx, [rax+8]"], [85, "mov rax, [rbp+var_30]"], [86, "add rax, 3"], [87, "mov [rax], dl"], [88, "mov rax, [rbp+var_28]"], [89, "mov eax, [rax+0Ch]"], [90, "shr eax, 18h"], [91, "mov edx, eax"], [92, "mov rax, [rbp+var_30]"], [93, "add rax, 4"], [94, "mov [rax], dl"], [95, "mov rax, [rbp+var_28]"], [96, "mov eax, [rax+0Ch]"], [97, "shr eax, 10h"], [98, "mov edx, eax"], [99, "mov rax, [rbp+var_30]"], [100, "add rax, 5"], [101, "mov [rax], dl"], [102, "mov rax, [rbp+var_28]"], [103, "mov eax, [rax+0Ch]"], [104, "shr eax, 8"], [105, "mov edx, eax"], [106, "mov rax, [rbp+var_30]"], [107, "add rax, 6"], [108, "mov [rax], dl"], [109, "mov rax, [rbp+var_28]"], [110, "mov edx, [rax+0Ch]"], [111, "mov rax, [rbp+var_30]"], [112, "add rax, 7"], [113, "mov [rax], dl"], [114, "mov rax, [rbp+var_28]"], [115, "mov eax, [rax+10h]"], [116, "shr eax, 18h"], [117, "mov edx, eax"], [118, "mov rax, [rbp+var_30]"], [119, "add rax, 8"], [120, "mov [rax], dl"], [121, "mov rax, [rbp+var_28]"], [122, "mov eax, [rax+10h]"], [123, "shr eax, 10h"], [124, "mov edx, eax"], [125, "mov rax, [rbp+var_30]"], [126, "add rax, 9"], [127, "mov [rax], dl"], [128, "mov rax, [rbp+var_28]"], [129, "mov eax, [rax+10h]"], [130, "shr eax, 8"], [131, "mov edx, eax"], [132, "mov rax, [rbp+var_30]"], [133, "add rax, 0Ah"], [134, "mov [rax], dl"], [135, "mov rax, [rbp+var_28]"], [136, "mov edx, [rax+10h]"], [137, "mov rax, [rbp+var_30]"], [138, "add rax, 0Bh"], [139, "mov [rax], dl"], [140, "mov rax, [rbp+var_28]"], [141, "mov eax, [rax+14h]"], [142, "shr eax, 18h"], [143, "mov edx, eax"], [144, "mov rax, [rbp+var_30]"], [145, "add rax, 0Ch"], [146, "mov [rax], dl"], [147, "mov rax, [rbp+var_28]"], [148, "mov eax, [rax+14h]"], [149, "shr eax, 10h"], [150, "mov edx, eax"], [151, "mov rax, [rbp+var_30]"], [152, "add rax, 0Dh"], [153, "mov [rax], dl"], [154, "mov rax, [rbp+var_28]"], [155, "mov eax, [rax+14h]"], [156, "shr eax, 8"], [157, "mov edx, eax"], [158, "mov rax, [rbp+var_30]"], [159, "add rax, 0Eh"], [160, "mov [rax], dl"], [161, "mov rax, [rbp+var_28]"], [162, "mov edx, [rax+14h]"], [163, "mov rax, [rbp+var_30]"], [164, "add rax, 0Fh"], [165, "mov [rax], dl"], [166, "mov rax, [rbp+var_28]"], [167, "mov eax, [rax+18h]"], [168, "shr eax, 18h"], [169, "mov edx, eax"], [170, "mov rax, [rbp+var_30]"], [171, "add rax, 10h"], [172, "mov [rax], dl"], [173, "mov rax, [rbp+var_28]"], [174, "mov eax, [rax+18h]"], [175, "shr eax, 10h"], [176, "mov edx, eax"], [177, "mov rax, [rbp+var_30]"], [178, "add rax, 11h"], [179, "mov [rax], dl"], [180, "mov rax, [rbp+var_28]"], [181, "mov eax, [rax+18h]"], [182, "shr eax, 8"], [183, "mov edx, eax"], [184, "mov rax, [rbp+var_30]"], [185, "add rax, 12h"], [186, "mov [rax], dl"], [187, "mov rax, [rbp+var_28]"], [188, "mov edx, [rax+18h]"], [189, "mov rax, [rbp+var_30]"], [190, "add rax, 13h"], [191, "mov [rax], dl"], [192, "mov rax, [rbp+var_28]"], [193, "mov eax, [rax+1Ch]"], [194, "shr eax, 18h"], [195, "mov edx, eax"], [196, "mov rax, [rbp+var_30]"], [197, "add rax, 14h"], [198, "mov [rax], dl"], [199, "mov rax, [rbp+var_28]"], [200, "mov eax, [rax+1Ch]"], [201, "shr eax, 10h"], [202, "mov edx, eax"], [203, "mov rax, [rbp+var_30]"], [204, "add rax, 15h"], [205, "mov [rax], dl"], [206, "mov rax, [rbp+var_28]"], [207, "mov eax, [rax+1Ch]"], [208, "shr eax, 8"], [209, "mov edx, eax"], [210, "mov rax, [rbp+var_30]"], [211, "add rax, 16h"], [212, "mov [rax], dl"], [213, "mov rax, [rbp+var_28]"], [214, "mov edx, [rax+1Ch]"], [215, "mov rax, [rbp+var_30]"], [216, "add rax, 17h"], [217, "mov [rax], dl"], [218, "mov rax, [rbp+var_28]"], [219, "mov eax, [rax+20h]"], [220, "shr eax, 18h"], [221, "mov edx, eax"], [222, "mov rax, [rbp+var_30]"], [223, "add rax, 18h"], [224, "mov [rax], dl"], [225, "mov rax, [rbp+var_28]"], [226, "mov eax, [rax+20h]"], [227, "shr eax, 10h"], [228, "mov edx, eax"], [229, "mov rax, [rbp+var_30]"], [230, "add rax, 19h"], [231, "mov [rax], dl"], [232, "mov rax, [rbp+var_28]"], [233, "mov eax, [rax+20h]"], [234, "shr eax, 8"], [235, "mov edx, eax"], [236, "mov rax, [rbp+var_30]"], [237, "add rax, 1Ah"], [238, "mov [rax], dl"], [239, "mov rax, [rbp+var_28]"], [240, "mov edx, [rax+20h]"], [241, "mov rax, [rbp+var_30]"], [242, "add rax, 1Bh"], [243, "mov [rax], dl"], [244, "mov rax, [rbp+var_28]"], [245, "mov eax, [rax+24h]"], [246, "shr eax, 18h"], [247, "mov edx, eax"], [248, "mov rax, [rbp+var_30]"], [249, "add rax, 1Ch"], [250, "mov [rax], dl"], [251, "mov rax, [rbp+var_28]"], [252, "mov eax, [rax+24h]"], [253, "shr eax, 10h"], [254, "mov edx, eax"], [255, "mov rax, [rbp+var_30]"], [256, "add rax, 1Dh"], [257, "mov [rax], dl"], [258, "mov rax, [rbp+var_28]"], [259, "mov eax, [rax+24h]"], [260, "shr eax, 8"], [261, "mov edx, eax"], [262, "mov rax, [rbp+var_30]"], [263, "add rax, 1Eh"], [264, "mov [rax], dl"], [265, "mov rax, [rbp+var_28]"], [266, "mov edx, [rax+24h]"], [267, "mov rax, [rbp+var_30]"], [268, "add rax, 1Fh"], [269, "mov [rax], dl"], [270, "nop"], [271, "leave"], [272, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 7], [9, 3], [10, 9], [11, 10], [12, 8], [12, 11], [13, 12], [14, 3], [15, 14], [16, 15], [17, 16], [18, 13], [19, 18], [20, 19], [21, 13], [22, 21], [23, 22], [24, 13], [25, 24], [26, 25], [27, 13], [28, 27], [29, 17], [30, 29], [31, 30], [32, 17], [33, 32], [34, 33], [35, 17], [36, 35], [37, 36], [38, 17], [39, 38], [40, 3], [41, 40], [42, 41], [43, 42], [44, 43], [45, 44], [47, 43], [47, 46], [50, 43], [50, 49], [51, 50], [51, 47], [52, 51], [53, 3], [55, 53], [57, 20], [58, 3], [60, 57], [61, 58], [63, 3], [64, 63], [65, 64], [66, 65], [67, 4], [68, 67], [68, 66], [69, 3], [70, 68], [70, 69], [71, 70], [72, 71], [73, 4], [74, 73], [75, 72], [75, 74], [76, 3], [77, 76], [77, 75], [78, 77], [79, 78], [80, 4], [81, 80], [82, 79], [82, 81], [83, 3], [84, 83], [84, 82], [85, 4], [86, 85], [87, 86], [87, 84], [88, 3], [89, 88], [89, 87], [90, 89], [91, 90], [92, 4], [93, 92], [94, 93], [94, 91], [95, 3], [96, 95], [96, 94], [97, 96], [98, 97], [99, 4], [100, 99], [101, 100], [101, 98], [102, 3], [103, 102], [103, 101], [104, 103], [105, 104], [106, 4], [107, 106], [108, 105], [108, 107], [109, 3], [110, 109], [110, 108], [111, 4], [112, 111], [113, 112], [113, 110], [114, 3], [115, 114], [115, 113], [116, 115], [117, 116], [118, 4], [119, 118], [120, 119], [120, 117], [121, 3], [122, 121], [122, 120], [123, 122], [124, 123], [125, 4], [126, 125], [127, 126], [127, 124], [128, 3], [129, 128], [129, 127], [130, 129], [131, 130], [132, 4], [133, 132], [134, 131], [134, 133], [135, 3], [136, 135], [136, 134], [137, 4], [138, 137], [139, 138], [139, 136], [140, 3], [141, 140], [141, 139], [142, 141], [143, 142], [144, 4], [145, 144], [146, 145], [146, 143], [147, 3], [148, 147], [148, 146], [149, 148], [150, 149], [151, 4], [152, 151], [153, 152], [153, 150], [154, 3], [155, 153], [155, 154], [156, 155], [157, 156], [158, 4], [159, 158], [160, 159], [160, 157], [161, 3], [162, 161], [162, 160], [163, 4], [164, 163], [165, 164], [165, 162], [166, 3], [167, 166], [167, 165], [168, 167], [169, 168], [170, 4], [171, 170], [172, 171], [172, 169], [173, 3], [174, 173], [174, 172], [175, 174], [176, 175], [177, 4], [178, 177], [179, 178], [179, 176], [180, 3], [181, 180], [181, 179], [182, 181], [183, 182], [184, 4], [185, 184], [186, 185], [186, 183], [187, 3], [188, 187], [188, 186], [189, 4], [190, 189], [191, 190], [191, 188], [192, 3], [193, 192], [193, 191], [194, 193], [195, 194], [196, 4], [197, 196], [198, 197], [198, 195], [199, 3], [200, 199], [200, 198], [201, 200], [202, 201], [203, 4], [204, 203], [205, 204], [205, 202], [206, 3], [207, 206], [207, 205], [208, 207], [209, 208], [210, 4], [211, 210], [212, 211], [212, 209], [213, 3], [214, 213], [214, 212], [215, 4], [216, 215], [217, 216], [217, 214], [218, 3], [219, 218], [219, 217], [220, 219], [221, 220], [222, 4], [223, 222], [224, 223], [224, 221], [225, 3], [226, 225], [226, 224], [227, 226], [228, 227], [229, 4], [230, 229], [231, 230], [231, 228], [232, 3], [233, 232], [233, 231], [234, 233], [235, 234], [236, 4], [237, 236], [238, 237], [238, 235], [239, 3], [240, 239], [240, 238], [241, 4], [242, 241], [243, 242], [243, 240], [244, 3], [245, 244], [245, 243], [246, 245], [247, 246], [248, 4], [249, 248], [250, 249], [250, 247], [251, 3], [252, 251], [252, 250], [253, 252], [254, 253], [255, 4], [256, 255], [257, 256], [257, 254], [258, 3], [259, 258], [259, 257], [260, 259], [261, 260], [262, 4], [263, 262], [264, 263], [264, 261], [265, 3], [266, 265], [266, 264], [267, 4], [268, 267], [269, 268], [269, 266], [272, 268]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_44C546", "query": "\n\n\n_BYTE *__fastcall sub_44C546(unsigned int *a1, _BYTE *a2)\n{\nunsigned int v2; // eax\n_BYTE *result; // rax\nunsigned int v4; // [rsp+18h] [rbp-18h] BYREF\nchar v5; // [rsp+1Ch] [rbp-14h]\nchar v6; // [rsp+1Dh] [rbp-13h]\nchar v7; // [rsp+1Eh] [rbp-12h]\nchar v8; // [rsp+1Fh] [rbp-11h]\nunsigned int v9; // [rsp+20h] [rbp-10h]\nunsigned int v10; // [rsp+24h] [rbp-Ch]\n__int64 v11; // [rsp+28h] [rbp-8h]\n\nv11 = 8LL * *(_QWORD *)a1;\nLOBYTE(v4) = HIBYTE(v11);\nBYTE1(v4) = BYTE6(v11);\nBYTE2(v4) = BYTE5(v11);\nHIBYTE(v4) = BYTE4(v11);\nv5 = BYTE3(v11);\nv6 = BYTE2(v11);\nv7 = BYTE1(v11);\nv8 = v11;\nv10 = *a1 & 0x3F;\nif ( v10 > 0x37 )\nv2 = 120 - v10;\nelse\nv2 = 56 - v10;\nv9 = v2;\nsub_44C449(a1, (unsigned int *)byte_47E720, v2);\nsub_44C449(a1, &v4, 8u);\n*a2 = HIBYTE(a1[2]);\na2[1] = BYTE2(a1[2]);\na2[2] = BYTE1(a1[2]);\na2[3] = a1[2];\na2[4] = HIBYTE(a1[3]);\na2[5] = BYTE2(a1[3]);\na2[6] = BYTE1(a1[3]);\na2[7] = a1[3];\na2[8] = HIBYTE(a1[4]);\na2[9] = BYTE2(a1[4]);\na2[10] = BYTE1(a1[4]);\na2[11] = a1[4];\na2[12] = HIBYTE(a1[5]);\na2[13] = BYTE2(a1[5]);\na2[14] = BYTE1(a1[5]);\na2[15] = a1[5];\na2[16] = HIBYTE(a1[6]);\na2[17] = BYTE2(a1[6]);\na2[18] = BYTE1(a1[6]);\na2[19] = a1[6];\na2[20] = HIBYTE(a1[7]);\na2[21] = BYTE2(a1[7]);\na2[22] = BYTE1(a1[7]);\na2[23] = a1[7];\na2[24] = HIBYTE(a1[8]);\na2[25] = BYTE2(a1[8]);\na2[26] = BYTE1(a1[8]);\na2[27] = a1[8];\na2[28] = HIBYTE(a1[9]);\na2[29] = BYTE2(a1[9]);\na2[30] = BYTE1(a1[9]);\nresult = a2 + 31;\na2[31] = a1[9];\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,v9,v10,v11,sub_44C546,sub_44C449,]", "hints": "[]", "response": "{'a1': 'registermcasp', 'a2': 'secondaryentry', 'v4': 'usbgadgetresource', 'v9': 'dummywrites', 'v10': 'timerenable', 'v11': 'checkcontext', 'sub_44C546': 'SharkSslSha256Ctx_finish', 'sub_44C449': 'SharkSslSha256Ctx_append'}"} | [
[
0.9000613689422607,
0.8947525024414062,
0.8942604660987854,
0.889988124370575,
0.8897499442100525,
0.8893284797668457,
0.8829631805419922,
0.878513514995575,
0.8769913911819458,
0.8579427003860474,
0.853188693523407,
0.8504394292831421,
0.8451143503189087,
0.8270901441574097,
0.8060125708580017,
0.8035884499549866,
0.802280068397522,
0.7998892068862915,
0.7881988286972046,
0.7634260654449463
],
[
203995,
11323,
205578,
246921,
196663,
94122,
70928,
150352,
70991,
227436,
217018,
46035,
207523,
67179,
18466,
33689,
157039,
214614,
11357,
70091
]
] |
|
MakeVarint | a7993a0f94c692d24b64893b308be5072411f9d235b1deb1bfa628fcd074fa71 | cnlohr | avrcraft | NA | int MakeVarint( uint8_t * dat, int num )
{
int r = 0;
cont:
dat[r] = num & 0x7f;
if( num > 0x7f )
{
dat[r++] |= 0x80;
num >>= 7;
goto cont;
}
return r+1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401162", "function_addr": 4198754, "binary_name": "a7993a0f94c692d24b64893b308be5072411f9d235b1deb1bfa628fcd074fa71.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_1C], esi"], [4, "mov [rbp+var_4], 0"], [5, "mov eax, [rbp+var_1C]"], [6, "mov ecx, eax"], [7, "mov eax, [rbp+var_4]"], [8, "movsxd rdx, eax"], [9, "mov rax, [rbp+var_18]"], [10, "add rax, rdx"], [11, "and ecx, 7Fh"], [12, "mov edx, ecx"], [13, "mov [rax], dl"], [14, "cmp [rbp+var_1C], 7Fh"], [15, "jle short loc_4011BE"], [16, "mov eax, [rbp+var_4]"], [17, "lea edx, [rax+1]"], [18, "mov [rbp+var_4], edx"], [19, "movsxd rcx, eax"], [20, "mov rdx, [rbp+var_18]"], [21, "add rdx, rcx"], [22, "movzx edx, byte ptr [rdx]"], [23, "movsxd rcx, eax"], [24, "mov rax, [rbp+var_18]"], [25, "add rax, rcx"], [26, "or edx, 0FFFFFF80h"], [27, "mov [rax], dl"], [28, "sar [rbp+var_1C], 7"], [29, "jmp short loc_401174"], [30, "mov eax, [rbp+var_4]"], [31, "add eax, 1"], [32, "pop rbp"], [33, "retn"]], "data_dep": [[5, 28], [5, 3], [6, 5], [7, 4], [7, 18], [8, 7], [9, 2], [10, 9], [10, 8], [11, 6], [12, 11], [13, 10], [13, 12], [14, 28], [14, 3], [15, 14], [16, 4], [16, 18], [17, 12], [17, 27], [17, 16], [17, 13], [18, 17], [19, 16], [20, 2], [21, 19], [21, 20], [22, 13], [22, 21], [22, 27], [23, 16], [24, 2], [25, 23], [25, 24], [26, 22], [27, 25], [27, 26], [28, 3], [28, 28], [30, 18], [30, 4], [31, 30], [32, 0], [33, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a7993a0f94c692d24b64893b308be5072411f9d235b1deb1bfa628fcd074fa71_a7993a0f94c692d24b64893b308be5072411f9d235b1deb1bfa628fcd074fa71.jsonl.gz", "strip_func_name": "sub_401162", "query": "\n\n\n__int64 __fastcall sub_401162(__int64 a1, int a2)\n{\nint v2; // eax\nint i; // [rsp+18h] [rbp-4h]\n\nfor ( i = 0; ; ++i )\n{\n*(_BYTE *)(i + a1) = a2 & 0x7F;\nif ( a2 <= 127 )\nbreak;\nv2 = i;\n*(_BYTE *)(v2 + a1) |= 0x80u;\na2 >>= 7;\n}\nreturn (unsigned int)(i + 1);\n}\n\n\n\nQ:[a1,a2,i,sub_401162,]", "hints": "[]", "response": "{'a1': 'dat', 'a2': 'num', 'i': 'r', 'sub_401162': 'MakeVarint'}"} | [
[
0.8050075769424438,
0.7629657983779907,
0.7571080923080444,
0.7550126314163208,
0.7545303106307983,
0.7535411715507507,
0.7525640726089478,
0.7438802719116211,
0.7431625127792358,
0.7402973771095276,
0.7395721077919006,
0.7391486763954163,
0.7359756231307983,
0.7341666221618652,
0.731830894947052,
0.7318062782287598,
0.7311202883720398,
0.7286255359649658,
0.7284220457077026,
0.7258719205856323
],
[
83565,
65605,
153217,
11488,
190972,
14208,
238707,
262344,
51052,
7842,
12744,
86150,
7863,
106835,
99614,
95820,
185284,
138427,
164346,
181868
]
] |
|
downSampleInput | d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f | waywardgeek | sonic | NA | static void downSampleInput(sonicStream stream, short* samples, int skip) {
int numSamples = stream->maxRequired / skip;
int samplesPerValue = stream->numChannels * skip;
int i, j;
int value;
short* downSamples = stream->downSampleBuffer;
for (i = 0; i < numSamples; i++) {
value = 0;
for (j = 0; j < samplesPerValue; j++) {
value += *samples++;
}
value /= samplesPerValue;
*downSamples++ = value;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403618", "function_addr": 4208152, "binary_name": "d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_34], edx"], [5, "mov rax, [rbp+var_28]"], [6, "mov eax, [rax+74h]"], [7, "cdq"], [8, "idiv [rbp+var_34]"], [9, "mov [rbp+var_1C], eax"], [10, "mov rax, [rbp+var_28]"], [11, "mov eax, [rax+50h]"], [12, "mov edx, [rbp+var_34]"], [13, "imul eax, edx"], [14, "mov [rbp+var_20], eax"], [15, "mov rax, [rbp+var_28]"], [16, "mov rax, [rax+18h]"], [17, "mov [rbp+var_18], rax"], [18, "mov [rbp+var_4], 0"], [19, "jmp short loc_4036A9"], [20, "mov [rbp+var_C], 0"], [21, "mov [rbp+var_8], 0"], [22, "jmp short loc_403681"], [23, "mov rax, [rbp+var_30]"], [24, "lea rdx, [rax+2]"], [25, "mov [rbp+var_30], rdx"], [26, "movzx eax, word ptr [rax]"], [27, "cwde"], [28, "add [rbp+var_C], eax"], [29, "add [rbp+var_8], 1"], [30, "mov eax, [rbp+var_8]"], [31, "cmp eax, [rbp+var_20]"], [32, "jl short loc_40366A"], [33, "mov eax, [rbp+var_C]"], [34, "cdq"], [35, "idiv [rbp+var_20]"], [36, "mov [rbp+var_C], eax"], [37, "mov rax, [rbp+var_18]"], [38, "lea rdx, [rax+2]"], [39, "mov [rbp+var_18], rdx"], [40, "mov edx, [rbp+var_C]"], [41, "mov [rax], dx"], [42, "add [rbp+var_4], 1"], [43, "mov eax, [rbp+var_4]"], [44, "cmp eax, [rbp+var_1C]"], [45, "jl short loc_40365A"], [46, "nop"], [47, "nop"], [48, "pop rbp"], [49, "retn"]], "data_dep": [[5, 2], [6, 5], [8, 4], [9, 6], [10, 2], [11, 10], [12, 8], [13, 11], [13, 12], [14, 13], [15, 2], [16, 15], [17, 16], [23, 25], [23, 3], [24, 23], [24, 41], [24, 40], [24, 12], [24, 24], [25, 24], [26, 23], [26, 41], [28, 20], [28, 26], [28, 28], [29, 29], [29, 21], [30, 21], [30, 29], [31, 14], [31, 35], [31, 30], [32, 31], [33, 20], [33, 28], [35, 14], [35, 35], [36, 33], [37, 39], [37, 17], [38, 41], [38, 37], [38, 40], [38, 12], [38, 24], [39, 38], [40, 36], [41, 40], [41, 37], [42, 42], [42, 18], [43, 18], [43, 42], [44, 43], [44, 9], [45, 44], [48, 0], [49, 43]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f_d051207685c181e6ac708206aec23513f1c812988c4d2213df951a88df4ae88f.jsonl.gz", "strip_func_name": "sub_403618", "query": "\n\n\n__int64 __fastcall sub_403618(__int64 a1, __int16 *a2, int a3)\n{\n__int16 *v3; // rax\n_WORD *v4; // rax\n__int64 result; // rax\nint v7; // [rsp+14h] [rbp-20h]\nint v8; // [rsp+18h] [rbp-1Ch]\n_WORD *v9; // [rsp+1Ch] [rbp-18h]\nint v10; // [rsp+28h] [rbp-Ch]\nint j; // [rsp+2Ch] [rbp-8h]\nint i; // [rsp+30h] [rbp-4h]\n\nv8 = *(_DWORD *)(a1 + 116) / a3;\nv7 = a3 * *(_DWORD *)(a1 + 80);\nv9 = *(_WORD **)(a1 + 24);\nfor ( i = 0; ; ++i )\n{\nresult = (unsigned int)i;\nif ( i >= v8 )\nbreak;\nv10 = 0;\nfor ( j = 0; j < v7; ++j )\n{\nv3 = a2++;\nv10 += *v3;\n}\nv4 = v9++;\n*v4 = v10 / v7;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v7,v8,v9,v10,sub_403618,]", "hints": "[]", "response": "{'a3': 'skip', 'a1': 'stream', 'a2': 'samples', 'v7': 'samplesPerValue', 'v8': 'numSamples', 'v9': 'downSamples', 'v10': 'value', 'sub_403618': 'downSampleInput'}"} | [
[
0.7378126382827759,
0.7355403304100037,
0.7315020561218262,
0.7174670100212097,
0.7101969122886658,
0.6957213878631592,
0.6938028335571289,
0.688382625579834,
0.688334047794342,
0.6874122619628906,
0.6870349049568176,
0.6862756609916687,
0.6810843348503113,
0.6791594624519348,
0.677301287651062,
0.6768442392349243,
0.6754238605499268,
0.6752197742462158,
0.6738761067390442,
0.666289210319519
],
[
178415,
257217,
80699,
51452,
24981,
86902,
221539,
194286,
133433,
136080,
227128,
233644,
206916,
107430,
23695,
218696,
225904,
36332,
44411,
128163
]
] |
|
arm_mult_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_mult_q31(
const q31_t * pSrcA,
const q31_t * pSrcB,
q31_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
q31_t out; /* Temporary output variable */
#if defined (ARM_MATH_LOOPUNROLL)
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = A * B */
/* Multiply inputs and store result in destination buffer. */
out = ((q63_t) *pSrcA++ * *pSrcB++) >> 32;
out = __SSAT(out, 31);
*pDst++ = out << 1U;
out = ((q63_t) *pSrcA++ * *pSrcB++) >> 32;
out = __SSAT(out, 31);
*pDst++ = out << 1U;
out = ((q63_t) *pSrcA++ * *pSrcB++) >> 32;
out = __SSAT(out, 31);
*pDst++ = out << 1U;
out = ((q63_t) *pSrcA++ * *pSrcB++) >> 32;
out = __SSAT(out, 31);
*pDst++ = out << 1U;
/* Decrement loop counter */
blkCnt--;
}
/* Loop unrolling: Compute remaining outputs */
blkCnt = blockSize % 0x4U;
#else
/* Initialize blkCnt with number of samples */
blkCnt = blockSize;
#endif /* #if defined (ARM_MATH_LOOPUNROLL) */
while (blkCnt > 0U)
{
/* C = A * B */
/* Multiply inputs and store result in destination buffer. */
out = ((q63_t) *pSrcA++ * *pSrcB++) >> 32;
out = __SSAT(out, 31);
*pDst++ = out << 1U;
/* Decrement loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41FFCF", "function_addr": 4325327, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_38], rdx"], [5, "mov [rbp+var_3C], ecx"], [6, "mov eax, [rbp+var_3C]"], [7, "mov [rbp+var_4], eax"], [8, "jmp loc_420088"], [9, "mov rax, [rbp+var_28]"], [10, "lea rdx, [rax+4]"], [11, "mov [rbp+var_28], rdx"], [12, "mov eax, [rax]"], [13, "movsxd rcx, eax"], [14, "mov rax, [rbp+var_30]"], [15, "lea rdx, [rax+4]"], [16, "mov [rbp+var_30], rdx"], [17, "mov eax, [rax]"], [18, "cdqe"], [19, "imul rax, rcx"], [20, "sar rax, 20h"], [21, "mov [rbp+var_8], eax"], [22, "mov eax, [rbp+var_8]"], [23, "mov [rbp+var_C], eax"], [24, "mov [rbp+var_10], 1Fh"], [25, "cmp [rbp+var_10], 0"], [26, "jz short loc_42006B"], [27, "cmp [rbp+var_10], 20h "], [28, "ja short loc_42006B"], [29, "mov eax, [rbp+var_10]"], [30, "sub eax, 1"], [31, "mov edx, 1"], [32, "mov ecx, eax"], [33, "shl edx, cl"], [34, "mov eax, edx"], [35, "sub eax, 1"], [36, "mov [rbp+var_14], eax"], [37, "mov eax, [rbp+var_14]"], [38, "not eax"], [39, "mov [rbp+var_18], eax"], [40, "mov eax, [rbp+var_C]"], [41, "cmp eax, [rbp+var_14]"], [42, "jle short loc_42005E"], [43, "mov eax, [rbp+var_14]"], [44, "jmp short loc_42006E"], [45, "mov eax, [rbp+var_C]"], [46, "cmp eax, [rbp+var_18]"], [47, "jge short loc_42006B"], [48, "mov eax, [rbp+var_18]"], [49, "jmp short loc_42006E"], [50, "mov eax, [rbp+var_C]"], [51, "mov [rbp+var_8], eax"], [52, "mov rax, [rbp+var_38]"], [53, "lea rdx, [rax+4]"], [54, "mov [rbp+var_38], rdx"], [55, "mov edx, [rbp+var_8]"], [56, "add edx, edx"], [57, "mov [rax], edx"], [58, "sub [rbp+var_4], 1"], [59, "cmp [rbp+var_4], 0"], [60, "jnz loc_41FFED"], [61, "nop"], [62, "nop"], [63, "pop rbp"], [64, "retn"]], "data_dep": [[6, 5], [7, 6], [9, 2], [9, 11], [10, 9], [10, 57], [10, 56], [11, 10], [12, 9], [12, 57], [13, 12], [14, 16], [14, 3], [15, 57], [15, 14], [15, 10], [16, 15], [17, 57], [17, 14], [19, 17], [19, 13], [20, 19], [21, 20], [22, 21], [23, 22], [25, 24], [26, 25], [27, 24], [28, 27], [29, 24], [30, 29], [32, 30], [33, 32], [33, 31], [34, 33], [35, 34], [36, 35], [37, 36], [38, 37], [39, 38], [40, 23], [41, 40], [41, 36], [42, 41], [43, 36], [45, 23], [46, 39], [46, 45], [47, 46], [48, 39], [50, 23], [51, 50], [51, 43], [51, 48], [52, 54], [52, 4], [53, 52], [53, 15], [53, 33], [53, 57], [54, 53], [55, 51], [56, 55], [57, 56], [57, 52], [58, 7], [58, 58], [59, 58], [59, 7], [60, 59], [63, 0], [64, 52], [64, 6]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_41FFCF", "query": "\n\n\nunsigned __int64 __fastcall sub_41FFCF(int *a1, int *a2, _DWORD *a3, unsigned int a4)\n{\nunsigned __int64 result; // rax\nint *v5; // rax\n__int64 v6; // rcx\nint *v7; // rax\nint v8; // eax\nint v12; // [rsp+30h] [rbp-Ch]\nint v13; // [rsp+34h] [rbp-8h]\nunsigned int i; // [rsp+38h] [rbp-4h]\n\nresult = a4;\nfor ( i = a4; i; --i )\n{\nv5 = a1++;\nv6 = *v5;\nv7 = a2++;\nv12 = (unsigned __int64)(v6 * *v7) >> 32;\nif ( v12 <= 0x3FFFFFFF )\n{\nif ( v12 >= -1073741824 )\nv8 = (unsigned __int64)(v6 * *v7) >> 32;\nelse\nv8 = -1073741824;\n}\nelse\n{\nv8 = 0x3FFFFFFF;\n}\nv13 = v8;\nresult = (unsigned __int64)a3++;\n*(_DWORD *)result = 2 * v13;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v13,sub_41FFCF,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'blockSize', 'a1': 'pSrcA', 'a2': 'pSrcB', 'v13': 'out', 'sub_41FFCF': 'arm_mult_q31'}"} | [
[
0.7611387968063354,
0.7471487522125244,
0.741342306137085,
0.7399534583091736,
0.7379905581474304,
0.7374056577682495,
0.7364548444747925,
0.7332253456115723,
0.726844310760498,
0.7259492874145508,
0.722809910774231,
0.7189300060272217,
0.717486560344696,
0.7146140933036804,
0.7140460014343262,
0.7052341103553772,
0.7045750617980957,
0.7035730481147766,
0.7034512758255005,
0.6996898651123047
],
[
205548,
178629,
31104,
130331,
219565,
33816,
173802,
172592,
100352,
101914,
13648,
86684,
206681,
89719,
237096,
49146,
242572,
98341,
245195,
166774
]
] |
|
hsort_closure | dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b | lavabit | pahoehoe | NA | void hsort_closure(void *base, size_t n, size_t size, hsort_closure_cmp_t *cmp, const void *data)
{
register char *p, *q, *base0, *hi;
register unsigned int gap, g;
if (n < 2)
return;
base0 = (char *)base - size; /* set up address of h[0] */
/*
* The gap is the distance, in bytes, between h[0] and h[i],
* for some i. It is also the distance between h[i] and h[2*i];
* that is, the distance between a node and its left child.
* The initial node of interest is h[n/2] (the rightmost
* interior node), so gap is set accordingly. The following is
* the only multiplication needed.
*/
gap = (n >> 1) * size; /* initial gap is n/2*size */
hi = base0 + gap + gap; /* calculate address of h[n] */
if (n & 1)
hi += size; /* watch out for odd arrays */
/*
* Phase 1: Construct heap from random data.
*
* For i = n/2 downto 2, ensure h[i] is greater than its
* children h[2*i] and h[2*i+1]. By decreasing 'gap' at each
* iteration, we move down the heap towards h[2]. The final step
* of making h[1] the maximum value is done in the next phase.
*/
for ( ; gap != size; gap -= size)
{
/* fixheap(base0, size, cmp, gap, hi) */
for (p = base0 + (g = gap); (q = p + g) <= hi; p = q)
{
g += g; /* double gap for next level */
/*
* Find greater of left and right children.
*/
if (q != hi && (*cmp)(q + size, q, data) > 0)
{
q += size; /* choose right child */
g += size; /* follow right subtree */
}
/*
* Compare with parent.
*/
if ((*cmp)(p, q, data) >= 0)
break; /* order is correct */
swap(p, q, size); /* swap parent and child */
}
}
/*
* Phase 2: Each iteration makes the first item in the
* array the maximum, then swaps it with the last item, which
* is its correct position. The size of the heap is decreased
* each iteration. The gap is always "size", as we are interested
* in the heap starting at h[1].
*/
for ( ; hi != base; hi -= size)
{
/* fixheap(base0, size, cmp, gap (== size), hi) */
p = (char *)base; /* == base0 + size */
for (g = size; (q = p + g) <= hi; p = q)
{
g += g;
if (q != hi && (*cmp)(q + size, q, data) > 0)
{
q += size;
g += size;
}
if ((*cmp)(p, q, data) >= 0)
break;
swap(p, q, size);
}
swap((char *)base, hi, size); /* move largest item to end */
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_423AD6", "function_addr": 4340438, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r15"], [3, "push r14"], [4, "push r13"], [5, "push r12"], [6, "push rbx"], [7, "sub rsp, 38h"], [8, "mov [rbp+var_38], rdi"], [9, "mov [rbp+var_40], rsi"], [10, "mov [rbp+var_48], rdx"], [11, "mov [rbp+var_50], rcx"], [12, "mov [rbp+var_58], r8"], [13, "cmp [rbp+var_40], 1"], [14, "jbe loc_423C99"], [15, "mov rax, [rbp+var_48]"], [16, "neg rax"], [17, "mov rdx, rax"], [18, "mov rax, [rbp+var_38]"], [19, "lea rsi, [rdx+rax]"], [20, "mov [rbp+var_60], rsi"], [21, "mov rax, [rbp+var_40]"], [22, "shr rax, 1"], [23, "mov edx, eax"], [24, "mov rax, [rbp+var_48]"], [25, "imul edx, eax"], [26, "mov r15d, edx"], [27, "mov eax, r15d"], [28, "add rax, rax"], [29, "lea r12, [rsi+rax]"], [30, "mov rax, [rbp+var_40]"], [31, "and eax, 1"], [32, "test rax, rax"], [33, "jz loc_423BE0"], [34, "mov rax, [rbp+var_48]"], [35, "add rax, r12"], [36, "mov r12, rax"], [37, "jmp loc_423BE0"], [38, "mov r14d, r15d"], [39, "mov eax, r14d"], [40, "mov rcx, [rbp+var_60]"], [41, "lea r13, [rcx+rax]"], [42, "jmp short loc_423BC9"], [43, "add r14d, r14d"], [44, "cmp rbx, r12"], [45, "jz short loc_423B9D"], [46, "mov rax, [rbp+var_48]"], [47, "lea rdi, [rbx+rax]"], [48, "mov rax, [rbp+var_58]"], [49, "mov rcx, [rbp+var_50]"], [50, "mov rdx, rax"], [51, "mov rsi, rbx"], [52, "call rcx"], [53, "test eax, eax"], [54, "jle short loc_423B9D"], [55, "mov rax, [rbp+var_48]"], [56, "add rax, rbx"], [57, "mov rbx, rax"], [58, "mov rax, [rbp+var_48]"], [59, "add r14d, eax"], [60, "mov rax, [rbp+var_58]"], [61, "mov rcx, [rbp+var_50]"], [62, "mov rdx, rax"], [63, "mov rsi, rbx"], [64, "mov rdi, r13"], [65, "call rcx"], [66, "test eax, eax"], [67, "jns short loc_423BD8"], [68, "mov rax, [rbp+var_48]"], [69, "mov rdx, rax"], [70, "mov rsi, rbx"], [71, "mov rdi, r13"], [72, "call sub_4238E6"], [73, "mov r13, rbx"], [74, "mov eax, r14d"], [75, "lea rbx, [r13+rax+0]"], [76, "cmp rbx, r12"], [77, "jbe short loc_423B68"], [78, "jmp short loc_423BD9"], [79, "nop"], [80, "mov rax, [rbp+var_48]"], [81, "sub r15d, eax"], [82, "mov eax, r15d"], [83, "cmp [rbp+var_48], rax"], [84, "jnz loc_423B58"], [85, "jmp loc_423C8D"], [86, "mov r13, [rbp+var_38]"], [87, "mov rax, [rbp+var_48]"], [88, "mov r14d, eax"], [89, "jmp short loc_423C60"], [90, "add r14d, r14d"], [91, "cmp rbx, r12"], [92, "jz short loc_423C34"], [93, "mov rax, [rbp+var_48]"], [94, "lea rdi, [rbx+rax]"], [95, "mov rax, [rbp+var_58]"], [96, "mov rcx, [rbp+var_50]"], [97, "mov rdx, rax"], [98, "mov rsi, rbx"], [99, "call rcx"], [100, "test eax, eax"], [101, "jle short loc_423C34"], [102, "mov rax, [rbp+var_48]"], [103, "add rax, rbx"], [104, "mov rbx, rax"], [105, "mov rax, [rbp+var_48]"], [106, "add r14d, eax"], [107, "mov rax, [rbp+var_58]"], [108, "mov rcx, [rbp+var_50]"], [109, "mov rdx, rax"], [110, "mov rsi, rbx"], [111, "mov rdi, r13"], [112, "call rcx"], [113, "test eax, eax"], [114, "jns short loc_423C6F"], [115, "mov rax, [rbp+var_48]"], [116, "mov rdx, rax"], [117, "mov rsi, rbx"], [118, "mov rdi, r13"], [119, "call sub_4238E6"], [120, "mov r13, rbx"], [121, "mov eax, r14d"], [122, "lea rbx, [r13+rax+0]"], [123, "cmp rbx, r12"], [124, "jbe short loc_423BFF"], [125, "jmp short loc_423C70"], [126, "nop"], [127, "mov rdx, [rbp+var_48]"], [128, "mov rax, [rbp+var_38]"], [129, "mov rsi, r12"], [130, "mov rdi, rax"], [131, "call sub_4238E6"], [132, "mov rax, [rbp+var_48]"], [133, "neg rax"], [134, "add r12, rax"], [135, "cmp r12, [rbp+var_38]"], [136, "jnz loc_423BF2"], [137, "jmp short loc_423C9A"], [138, "nop"], [139, "add rsp, 38h"], [140, "pop rbx"], [141, "pop r12"], [142, "pop r13"], [143, "pop r14"], [144, "pop r15"], [145, "pop rbp"], [146, "retn"]], "data_dep": [[13, 9], [14, 13], [15, 10], [16, 15], [17, 16], [18, 8], [19, 18], [20, 19], [21, 9], [22, 21], [23, 22], [24, 10], [25, 23], [25, 24], [26, 25], [27, 26], [28, 27], [29, 28], [30, 9], [31, 30], [32, 31], [33, 32], [34, 10], [35, 34], [35, 29], [36, 35], [38, 81], [38, 26], [39, 38], [40, 20], [41, 39], [41, 73], [41, 41], [43, 59], [43, 43], [43, 38], [44, 36], [44, 29], [44, 75], [45, 44], [46, 10], [47, 71], [47, 64], [47, 46], [48, 12], [49, 11], [50, 48], [51, 75], [52, 49], [53, 52], [54, 53], [55, 10], [56, 55], [56, 75], [57, 56], [58, 10], [59, 43], [59, 58], [60, 12], [61, 11], [62, 60], [63, 57], [63, 75], [64, 41], [64, 73], [65, 61], [66, 65], [67, 66], [68, 10], [69, 68], [70, 57], [70, 75], [71, 73], [71, 41], [73, 57], [73, 75], [74, 59], [74, 43], [74, 38], [75, 74], [75, 57], [75, 75], [76, 36], [76, 75], [76, 29], [77, 76], [80, 10], [81, 80], [81, 81], [81, 26], [82, 81], [82, 26], [83, 82], [83, 10], [84, 83], [86, 8], [87, 10], [88, 87], [90, 88], [90, 106], [90, 90], [91, 29], [91, 134], [91, 36], [91, 122], [92, 91], [93, 10], [94, 71], [94, 64], [94, 130], [94, 118], [94, 93], [95, 12], [96, 11], [97, 95], [98, 122], [99, 96], [100, 99], [101, 100], [102, 10], [103, 102], [103, 122], [104, 103], [105, 10], [106, 90], [106, 105], [107, 12], [108, 11], [109, 107], [110, 104], [110, 122], [111, 86], [111, 120], [112, 108], [113, 112], [114, 113], [115, 10], [116, 115], [117, 104], [117, 122], [118, 86], [118, 120], [120, 104], [120, 122], [121, 88], [121, 106], [121, 90], [122, 104], [122, 122], [122, 57], [122, 121], [122, 75], [123, 36], [123, 29], [123, 134], [123, 122], [124, 123], [127, 10], [128, 8], [129, 36], [129, 29], [129, 134], [130, 128], [132, 10], [133, 132], [134, 133], [134, 134], [134, 36], [134, 29], [135, 36], [135, 29], [135, 134], [135, 8], [136, 135], [139, 7], [140, 6], [141, 5], [142, 4], [143, 3], [144, 2], [145, 0], [146, 133], [146, 82]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b_dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.jsonl.gz", "strip_func_name": "sub_423AD6", "query": "\n\n\nvoid __fastcall sub_423AD6(char *a1, unsigned __int64 a2, __int64 a3, int (__fastcall *a4)(char *, char *, __int64), __int64 a5)\n{\nunsigned int v5; // er15\nchar *v6; // r12\nunsigned int v7; // er14\nchar *i; // r13\nchar *v9; // rbx\nchar *v10; // r13\nint v11; // er14\nchar *v12; // rbx\n\nif ( a2 > 1 )\n{\nv5 = a3 * (a2 >> 1);\nv6 = &a1[2 * v5 - a3];\nif ( (a2 & 1) != 0 )\nv6 = &a1[2 * (unsigned int)a3 * (unsigned int)(a2 >> 1)];\nwhile ( a3 != v5 )\n{\nv7 = v5;\nfor ( i = &a1[v5 - a3]; ; i = v9 )\n{\nv9 = &i[v7];\nif ( v9 > v6 )\nbreak;\nv7 *= 2;\nif ( v9 != v6 && a4(&v9[a3], v9, a5) > 0 )\n{\nv9 += a3;\nv7 += a3;\n}\nif ( a4(i, v9, a5) >= 0 )\nbreak;\nsub_4238E6(i, v9, a3);\n}\nv5 -= a3;\n}\nwhile ( v6 != a1 )\n{\nv10 = a1;\nv11 = a3;\nwhile ( 1 )\n{\nv12 = &v10[v11];\nif ( v12 > v6 )\nbreak;\nv11 *= 2;\nif ( v12 != v6 && a4(&v12[a3], v12, a5) > 0 )\n{\nv12 += a3;\nv11 += a3;\n}\nif ( a4(v10, v12, a5) >= 0 )\nbreak;\nsub_4238E6(v10, v12, a3);\nv10 = v12;\n}\nsub_4238E6(a1, v6, a3);\nv6 -= a3;\n}\n}\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,sub_423AD6,sub_4238E6,]", "hints": "[]", "response": "{'a3': 'size', 'a4': 'cmp', 'a1': 'base', 'a2': 'n', 'a5': 'data', 'sub_423AD6': 'hsort_closure', 'sub_4238E6': 'swap'}"} | [
[
0.7866731286048889,
0.7336001992225647,
0.7190885543823242,
0.7036107778549194,
0.7011383771896362,
0.6894269585609436,
0.6827943325042725,
0.6824045181274414,
0.6784951686859131,
0.6771848797798157,
0.6762104034423828,
0.6738981604576111,
0.6687800884246826,
0.6677257418632507,
0.6673593521118164,
0.6672914028167725,
0.6664150953292847,
0.6660693883895874,
0.6658806204795837,
0.665499746799469
],
[
14807,
92020,
184336,
101461,
3764,
233099,
74067,
39116,
101205,
123257,
197367,
209787,
241629,
113981,
42984,
129825,
100003,
182485,
91666,
197366
]
] |
|
arm_fir_interpolate_init_f32 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | arm_status arm_fir_interpolate_init_f32(
arm_fir_interpolate_instance_f32 * S,
uint8_t L,
uint16_t numTaps,
const float32_t * pCoeffs,
float32_t * pState,
uint32_t blockSize)
{
arm_status status;
/* The filter length must be a multiple of the interpolation factor */
if ((numTaps % L) != 0U)
{
/* Set status as ARM_MATH_LENGTH_ERROR */
status = ARM_MATH_LENGTH_ERROR;
}
else
{
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Assign Interpolation factor */
S->L = L;
/* Assign polyPhaseLength */
S->phaseLength = numTaps / L;
/* Clear state buffer and size of buffer is always phaseLength + blockSize - 1 */
memset(pState, 0, (blockSize + ((uint32_t) S->phaseLength - 1U)) * sizeof(float32_t));
/* Assign state pointer */
S->pState = pState;
status = ARM_MATH_SUCCESS;
}
return (status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_418FE5", "function_addr": 4296677, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_18], rdi"], [4, "mov eax, edx"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+s], r8"], [7, "mov [rbp+var_34], r9d"], [8, "mov edx, esi"], [9, "mov [rbp+var_1C], dl"], [10, "mov [rbp+var_20], ax"], [11, "movzx eax, [rbp+var_20]"], [12, "movzx ecx, [rbp+var_1C]"], [13, "cdq"], [14, "idiv ecx"], [15, "mov eax, edx"], [16, "test eax, eax"], [17, "jz short loc_419022"], [18, "mov [rbp+var_4], 0FFFFFFFEh"], [19, "jmp short loc_41908E"], [20, "mov rax, [rbp+var_18]"], [21, "mov rdx, [rbp+var_28]"], [22, "mov [rax+8], rdx"], [23, "mov rax, [rbp+var_18]"], [24, "movzx edx, [rbp+var_1C]"], [25, "mov [rax], dl"], [26, "movzx eax, [rbp+var_20]"], [27, "movzx edi, [rbp+var_1C]"], [28, "cdq"], [29, "idiv edi"], [30, "mov edx, eax"], [31, "mov rax, [rbp+var_18]"], [32, "mov [rax+2], dx"], [33, "mov rax, [rbp+var_18]"], [34, "movzx eax, word ptr [rax+2]"], [35, "movzx edx, ax"], [36, "mov eax, [rbp+var_34]"], [37, "add eax, edx"], [38, "sub eax, 1"], [39, "mov eax, eax"], [40, "lea rdx, ds:0[rax*4]"], [41, "mov rax, [rbp+s]"], [42, "mov esi, 0"], [43, "mov rdi, rax"], [44, "call _memset"], [45, "mov rax, [rbp+var_18]"], [46, "mov rdx, [rbp+s]"], [47, "mov [rax+10h], rdx"], [48, "mov [rbp+var_4], 0"], [49, "mov eax, [rbp+var_4]"], [50, "leave"], [51, "retn"]], "data_dep": [[9, 8], [10, 4], [11, 10], [12, 9], [14, 12], [15, 8], [16, 15], [17, 16], [20, 3], [21, 5], [22, 20], [22, 21], [23, 3], [24, 9], [25, 23], [25, 24], [26, 10], [27, 9], [29, 27], [30, 26], [31, 3], [32, 31], [32, 30], [33, 3], [34, 33], [34, 32], [35, 34], [36, 7], [37, 36], [37, 35], [38, 37], [39, 38], [40, 35], [41, 6], [43, 41], [45, 3], [46, 6], [47, 46], [47, 45], [49, 18], [49, 48], [51, 49]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_418FE5", "query": "\n\n\n__int64 __fastcall sub_418FE5(__int64 a1, unsigned __int8 a2, unsigned __int16 a3, __int64 a4, void *a5, int a6)\n{\nif ( a3 % (int)a2 )\nreturn (unsigned int)-2;\n*(_QWORD *)(a1 + 8) = a4;\n*(_BYTE *)a1 = a2;\n*(_WORD *)(a1 + 2) = a3 / (int)a2;\nmemset(a5, 0, 4LL * ((unsigned int)*(unsigned __int16 *)(a1 + 2) + a6 - 1));\n*(_QWORD *)(a1 + 16) = a5;\nreturn 0;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,sub_418FE5,]", "hints": "[]", "response": "{'a3': 'numTaps', 'a4': 'pCoeffs', 'a1': 'S', 'a2': 'L', 'a5': 'pState', 'a6': 'blockSize', 'sub_418FE5': 'arm_fir_interpolate_init_f32'}"} | [
[
0.7311360836029053,
0.7226954102516174,
0.7197644710540771,
0.7092131972312927,
0.708319365978241,
0.7082030773162842,
0.7080463171005249,
0.7014889717102051,
0.6984319686889648,
0.6976799964904785,
0.6968417763710022,
0.6954123973846436,
0.6949398517608643,
0.6934669613838196,
0.6930192708969116,
0.6926653385162354,
0.6920236945152283,
0.6910787224769592,
0.6910760402679443,
0.6861507892608643
],
[
188413,
11583,
177926,
86221,
20582,
42487,
42193,
137487,
35326,
4639,
165357,
61581,
96161,
35605,
89451,
43450,
244743,
130565,
100630,
217717
]
] |
|
trace_needs_swap | e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149 | axboe | fio | NA | static int trace_needs_swap(const char *trace_file, int *swap)
{
struct blk_io_trace t;
int fd, ret;
*swap = -1;
fd = open(trace_file, O_RDONLY);
if (fd < 0) {
perror("open");
return 1;
}
ret = read(fd, &t, sizeof(t));
if (ret < 0) {
close(fd);
perror("read");
return 1;
} else if (ret != sizeof(t)) {
close(fd);
log_err("fio: short read on trace file\n");
return 1;
}
close(fd);
if ((t.magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
*swap = 0;
else {
/*
* Maybe it needs to be endian swapped...
*/
t.magic = fio_swap32(t.magic);
if ((t.magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
*swap = 1;
}
if (*swap == -1) {
log_err("fio: blktrace appears corrupt\n");
return 1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405556", "function_addr": 4216150, "binary_name": "e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+file], rdi"], [4, "mov [rbp+var_50], rsi"], [5, "mov rax, [rbp+var_50]"], [6, "mov dword ptr [rax], 0FFFFFFFFh"], [7, "mov rax, [rbp+file]"], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "mov eax, 0"], [11, "call _open64"], [12, "mov [rbp+fd], eax"], [13, "cmp [rbp+fd], 0"], [14, "jns short loc_4055A3"], [15, "mov edi, offset aOpen"], [16, "call _perror"], [17, "mov eax, 1"], [18, "jmp locret_40566C"], [19, "lea rcx, [rbp+buf]"], [20, "mov eax, [rbp+fd]"], [21, "mov edx, 30h "], [22, "mov rsi, rcx"], [23, "mov edi, eax"], [24, "call _read"], [25, "mov [rbp+var_8], eax"], [26, "cmp [rbp+var_8], 0"], [27, "jns short loc_4055E0"], [28, "mov eax, [rbp+fd]"], [29, "mov edi, eax"], [30, "call _close"], [31, "mov edi, offset aRead_0"], [32, "call _perror"], [33, "mov eax, 1"], [34, "jmp locret_40566C"], [35, "cmp [rbp+var_8], 30h "], [36, "jz short loc_405606"], [37, "mov eax, [rbp+fd]"], [38, "mov edi, eax"], [39, "call _close"], [40, "mov edi, offset aFioShortReadOn"], [41, "mov eax, 0"], [42, "call log_err"], [43, "mov eax, 1"], [44, "jmp short locret_40566C"], [45, "mov eax, [rbp+fd]"], [46, "mov edi, eax"], [47, "call _close"], [48, "mov eax, [rbp+buf]"], [49, "mov al, 0"], [50, "cmp eax, 65617400h"], [51, "jnz short loc_405628"], [52, "mov rax, [rbp+var_50]"], [53, "mov dword ptr [rax], 0"], [54, "jmp short loc_405646"], [55, "mov eax, [rbp+buf]"], [56, "bswap eax"], [57, "mov [rbp+buf], eax"], [58, "mov eax, [rbp+buf]"], [59, "mov al, 0"], [60, "cmp eax, 65617400h"], [61, "jnz short loc_405646"], [62, "mov rax, [rbp+var_50]"], [63, "mov dword ptr [rax], 1"], [64, "mov rax, [rbp+var_50]"], [65, "mov eax, [rax]"], [66, "cmp eax, 0FFFFFFFFh"], [67, "jnz short loc_405667"], [68, "mov edi, offset aFioBlktraceApp"], [69, "mov eax, 0"], [70, "call log_err"], [71, "mov eax, 1"], [72, "jmp short locret_40566C"], [73, "mov eax, 0"], [74, "leave"], [75, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [9, 7], [12, 11], [13, 12], [14, 13], [20, 12], [22, 19], [23, 20], [25, 24], [26, 25], [27, 26], [28, 12], [29, 28], [35, 25], [36, 35], [37, 12], [38, 37], [45, 12], [46, 45], [50, 49], [51, 50], [52, 4], [53, 52], [56, 55], [57, 56], [58, 57], [60, 59], [61, 60], [62, 4], [63, 62], [64, 4], [65, 6], [65, 64], [65, 63], [65, 53], [66, 65], [67, 66], [75, 17], [75, 71], [75, 43], [75, 73], [75, 33]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149_e8b52afc8f8a001a9a17e3d4277c8c64aab1466decaced621dfe69e627063149.jsonl.gz", "strip_func_name": "sub_405556", "query": "\n\n\n__int64 __fastcall sub_405556(const char *a1, _DWORD *a2)\n{\n__int64 result; // rax\nint v3; // edx\nint v4; // ecx\nint v5; // er8\nint v6; // er9\nint v7; // edx\nint v8; // ecx\nint v9; // er8\nint v10; // er9\nunsigned int v11; // eax\nunsigned int v12; // eax\nunsigned int buf[14]; // [rsp+10h] [rbp-40h] BYREF\nint v14; // [rsp+48h] [rbp-8h]\nint fd; // [rsp+4Ch] [rbp-4h]\n\n*a2 = -1;\nfd = open64(a1, 0);\nif ( fd >= 0 )\n{\nv14 = read(fd, buf, 0x30uLL);\nif ( v14 >= 0 )\n{\nif ( v14 == 48 )\n{\nclose(fd);\nv11 = buf[0];\nLOBYTE(v11) = 0;\nif ( v11 == 1700885504 )\n{\n*a2 = 0;\n}\nelse\n{\nbuf[0] = _byteswap_ulong(buf[0]);\nv12 = buf[0];\nLOBYTE(v12) = 0;\nif ( v12 == 1700885504 )\n*a2 = 1;\n}\nif ( *a2 == -1 )\n{\nlog_err((unsigned int)\"fio: blktrace appears corrupt\\n\", (unsigned int)buf, v7, v8, v9, v10);\nresult = 1LL;\n}\nelse\n{\nresult = 0LL;\n}\n}\nelse\n{\nclose(fd);\nlog_err((unsigned int)\"fio: short read on trace file\\n\", (unsigned int)buf, v3, v4, v5, v6);\nresult = 1LL;\n}\n}\nelse\n{\nclose(fd);\nperror(\"read\");\nresult = 1LL;\n}\n}\nelse\n{\nperror(\"open\");\nresult = 1LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,buf,sub_405556,]", "hints": "[]", "response": "{'a1': 'trace_file', 'a2': 'swap', 'buf': 't', 'sub_405556': 'trace_needs_swap'}"} | [
[
0.8838827610015869,
0.7643741369247437,
0.755233108997345,
0.7210797667503357,
0.7186856865882874,
0.7173209190368652,
0.7129586338996887,
0.7099569439888,
0.7086057066917419,
0.7076221704483032,
0.7070375680923462,
0.7030035257339478,
0.7026292085647583,
0.6997195482254028,
0.69822096824646,
0.6948205232620239,
0.6939864754676819,
0.6919655203819275,
0.6901544332504272,
0.6859564781188965
],
[
220824,
126251,
19336,
183684,
180846,
151998,
139679,
28599,
173773,
263331,
210363,
176535,
32217,
45154,
172182,
122176,
131219,
147426,
150462,
164812
]
] |
|
mrvl_hex_dump | 052ea9a61df016e3934f9ecde4531cbbc959fe605befe53f08f53a9c282bcf25 | sj15712795029 | stm32_sdio_wifi_marvell8801_wifi | NA | void
mrvl_hex_dump(char *pref, int width, uint8_t * buf, int len)
{
register int i, n;
for (i = 0, n = 1; i < len; i++, n++) {
if (n == 1) {
printf("%s", pref);
}
printf("%2.2X ", buf[i]);
if (n == width) {
printf("\n");
n = 0;
}
}
if (i && n != 1) {
printf("\n");
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401202", "function_addr": 4198914, "binary_name": "052ea9a61df016e3934f9ecde4531cbbc959fe605befe53f08f53a9c282bcf25.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 20h"], [5, "mov [rbp+var_18], rdi"], [6, "mov [rbp+var_1C], esi"], [7, "mov [rbp+var_28], rdx"], [8, "mov [rbp+var_20], ecx"], [9, "mov r12d, 0"], [10, "mov ebx, 1"], [11, "jmp short loc_40127F"], [12, "cmp ebx, 1"], [13, "jnz short loc_401243"], [14, "mov rax, [rbp+var_18]"], [15, "mov rsi, rax"], [16, "mov edi, offset format"], [17, "mov eax, 0"], [18, "call _printf"], [19, "movsxd rdx, r12d"], [20, "mov rax, [rbp+var_28]"], [21, "add rax, rdx"], [22, "movzx eax, byte ptr [rax]"], [23, "movzx eax, al"], [24, "mov esi, eax"], [25, "mov edi, offset a22x"], [26, "mov eax, 0"], [27, "call _printf"], [28, "cmp ebx, [rbp+var_1C]"], [29, "jnz short loc_401278"], [30, "mov edi, 0Ah"], [31, "call _putchar"], [32, "mov ebx, 0"], [33, "add r12d, 1"], [34, "add ebx, 1"], [35, "cmp r12d, [rbp+var_20]"], [36, "jl short loc_401228"], [37, "test r12d, r12d"], [38, "jz short loc_401299"], [39, "cmp ebx, 1"], [40, "jz short loc_401299"], [41, "mov edi, 0Ah"], [42, "call _putchar"], [43, "nop"], [44, "add rsp, 20h"], [45, "pop rbx"], [46, "pop r12"], [47, "pop rbp"], [48, "retn"]], "data_dep": [[12, 10], [12, 34], [13, 12], [14, 5], [15, 14], [19, 9], [19, 33], [20, 7], [21, 19], [21, 20], [22, 21], [23, 22], [24, 23], [28, 6], [28, 10], [28, 34], [29, 28], [33, 9], [33, 33], [34, 10], [34, 34], [34, 32], [35, 33], [35, 8], [35, 9], [36, 35], [37, 9], [37, 33], [38, 37], [39, 10], [39, 34], [40, 39], [44, 4], [45, 3], [46, 2], [47, 0], [48, 27], [48, 42], [48, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/052ea9a61df016e3934f9ecde4531cbbc959fe605befe53f08f53a9c282bcf25_052ea9a61df016e3934f9ecde4531cbbc959fe605befe53f08f53a9c282bcf25.jsonl.gz", "strip_func_name": "sub_401202", "query": "\n\n\nint __fastcall sub_401202(const char *a1, int a2, __int64 a3, int a4)\n{\nint v4; // er12\nint v5; // ebx\nint result; // eax\n\nv4 = 0;\nv5 = 1;\nwhile ( v4 < a4 )\n{\nif ( v5 == 1 )\nprintf(\"%s\", a1);\nresult = printf(\"%2.2X \", *(unsigned __int8 *)(v4 + a3));\nif ( v5 == a2 )\n{\nresult = putchar(10);\nv5 = 0;\n}\n++v4;\n++v5;\n}\nif ( v4 )\n{\nif ( v5 != 1 )\nresult = putchar(10);\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_401202,]", "hints": "[]", "response": "{'a3': 'buf', 'a4': 'len', 'a1': 'pref', 'a2': 'width', 'sub_401202': 'mrvl_hex_dump'}"} | [
[
0.8228287100791931,
0.7765170335769653,
0.7654715776443481,
0.7639972567558289,
0.7543120384216309,
0.7315047979354858,
0.7268467545509338,
0.7247498035430908,
0.7246971130371094,
0.7240716218948364,
0.7173956632614136,
0.7146067023277283,
0.7110152244567871,
0.7109418511390686,
0.7024139165878296,
0.701900064945221,
0.6972730159759521,
0.6971220970153809,
0.6957947015762329,
0.6936824917793274
],
[
256814,
82323,
26563,
226809,
150269,
101602,
124515,
35142,
203294,
84322,
112362,
211336,
194643,
130991,
200603,
206552,
80532,
118681,
139863,
169762
]
] |
|
read_queue | af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4 | rgerganov | nfqsed | NA | void read_queue()
{
struct nfq_handle *h;
struct nfq_q_handle *qh;
int fd;
int rv;
char buf[4096] __attribute__ ((aligned));
printf("opening library handle\n");
h = nfq_open();
if (!h) {
fprintf(stderr, "error during nfq_open()\n");
exit(1);
}
printf("unbinding existing nf_queue handler for AF_INET (if any)\n");
if (nfq_unbind_pf(h, AF_INET) < 0) {
fprintf(stderr, "error during nfq_unbind_pf()\n");
exit(1);
}
printf("binding nfnetlink_queue as nf_queue handler for AF_INET\n");
if (nfq_bind_pf(h, AF_INET) < 0) {
fprintf(stderr, "error during nfq_bind_pf()\n");
exit(1);
}
printf("binding this socket to queue '%d'\n", queue_num);
qh = nfq_create_queue(h, queue_num, &cb, NULL);
if (!qh) {
fprintf(stderr, "error during nfq_create_queue()\n");
exit(1);
}
printf("setting copy_packet mode\n");
if (nfq_set_mode(qh, NFQNL_COPY_PACKET, 0xffff) < 0) {
fprintf(stderr, "can't set packet_copy mode\n");
exit(1);
}
fd = nfq_fd(h);
while ((rv = recv(fd, buf, sizeof(buf), 0)) && rv >= 0) {
if (verbose) {
printf("packet received\n");
}
nfq_handle_packet(h, buf, rv);
}
printf("unbinding from queue 0\n");
nfq_destroy_queue(qh);
#ifdef INSANE
/* normally, applications SHOULD NOT issue this command, since
* it detaches other programs/sockets from AF_INET, too ! */
printf("unbinding from AF_INET\n");
nfq_unbind_pf(h, AF_INET);
#endif
printf("closing library handle\n");
nfq_close(h);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401DD8", "function_addr": 4201944, "binary_name": "af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1020h"], [3, "mov edi, offset s"], [4, "call _puts"], [5, "call _nfq_open"], [6, "mov [rbp+var_8], rax"], [7, "cmp [rbp+var_8], 0"], [8, "jnz short loc_401E25"], [9, "mov rax, cs:stderr"], [10, "mov rcx, rax"], [11, "mov edx, 18h"], [12, "mov esi, 1"], [13, "mov edi, offset aErrorDuringNfq"], [14, "call _fwrite"], [15, "mov edi, 1"], [16, "call _exit"], [17, "mov edi, offset aUnbindingExist"], [18, "call _puts"], [19, "mov rax, [rbp+var_8]"], [20, "mov esi, 2"], [21, "mov rdi, rax"], [22, "call _nfq_unbind_pf"], [23, "test eax, eax"], [24, "jns short loc_401E6C"], [25, "mov rax, cs:stderr"], [26, "mov rcx, rax"], [27, "mov edx, 1Dh"], [28, "mov esi, 1"], [29, "mov edi, offset aErrorDuringNfq_0"], [30, "call _fwrite"], [31, "mov edi, 1"], [32, "call _exit"], [33, "mov edi, offset aBindingNfnetli"], [34, "call _puts"], [35, "mov rax, [rbp+var_8]"], [36, "mov esi, 2"], [37, "mov rdi, rax"], [38, "call _nfq_bind_pf"], [39, "test eax, eax"], [40, "jns short loc_401EB3"], [41, "mov rax, cs:stderr"], [42, "mov rcx, rax"], [43, "mov edx, 1Bh"], [44, "mov esi, 1"], [45, "mov edi, offset aErrorDuringNfq_1"], [46, "call _fwrite"], [47, "mov edi, 1"], [48, "call _exit"], [49, "mov eax, cs:dword_40517C"], [50, "mov esi, eax"], [51, "mov edi, offset aBindingThisSoc"], [52, "mov eax, 0"], [53, "call _printf"], [54, "mov eax, cs:dword_40517C"], [55, "movzx esi, ax"], [56, "mov rax, [rbp+var_8]"], [57, "mov ecx, 0"], [58, "mov edx, offset sub_401B44"], [59, "mov rdi, rax"], [60, "call _nfq_create_queue"], [61, "mov [rbp+var_10], rax"], [62, "cmp [rbp+var_10], 0"], [63, "jnz short loc_401F1C"], [64, "mov rax, cs:stderr"], [65, "mov rcx, rax"], [66, "mov edx, 20h "], [67, "mov esi, 1"], [68, "mov edi, offset aErrorDuringNfq_2"], [69, "call _fwrite"], [70, "mov edi, 1"], [71, "call _exit"], [72, "mov edi, offset aSettingCopyPac"], [73, "call _puts"], [74, "mov rax, [rbp+var_10]"], [75, "mov edx, 0FFFFh"], [76, "mov esi, 2"], [77, "mov rdi, rax"], [78, "call _nfq_set_mode"], [79, "test eax, eax"], [80, "jns short loc_401F68"], [81, "mov rax, cs:stderr"], [82, "mov rcx, rax"], [83, "mov edx, 1Bh"], [84, "mov esi, 1"], [85, "mov edi, offset aCanTSetPacketC"], [86, "call _fwrite"], [87, "mov edi, 1"], [88, "call _exit"], [89, "mov rax, [rbp+var_8]"], [90, "mov rdi, rax"], [91, "call _nfq_fd"], [92, "mov [rbp+fd], eax"], [93, "jmp short loc_401FA6"], [94, "mov eax, cs:dword_405178"], [95, "test eax, eax"], [96, "jz short loc_401F8D"], [97, "mov edi, offset aPacketReceived"], [98, "call _puts"], [99, "mov edx, [rbp+var_18]"], [100, "lea rcx, [rbp+buf]"], [101, "mov rax, [rbp+var_8]"], [102, "mov rsi, rcx"], [103, "mov rdi, rax"], [104, "call _nfq_handle_packet"], [105, "lea rsi, [rbp+buf]"], [106, "mov eax, [rbp+fd]"], [107, "mov ecx, 0"], [108, "mov edx, 1000h"], [109, "mov edi, eax"], [110, "call _recv"], [111, "mov [rbp+var_18], eax"], [112, "cmp [rbp+var_18], 0"], [113, "jz short loc_401FD0"], [114, "cmp [rbp+var_18], 0"], [115, "jns short loc_401F79"], [116, "mov edi, offset aUnbindingFromQ"], [117, "call _puts"], [118, "mov rax, [rbp+var_10]"], [119, "mov rdi, rax"], [120, "call _nfq_destroy_queue"], [121, "mov edi, offset aClosingLibrary"], [122, "call _puts"], [123, "mov rax, [rbp+var_8]"], [124, "mov rdi, rax"], [125, "call _nfq_close"], [126, "nop"], [127, "leave"], [128, "retn"]], "data_dep": [[6, 5], [7, 6], [8, 7], [10, 9], [19, 6], [21, 19], [23, 22], [24, 23], [26, 25], [35, 6], [37, 35], [39, 38], [40, 39], [42, 41], [50, 49], [55, 54], [56, 6], [59, 56], [61, 60], [62, 61], [63, 62], [65, 64], [74, 61], [77, 74], [79, 78], [80, 79], [82, 81], [89, 6], [90, 89], [92, 91], [95, 94], [96, 95], [99, 111], [100, 107], [101, 6], [102, 100], [103, 101], [105, 76], [105, 102], [106, 92], [109, 106], [111, 110], [112, 111], [113, 112], [114, 111], [115, 114], [118, 61], [119, 118], [123, 6], [124, 123], [128, 125]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4_af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.jsonl.gz", "strip_func_name": "sub_401DD8", "query": "\n\n\n__int64 sub_401DD8()\n{\nchar buf[4104]; // [rsp+0h] [rbp-1020h] BYREF\nint v2; // [rsp+1008h] [rbp-18h]\nint fd; // [rsp+100Ch] [rbp-14h]\n\nputs(\"opening library handle\");\nif ( !nfq_open() )\n{\nfwrite(\"error during nfq_open()\\n\", 1uLL, 0x18uLL, stderr);\nexit(1);\n}\nputs(\"unbinding existing nf_queue handler for AF_INET (if any)\");\nif ( (int)nfq_unbind_pf() < 0 )\n{\nfwrite(\"error during nfq_unbind_pf()\\n\", 1uLL, 0x1DuLL, stderr);\nexit(1);\n}\nputs(\"binding nfnetlink_queue as nf_queue handler for AF_INET\");\nif ( (int)nfq_bind_pf() < 0 )\n{\nfwrite(\"error during nfq_bind_pf()\\n\", 1uLL, 0x1BuLL, stderr);\nexit(1);\n}\nprintf(\"binding this socket to queue '%d'\\n\", (unsigned int)dword_40517C);\nif ( !nfq_create_queue() )\n{\nfwrite(\"error during nfq_create_queue()\\n\", 1uLL, 0x20uLL, stderr);\nexit(1);\n}\nputs(\"setting copy_packet mode\");\nif ( (int)nfq_set_mode() < 0 )\n{\nfwrite(\"can't set packet_copy mode\\n\", 1uLL, 0x1BuLL, stderr);\nexit(1);\n}\nfd = nfq_fd();\nwhile ( 1 )\n{\nv2 = recv(fd, buf, 0x1000uLL, 0);\nif ( !v2 || v2 < 0 )\nbreak;\nif ( dword_405178 )\nputs(\"packet received\");\nnfq_handle_packet();\n}\nputs(\"unbinding from queue 0\");\nnfq_destroy_queue();\nputs(\"closing library handle\");\nreturn nfq_close();\n}\n\n\n\nQ:[v2,sub_401DD8,]", "hints": "[]", "response": "{'v2': 'rv', 'sub_401DD8': 'read_queue'}"} | [
[
0.8299806118011475,
0.8295488357543945,
0.8286511898040771,
0.8087542057037354,
0.8055224418640137,
0.7954216599464417,
0.7929571866989136,
0.7817184925079346,
0.781295657157898,
0.7809423804283142,
0.7784663438796997,
0.7731975317001343,
0.7629802823066711,
0.7617948651313782,
0.7570676207542419,
0.7558649778366089,
0.7500504851341248,
0.7497750520706177,
0.7486507892608643,
0.7469639778137207
],
[
216143,
62869,
245115,
198667,
248325,
226669,
236208,
151586,
164324,
9454,
24953,
260003,
214346,
254531,
194843,
99104,
206963,
135606,
212512,
91239
]
] |
|
StringToHex | 9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb | mikeryan | btcrack | NA | static int StringToHex (char *string, char *hexstr, int len) {
char *ptr;
char digits[3];
int i;
if (!string)
return -1;
if (strlen(string) < (unsigned int) len * 2)
return -1;
ptr = string;
for(i=0; i < len; i++) {
memcpy(&digits, ptr, 2);
digits[2] = '\0';
hexstr[i] = strtoul((const char *)&digits, NULL, 16);
ptr+=2;
if((*ptr == ' ') || (*ptr == ':'))
ptr++;
}
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402B9C", "function_addr": 4205468, "binary_name": "9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+var_24], edx"], [6, "cmp [rbp+s], 0"], [7, "jnz short loc_402BC0"], [8, "mov eax, 0FFFFFFFFh"], [9, "jmp locret_402C58"], [10, "mov rax, [rbp+s]"], [11, "mov rdi, rax"], [12, "call _strlen"], [13, "mov edx, [rbp+var_24]"], [14, "add edx, edx"], [15, "mov edx, edx"], [16, "cmp rax, rdx"], [17, "jnb short loc_402BDF"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp short locret_402C58"], [20, "mov rax, [rbp+s]"], [21, "mov [rbp+var_8], rax"], [22, "mov [rbp+var_C], 0"], [23, "jmp short loc_402C4B"], [24, "mov rax, [rbp+var_8]"], [25, "movzx eax, word ptr [rax]"], [26, "mov word ptr [rbp+nptr], ax"], [27, "mov [rbp+var_D], 0"], [28, "lea rax, [rbp+nptr]"], [29, "mov edx, 10h"], [30, "mov esi, 0"], [31, "mov rdi, rax"], [32, "call _strtoul"], [33, "mov rdx, rax"], [34, "mov eax, [rbp+var_C]"], [35, "movsxd rcx, eax"], [36, "mov rax, [rbp+var_20]"], [37, "add rax, rcx"], [38, "mov [rax], dl"], [39, "add [rbp+var_8], 2"], [40, "mov rax, [rbp+var_8]"], [41, "movzx eax, byte ptr [rax]"], [42, "cmp al, 20h "], [43, "jz short loc_402C42"], [44, "mov rax, [rbp+var_8]"], [45, "movzx eax, byte ptr [rax]"], [46, "cmp al, 3Ah "], [47, "jnz short loc_402C47"], [48, "add [rbp+var_8], 1"], [49, "add [rbp+var_C], 1"], [50, "mov eax, [rbp+var_C]"], [51, "cmp eax, [rbp+var_24]"], [52, "jl short loc_402BF0"], [53, "mov eax, 1"], [54, "leave"], [55, "retn"]], "data_dep": [[6, 3], [7, 6], [10, 3], [11, 10], [13, 5], [14, 13], [15, 14], [16, 12], [16, 15], [17, 16], [20, 3], [21, 20], [24, 39], [24, 48], [24, 21], [25, 38], [25, 24], [26, 25], [28, 26], [28, 25], [31, 28], [33, 32], [34, 22], [34, 49], [35, 34], [36, 4], [37, 36], [37, 35], [38, 37], [38, 33], [39, 21], [39, 39], [39, 48], [40, 39], [41, 40], [41, 38], [42, 41], [43, 42], [44, 39], [45, 38], [45, 44], [46, 45], [47, 46], [48, 39], [49, 22], [49, 49], [50, 49], [50, 22], [51, 50], [51, 5], [52, 51], [55, 8], [55, 53], [55, 18]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb_9e77911744ca7ee6c9412022863034e94541b1a6df625f5650eff190c87576cb.jsonl.gz", "strip_func_name": "sub_402B9C", "query": "\n\n\n__int64 __fastcall sub_402B9C(const char *a1, __int64 a2, int a3)\n{\nchar v4; // al\nchar nptr[2]; // [rsp+21h] [rbp-Fh] BYREF\nchar v7; // [rsp+23h] [rbp-Dh]\nint i; // [rsp+24h] [rbp-Ch]\nconst char *v9; // [rsp+28h] [rbp-8h]\n\nif ( !a1 )\nreturn 0xFFFFFFFFLL;\nif ( strlen(a1) < (unsigned int)(2 * a3) )\nreturn 0xFFFFFFFFLL;\nv9 = a1;\nfor ( i = 0; i < a3; ++i )\n{\n*(_WORD *)nptr = *(_WORD *)v9;\nv7 = 0;\nv4 = strtoul(nptr, 0LL, 16);\n*(_BYTE *)(i + a2) = v4;\nv9 += 2;\nif ( *v9 == 32 || *v9 == 58 )\n++v9;\n}\nreturn 1LL;\n}\n\n\n\nQ:[a3,a1,a2,nptr,v9,sub_402B9C,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'string', 'a2': 'hexstr', 'nptr': 'digits', 'v9': 'ptr', 'sub_402B9C': 'StringToHex'}"} | [
[
0.7267707586288452,
0.7242061495780945,
0.706350564956665,
0.6989343762397766,
0.6964398622512817,
0.6958400011062622,
0.694382905960083,
0.69370436668396,
0.6910251975059509,
0.6906159520149231,
0.6903939247131348,
0.6900777220726013,
0.6889215707778931,
0.6877172589302063,
0.6867392063140869,
0.6860788464546204,
0.6853121519088745,
0.6822550296783447,
0.6737655997276306,
0.6721445918083191
],
[
28202,
31215,
49067,
127755,
196923,
140021,
133473,
78294,
165546,
6067,
225603,
128257,
63873,
182998,
184826,
72884,
10908,
250015,
209234,
236179
]
] |
|
parser_appendcode | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static void parser_appendcode (const char *source, gravity_parser_t *parser) {
if (source == NULL) return;
size_t len = strlen(source);
if (len <= 0) return;
// build a new lexer based on source code to prepend
gravity_lexer_t *lexer1 = gravity_lexer_create(source, len, 0, true);
if (!lexer1) return;
// pop current lexer
gravity_lexer_t *lexer2 = POP_LEXER;
// swap lexer2 with lexer1
marray_push(gravity_lexer_t*, *parser->lexer, lexer1);
marray_push(gravity_lexer_t*, *parser->lexer, lexer2);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4160EC", "function_addr": 4284652, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 38h"], [4, "mov [rbp+s], rdi"], [5, "mov [rbp+var_40], rsi"], [6, "cmp [rbp+s], 0"], [7, "jz loc_4162D7"], [8, "mov rax, [rbp+s]"], [9, "mov rdi, rax"], [10, "call _strlen"], [11, "mov [rbp+var_18], rax"], [12, "cmp [rbp+var_18], 0"], [13, "jz loc_4162DA"], [14, "mov rsi, [rbp+var_18]"], [15, "mov rax, [rbp+s]"], [16, "mov ecx, 1"], [17, "mov edx, 0"], [18, "mov rdi, rax"], [19, "call sub_420F7C"], [20, "mov [rbp+var_20], rax"], [21, "cmp [rbp+var_20], 0"], [22, "jz loc_4162DD"], [23, "mov rax, [rbp+var_40]"], [24, "mov rax, [rax]"], [25, "mov rcx, [rax+10h]"], [26, "mov rax, [rbp+var_40]"], [27, "mov rax, [rax]"], [28, "mov rdx, [rax]"], [29, "sub rdx, 1"], [30, "mov [rax], rdx"], [31, "mov rax, [rax]"], [32, "shl rax, 3"], [33, "add rax, rcx"], [34, "mov rax, [rax]"], [35, "mov [rbp+var_28], rax"], [36, "mov rax, [rbp+var_40]"], [37, "mov rax, [rax]"], [38, "mov rdx, [rax]"], [39, "mov rax, [rbp+var_40]"], [40, "mov rax, [rax]"], [41, "mov rax, [rax+8]"], [42, "cmp rdx, rax"], [43, "jnz short loc_4161F8"], [44, "mov rax, [rbp+var_40]"], [45, "mov rax, [rax]"], [46, "mov rax, [rax+8]"], [47, "test rax, rax"], [48, "jz short loc_4161B4"], [49, "mov rax, [rbp+var_40]"], [50, "mov rax, [rax]"], [51, "mov rax, [rax+8]"], [52, "lea rdx, [rax+rax]"], [53, "jmp short loc_4161B9"], [54, "mov edx, 8"], [55, "mov rax, [rbp+var_40]"], [56, "mov rax, [rax]"], [57, "mov [rax+8], rdx"], [58, "mov rax, [rbp+var_40]"], [59, "mov rax, [rax]"], [60, "mov rax, [rax+8]"], [61, "lea rdx, ds:0[rax*8]"], [62, "mov rax, [rbp+var_40]"], [63, "mov rax, [rax]"], [64, "mov rax, [rax+10h]"], [65, "mov rcx, [rbp+var_40]"], [66, "mov rbx, [rcx]"], [67, "mov rsi, rdx"], [68, "mov rdi, rax"], [69, "call _realloc"], [70, "mov [rbx+10h], rax"], [71, "mov rax, [rbp+var_40]"], [72, "mov rax, [rax]"], [73, "mov rsi, [rax+10h]"], [74, "mov rax, [rbp+var_40]"], [75, "mov rax, [rax]"], [76, "mov rdx, [rax]"], [77, "lea rcx, [rdx+1]"], [78, "mov [rax], rcx"], [79, "lea rax, ds:0[rdx*8]"], [80, "lea rdx, [rsi+rax]"], [81, "mov rax, [rbp+var_20]"], [82, "mov [rdx], rax"], [83, "mov rax, [rbp+var_40]"], [84, "mov rax, [rax]"], [85, "mov rdx, [rax]"], [86, "mov rax, [rbp+var_40]"], [87, "mov rax, [rax]"], [88, "mov rax, [rax+8]"], [89, "cmp rdx, rax"], [90, "jnz short loc_4162A6"], [91, "mov rax, [rbp+var_40]"], [92, "mov rax, [rax]"], [93, "mov rax, [rax+8]"], [94, "test rax, rax"], [95, "jz short loc_416262"], [96, "mov rax, [rbp+var_40]"], [97, "mov rax, [rax]"], [98, "mov rax, [rax+8]"], [99, "lea rdx, [rax+rax]"], [100, "jmp short loc_416267"], [101, "mov edx, 8"], [102, "mov rax, [rbp+var_40]"], [103, "mov rax, [rax]"], [104, "mov [rax+8], rdx"], [105, "mov rax, [rbp+var_40]"], [106, "mov rax, [rax]"], [107, "mov rax, [rax+8]"], [108, "lea rdx, ds:0[rax*8]"], [109, "mov rax, [rbp+var_40]"], [110, "mov rax, [rax]"], [111, "mov rax, [rax+10h]"], [112, "mov rcx, [rbp+var_40]"], [113, "mov rbx, [rcx]"], [114, "mov rsi, rdx"], [115, "mov rdi, rax"], [116, "call _realloc"], [117, "mov [rbx+10h], rax"], [118, "mov rax, [rbp+var_40]"], [119, "mov rax, [rax]"], [120, "mov rsi, [rax+10h]"], [121, "mov rax, [rbp+var_40]"], [122, "mov rax, [rax]"], [123, "mov rdx, [rax]"], [124, "lea rcx, [rdx+1]"], [125, "mov [rax], rcx"], [126, "lea rax, ds:0[rdx*8]"], [127, "lea rdx, [rsi+rax]"], [128, "mov rax, [rbp+var_28]"], [129, "mov [rdx], rax"], [130, "jmp short loc_4162DE"], [131, "nop"], [132, "jmp short loc_4162DE"], [133, "nop"], [134, "jmp short loc_4162DE"], [135, "nop"], [136, "mov rbx, [rbp+var_8]"], [137, "leave"], [138, "retn"]], "data_dep": [[6, 4], [7, 6], [8, 4], [9, 8], [11, 10], [12, 11], [13, 12], [14, 11], [15, 4], [18, 15], [20, 19], [21, 20], [22, 21], [23, 5], [24, 23], [25, 24], [26, 5], [27, 26], [28, 27], [29, 28], [30, 27], [30, 29], [31, 30], [31, 27], [32, 31], [33, 32], [33, 25], [34, 30], [34, 33], [35, 34], [36, 5], [37, 30], [37, 36], [38, 37], [38, 30], [39, 5], [40, 30], [40, 39], [41, 40], [41, 30], [42, 41], [42, 38], [43, 42], [44, 5], [45, 30], [45, 44], [46, 45], [46, 30], [47, 46], [48, 47], [49, 5], [50, 49], [50, 30], [51, 50], [51, 30], [52, 51], [52, 30], [52, 38], [55, 5], [56, 30], [56, 55], [56, 57], [56, 70], [57, 52], [57, 54], [57, 56], [58, 5], [59, 57], [59, 58], [59, 30], [60, 57], [60, 59], [61, 52], [61, 54], [62, 5], [63, 30], [63, 62], [63, 57], [64, 57], [64, 63], [65, 5], [66, 57], [66, 65], [67, 61], [68, 64], [70, 66], [70, 69], [71, 5], [72, 82], [72, 57], [72, 70], [72, 30], [72, 78], [72, 71], [73, 30], [73, 78], [73, 82], [73, 57], [73, 70], [73, 72], [74, 5], [75, 74], [75, 30], [75, 78], [75, 82], [75, 57], [75, 70], [76, 70], [76, 30], [76, 78], [76, 82], [76, 57], [76, 75], [77, 76], [77, 30], [77, 78], [77, 25], [77, 82], [77, 57], [77, 70], [77, 65], [78, 77], [78, 75], [79, 75], [80, 76], [80, 78], [80, 79], [81, 20], [82, 81], [82, 80], [83, 5], [84, 83], [84, 78], [84, 82], [85, 82], [85, 84], [85, 78], [86, 5], [87, 82], [87, 86], [87, 78], [88, 87], [88, 82], [88, 57], [89, 88], [89, 85], [90, 89], [91, 5], [92, 30], [92, 78], [92, 82], [92, 57], [92, 70], [92, 91], [93, 70], [93, 92], [93, 30], [93, 78], [93, 82], [93, 57], [94, 93], [95, 94], [96, 5], [97, 30], [97, 78], [97, 96], [97, 82], [97, 57], [97, 70], [98, 30], [98, 78], [98, 82], [98, 57], [98, 70], [98, 97], [99, 85], [99, 30], [99, 78], [99, 98], [99, 82], [99, 57], [99, 70], [102, 5], [103, 102], [103, 104], [103, 117], [103, 30], [103, 78], [103, 82], [103, 57], [103, 70], [104, 99], [104, 101], [104, 103], [105, 5], [106, 104], [106, 78], [106, 105], [107, 104], [107, 106], [108, 99], [108, 101], [109, 5], [110, 109], [110, 104], [110, 78], [111, 110], [111, 104], [112, 5], [113, 112], [113, 104], [114, 108], [115, 111], [117, 116], [117, 113], [118, 5], [119, 78], [119, 82], [119, 57], [119, 70], [119, 125], [119, 118], [119, 129], [119, 104], [119, 117], [119, 30], [120, 129], [120, 104], [120, 117], [120, 30], [120, 78], [120, 119], [120, 82], [120, 57], [120, 125], [120, 70], [121, 5], [122, 104], [122, 57], [122, 117], [122, 30], [122, 121], [122, 78], [122, 82], [122, 70], [122, 125], [122, 129], [123, 57], [123, 125], [123, 70], [123, 129], [123, 104], [123, 122], [123, 117], [123, 30], [123, 78], [123, 82], [124, 129], [124, 104], [124, 117], [124, 30], [124, 112], [124, 78], [124, 82], [124, 57], [124, 123], [124, 77], [124, 125], [124, 70], [125, 122], [125, 124], [126, 122], [127, 125], [127, 126], [127, 123], [128, 35], [129, 128], [129, 127], [138, 128], [138, 10], [138, 19]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_4160EC", "query": "\n\n\nvoid __fastcall sub_4160EC(const char *a1, __int64 **a2)\n{\n__int64 v2; // rcx\n__int64 *v3; // rax\n__int64 v4; // rdx\n__int64 *v5; // rbx\n__int64 v6; // rsi\n__int64 v7; // rdx\n__int64 v8; // rdx\n__int64 *v9; // rbx\n__int64 v10; // rsi\n__int64 v11; // rdx\n__int64 v13; // [rsp+18h] [rbp-28h]\n__int64 v14; // [rsp+20h] [rbp-20h]\nsize_t v15; // [rsp+28h] [rbp-18h]\n\nif ( a1 )\n{\nv15 = strlen(a1);\nif ( v15 )\n{\nv14 = sub_420F7C(a1, v15, 0LL, 1LL);\nif ( v14 )\n{\nv2 = (*a2)[2];\nv3 = *a2;\n*v3 = **a2 - 1;\nv13 = *(_QWORD *)(v2 + 8 * *v3);\nif ( **a2 == (*a2)[1] )\n{\nif ( (*a2)[1] )\nv4 = 2 * (*a2)[1];\nelse\nv4 = 8LL;\n(*a2)[1] = v4;\nv5 = *a2;\nv5[2] = (__int64)realloc((void *)(*a2)[2], 8 * (*a2)[1]);\n}\nv6 = (*a2)[2];\nv7 = **a2;\n**a2 = v7 + 1;\n*(_QWORD *)(v6 + 8 * v7) = v14;\nif ( **a2 == (*a2)[1] )\n{\nif ( (*a2)[1] )\nv8 = 2 * (*a2)[1];\nelse\nv8 = 8LL;\n(*a2)[1] = v8;\nv9 = *a2;\nv9[2] = (__int64)realloc((void *)(*a2)[2], 8 * (*a2)[1]);\n}\nv10 = (*a2)[2];\nv11 = **a2;\n**a2 = v11 + 1;\n*(_QWORD *)(v10 + 8 * v11) = v13;\n}\n}\n}\n}\n\n\n\nQ:[a1,a2,v13,v14,v15,sub_4160EC,sub_420F7C,]", "hints": "[]", "response": "{'a1': 'source', 'a2': 'parser', 'v13': 'lexer2', 'v14': 'lexer1', 'v15': 'len', 'sub_4160EC': 'parser_appendcode', 'sub_420F7C': 'gravity_lexer_create'}"} | [
[
0.753584623336792,
0.7379489541053772,
0.7262886166572571,
0.7126548290252686,
0.7040582895278931,
0.6965124607086182,
0.6943923234939575,
0.6936561465263367,
0.6929546594619751,
0.6859055757522583,
0.6848819851875305,
0.6845844388008118,
0.6842118501663208,
0.6799660921096802,
0.6769615411758423,
0.6766464710235596,
0.6757451295852661,
0.6745998859405518,
0.6709322929382324,
0.6679893732070923
],
[
140530,
186618,
68096,
116793,
235753,
14550,
230514,
3870,
192760,
194564,
154323,
227892,
223247,
136207,
16332,
26383,
222496,
203801,
31264,
84440
]
] |
|
qrpc_clnt_raw_call_send | f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329 | coolsnowwolf | lede | NA | static int qrpc_clnt_raw_call_send(struct qrpc_clnt_raw_priv *const priv, const int len)
{
int ret;
static const uint16_t payload_max = ETH_FRAME_LEN - sizeof(struct qrpc_frame_hdr);
uint16_t pkt_nr;
uint16_t i;
uint16_t payload_done = 0;
struct qrpc_frame_hdr *hdr;
pkt_nr = (len + payload_max - 1) / payload_max;
for (i = 0; i < pkt_nr; i++) {
uint16_t payload_len = MIN((uint16_t)len - payload_done, payload_max);
/* build an EthII frame */
priv->out_hdr.sub_type = ((i != pkt_nr - 1) ? QRPC_FRAME_TYPE_FRAG
: QRPC_FRAME_TYPE_COMPLETE);
priv->out_hdr.sid = priv->sess_id;
hdr = (struct qrpc_frame_hdr *)priv->out_pktbuf;
memcpy(hdr, &priv->out_hdr, sizeof(priv->out_hdr));
memcpy(hdr + 1, priv->outbuf + payload_done, payload_len);
payload_done += payload_len;
do {
ret = sendto(priv->raw_sock, priv->out_pktbuf, sizeof(struct qrpc_frame_hdr) + payload_len, 0,
(struct sockaddr *)&priv->dst_addr, sizeof(priv->dst_addr));
} while (ret < 0 && errno == EINTR);
if ((uint16_t)ret != sizeof(struct qrpc_frame_hdr) + payload_len) {
priv->rpc_error.re_status = RPC_CANTSEND;
return -1;
}
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43C466", "function_addr": 4441190, "binary_name": "f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+addr], rdi"], [4, "mov [rbp+var_2C], esi"], [5, "mov [rbp+var_4], 0"], [6, "movzx eax, cs:word_44EE50"], [7, "movzx edx, ax"], [8, "mov eax, [rbp+var_2C]"], [9, "add eax, edx"], [10, "sub eax, 1"], [11, "movzx edx, cs:word_44EE50"], [12, "movzx edi, dx"], [13, "cdq"], [14, "idiv edi"], [15, "mov [rbp+var_6], ax"], [16, "mov [rbp+var_2], 0"], [17, "jmp loc_43C5DD"], [18, "movzx eax, cs:word_44EE50"], [19, "movzx eax, ax"], [20, "mov edx, [rbp+var_2C]"], [21, "movzx edx, dx"], [22, "movzx ecx, [rbp+var_4]"], [23, "sub edx, ecx"], [24, "cmp eax, edx"], [25, "cmovg eax, edx"], [26, "mov [rbp+var_8], ax"], [27, "movzx eax, [rbp+var_2]"], [28, "movzx edx, [rbp+var_6]"], [29, "sub edx, 1"], [30, "cmp eax, edx"], [31, "jz short loc_43C4DE"], [32, "mov edx, 5"], [33, "jmp short loc_43C4E3"], [34, "mov edx, 4"], [35, "mov rax, [rbp+addr]"], [36, "mov [rax+0C4h], dl"], [37, "mov rax, [rbp+addr]"], [38, "movzx edx, byte ptr [rax+0D0h]"], [39, "mov rax, [rbp+addr]"], [40, "mov [rax+0C5h], dl"], [41, "mov rax, [rbp+addr]"], [42, "mov rax, [rax+98h]"], [43, "mov [rbp+dest], rax"], [44, "mov rax, [rbp+addr]"], [45, "lea rcx, [rax+0B0h]"], [46, "mov rax, [rbp+dest]"], [47, "mov edx, 18h"], [48, "mov rsi, rcx"], [49, "mov rdi, rax"], [50, "call _memcpy"], [51, "movzx eax, [rbp+var_8]"], [52, "mov rdx, [rbp+addr]"], [53, "mov rcx, [rdx+90h]"], [54, "movzx edx, [rbp+var_4]"], [55, "lea rsi, [rcx+rdx]"], [56, "mov rdx, [rbp+dest]"], [57, "lea rcx, [rdx+18h]"], [58, "mov rdx, rax"], [59, "mov rdi, rcx"], [60, "call _memcpy"], [61, "movzx eax, [rbp+var_8]"], [62, "add [rbp+var_4], ax"], [63, "mov rcx, [rbp+addr]"], [64, "movzx eax, [rbp+var_8]"], [65, "lea rdx, [rax+18h]"], [66, "mov rax, [rbp+addr]"], [67, "mov rsi, [rax+98h]"], [68, "mov rax, [rbp+addr]"], [69, "mov eax, [rax+0CCh]"], [70, "mov r9d, 14h"], [71, "mov r8, rcx"], [72, "mov ecx, 0"], [73, "mov edi, eax"], [74, "call _sendto"], [75, "mov [rbp+var_14], eax"], [76, "cmp [rbp+var_14], 0"], [77, "jns short loc_43C5AD"], [78, "call ___errno_location"], [79, "mov eax, [rax]"], [80, "cmp eax, 4"], [81, "jz short loc_43C562"], [82, "mov eax, [rbp+var_14]"], [83, "movzx eax, ax"], [84, "movzx edx, [rbp+var_8]"], [85, "add rdx, 18h"], [86, "cmp rax, rdx"], [87, "jz short loc_43C5D2"], [88, "mov rax, [rbp+addr]"], [89, "mov dword ptr [rax+18h], 3"], [90, "mov eax, 0FFFFFFFFh"], [91, "jmp short locret_43C5F0"], [92, "movzx eax, [rbp+var_2]"], [93, "add eax, 1"], [94, "mov [rbp+var_2], ax"], [95, "movzx eax, [rbp+var_2]"], [96, "cmp ax, [rbp+var_6]"], [97, "jb loc_43C4A9"], [98, "mov eax, 0"], [99, "leave"], [100, "retn"]], "data_dep": [[7, 6], [8, 4], [9, 8], [9, 7], [10, 9], [12, 11], [14, 12], [15, 10], [19, 18], [20, 4], [21, 20], [22, 5], [22, 62], [23, 22], [23, 21], [24, 19], [24, 23], [25, 23], [25, 24], [26, 25], [27, 94], [27, 16], [28, 15], [29, 28], [30, 27], [30, 29], [31, 30], [35, 3], [36, 34], [36, 35], [36, 32], [37, 3], [38, 36], [38, 37], [39, 3], [40, 38], [40, 39], [41, 3], [42, 41], [42, 40], [43, 42], [44, 3], [45, 22], [45, 40], [45, 44], [46, 43], [48, 45], [49, 46], [51, 26], [52, 3], [53, 52], [53, 40], [54, 5], [54, 62], [55, 40], [55, 53], [55, 48], [56, 43], [57, 56], [57, 40], [57, 53], [58, 51], [59, 57], [61, 26], [62, 5], [62, 62], [62, 61], [63, 3], [64, 26], [65, 36], [65, 65], [65, 40], [65, 58], [65, 64], [66, 3], [67, 36], [67, 40], [67, 66], [68, 3], [69, 40], [69, 68], [69, 36], [71, 63], [73, 69], [75, 74], [76, 75], [77, 76], [79, 78], [79, 36], [79, 40], [80, 79], [81, 80], [82, 75], [83, 82], [84, 26], [85, 84], [86, 83], [86, 85], [87, 86], [88, 3], [89, 88], [92, 94], [92, 16], [93, 92], [94, 93], [95, 94], [95, 16], [96, 95], [96, 15], [97, 96], [100, 98], [100, 90]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329_f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329.jsonl.gz", "strip_func_name": "sub_43C466", "query": "\n\n\n__int64 __fastcall sub_43C466(__int64 a1, int a2)\n{\n__int16 v2; // ax\nchar v3; // dl\nint v5; // [rsp+1Ch] [rbp-14h]\nchar *dest; // [rsp+20h] [rbp-10h]\nunsigned __int16 v7; // [rsp+28h] [rbp-8h]\nunsigned __int16 v8; // [rsp+2Ah] [rbp-6h]\nunsigned __int16 v9; // [rsp+2Ch] [rbp-4h]\nunsigned __int16 i; // [rsp+2Eh] [rbp-2h]\n\nv9 = 0;\nv8 = (a2 + 1489) / 1490;\nfor ( i = 0; i < v8; ++i )\n{\nv2 = 1490;\nif ( (unsigned __int16)a2 - v9 < 1490 )\nv2 = a2 - v9;\nv7 = v2;\nif ( i == v8 - 1 )\nv3 = 4;\nelse\nv3 = 5;\n*(_BYTE *)(a1 + 196) = v3;\n*(_BYTE *)(a1 + 197) = *(_BYTE *)(a1 + 208);\ndest = *(char **)(a1 + 152);\nmemcpy(dest, (const void *)(a1 + 176), 0x18uLL);\nmemcpy(dest + 24, (const void *)(*(_QWORD *)(a1 + 144) + v9), v7);\nv9 += v7;\ndo\nv5 = sendto(*(_DWORD *)(a1 + 204), *(const void **)(a1 + 152), v7 + 24LL, 0, (const struct sockaddr *)a1, 0x14u);\nwhile ( v5 < 0 && *__errno_location() == 4 );\nif ( (unsigned __int16)v5 != v7 + 24LL )\n{\n*(_DWORD *)(a1 + 24) = 3;\nreturn 0xFFFFFFFFLL;\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,dest,v7,v8,v9,sub_43C466,]", "hints": "[]", "response": "{'a1': 'priv', 'a2': 'len', 'dest': 'hdr', 'v7': 'payload_len', 'v8': 'pkt_nr', 'v9': 'payload_done', 'sub_43C466': 'qrpc_clnt_raw_call_send'}"} | [
[
0.685703694820404,
0.6646930575370789,
0.6607080101966858,
0.6601225137710571,
0.653331458568573,
0.6500025391578674,
0.6493414044380188,
0.6453644037246704,
0.644894003868103,
0.639795184135437,
0.6392755508422852,
0.6346034407615662,
0.6327241063117981,
0.632188618183136,
0.6320985555648804,
0.6312980651855469,
0.6293734908103943,
0.6268999576568604,
0.6249889135360718,
0.6248100399971008
],
[
5693,
53519,
100568,
69501,
142177,
130217,
33821,
254752,
43799,
58688,
103681,
133876,
109274,
180608,
115788,
57828,
122700,
43265,
250883,
194901
]
] |
|
yuv_to_rgb | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | void yuv_to_rgb(int y, int u, int v, BYTE *r, BYTE *g, BYTE *b)
{
int tr, tg, tb;
y += 128 << FIXQ;
tr = (y + (FLOAT2FIX(1.40200f) * v >> FIXQ)) >> FIXQ;
tg = (y - (FLOAT2FIX(0.34414f) * u >> FIXQ) - (FLOAT2FIX(0.71414f) * v >> FIXQ)) >> FIXQ;
tb = (y + (FLOAT2FIX(1.77200f) * u >> FIXQ)) >> FIXQ;
/* ʹ */
*r = tr < 0 ? 0 : tr < 255 ? tr : 255;
*g = tg < 0 ? 0 : tg < 255 ? tg : 255;
*b = tb < 0 ? 0 : tb < 255 ? tb : 255;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40488A", "function_addr": 4212874, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_14], edi"], [3, "mov [rbp+var_18], esi"], [4, "mov [rbp+var_1C], edx"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+var_30], r8"], [7, "mov [rbp+var_38], r9"], [8, "add [rbp+var_14], 40000h"], [9, "mov eax, [rbp+var_1C]"], [10, "imul eax, 0B37h"], [11, "sar eax, 0Bh"], [12, "mov edx, eax"], [13, "mov eax, [rbp+var_14]"], [14, "add eax, edx"], [15, "sar eax, 0Bh"], [16, "mov [rbp+var_4], eax"], [17, "mov eax, [rbp+var_18]"], [18, "imul eax, 2C0h"], [19, "sar eax, 0Bh"], [20, "mov ecx, eax"], [21, "mov eax, [rbp+var_14]"], [22, "sub eax, ecx"], [23, "mov edx, eax"], [24, "mov eax, [rbp+var_1C]"], [25, "imul eax, 5B6h"], [26, "sar eax, 0Bh"], [27, "mov ecx, eax"], [28, "mov eax, edx"], [29, "sub eax, ecx"], [30, "sar eax, 0Bh"], [31, "mov [rbp+var_8], eax"], [32, "mov eax, [rbp+var_18]"], [33, "imul eax, 0E2Dh"], [34, "sar eax, 0Bh"], [35, "mov edx, eax"], [36, "mov eax, [rbp+var_14]"], [37, "add eax, edx"], [38, "sar eax, 0Bh"], [39, "mov [rbp+var_C], eax"], [40, "cmp [rbp+var_4], 0"], [41, "js short loc_404923"], [42, "mov eax, 0FFh"], [43, "cmp [rbp+var_4], 0FFh"], [44, "cmovle eax, [rbp+var_4]"], [45, "mov edx, eax"], [46, "jmp short loc_404928"], [47, "mov edx, 0"], [48, "mov rax, [rbp+var_28]"], [49, "mov [rax], dl"], [50, "cmp [rbp+var_8], 0"], [51, "js short loc_404948"], [52, "mov eax, 0FFh"], [53, "cmp [rbp+var_8], 0FFh"], [54, "cmovle eax, [rbp+var_8]"], [55, "mov edx, eax"], [56, "jmp short loc_40494D"], [57, "mov edx, 0"], [58, "mov rax, [rbp+var_30]"], [59, "mov [rax], dl"], [60, "cmp [rbp+var_C], 0"], [61, "js short loc_40496D"], [62, "mov eax, 0FFh"], [63, "cmp [rbp+var_C], 0FFh"], [64, "cmovle eax, [rbp+var_C]"], [65, "mov edx, eax"], [66, "jmp short loc_404972"], [67, "mov edx, 0"], [68, "mov rax, [rbp+var_38]"], [69, "mov [rax], dl"], [70, "nop"], [71, "pop rbp"], [72, "retn"]], "data_dep": [[8, 2], [9, 4], [10, 9], [11, 10], [12, 11], [13, 8], [14, 13], [14, 12], [15, 14], [16, 15], [17, 3], [18, 17], [19, 18], [20, 19], [21, 8], [22, 20], [22, 21], [23, 22], [24, 4], [25, 24], [26, 25], [27, 26], [28, 23], [29, 28], [29, 27], [30, 29], [31, 30], [32, 3], [33, 32], [34, 33], [35, 34], [36, 8], [37, 36], [37, 35], [38, 37], [39, 38], [40, 16], [41, 40], [43, 16], [44, 16], [45, 44], [48, 5], [49, 47], [49, 45], [49, 48], [50, 31], [51, 50], [53, 31], [54, 31], [55, 54], [58, 6], [59, 55], [59, 58], [59, 57], [60, 39], [61, 60], [63, 39], [64, 39], [65, 64], [68, 7], [69, 65], [69, 68], [69, 67], [71, 0], [72, 68]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea_219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.jsonl.gz", "strip_func_name": "sub_40488A", "query": "\n\n\n_BYTE *__fastcall sub_40488A(int a1, int a2, int a3, _BYTE *a4, char *a5, _BYTE *a6)\n{\nint v6; // eax\nchar v7; // dl\nchar v8; // al\nchar v9; // dl\nint v10; // eax\nchar v11; // dl\n_BYTE *result; // rax\nint v13; // [rsp+2Ch] [rbp-Ch]\nint v14; // [rsp+30h] [rbp-8h]\nint v15; // [rsp+34h] [rbp-4h]\n\nv15 = (((2871 * a3) >> 11) + a1 + 0x40000) >> 11;\nv14 = (a1 + 0x40000 - ((704 * a2) >> 11) - ((1462 * a3) >> 11)) >> 11;\nv13 = (((3629 * a2) >> 11) + a1 + 0x40000) >> 11;\nif ( v15 < 0 )\n{\nv7 = 0;\n}\nelse\n{\nLOBYTE(v6) = -1;\nif ( v15 <= 255 )\nv6 = (((2871 * a3) >> 11) + a1 + 0x40000) >> 11;\nv7 = v6;\n}\n*a4 = v7;\nif ( v14 < 0 )\n{\nv9 = 0;\n}\nelse\n{\nv8 = -1;\nif ( v14 <= 255 )\nv8 = v14;\nv9 = v8;\n}\n*a5 = v9;\nif ( v13 < 0 )\n{\nv11 = 0;\n}\nelse\n{\nLOBYTE(v10) = -1;\nif ( v13 <= 255 )\nv10 = (((3629 * a2) >> 11) + a1 + 0x40000) >> 11;\nv11 = v10;\n}\nresult = a6;\n*a6 = v11;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,v13,v14,v15,sub_40488A,]", "hints": "[]", "response": "{'a3': 'v', 'a4': 'r', 'a1': 'y', 'a2': 'u', 'a5': 'g', 'a6': 'b', 'v13': 'tb', 'v14': 'tg', 'v15': 'tr', 'sub_40488A': 'yuv_to_rgb'}"} | [
[
0.805390477180481,
0.7904495000839233,
0.7903180122375488,
0.7704875469207764,
0.7704763412475586,
0.7642355561256409,
0.7585857510566711,
0.7528561353683472,
0.7523915767669678,
0.7523590922355652,
0.7512307167053223,
0.7478024363517761,
0.7453888654708862,
0.7429288625717163,
0.7409507632255554,
0.7398539185523987,
0.7377135753631592,
0.7371820211410522,
0.7320582866668701,
0.7303861379623413
],
[
72328,
38052,
180140,
187344,
105247,
224039,
113488,
203557,
88496,
199002,
156064,
120492,
7952,
5588,
136112,
133715,
184470,
30920,
204701,
220872
]
] |
|
unzGetCurrentFileInfo | 3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f | yquake2 | yquake2 | NA | extern int ZEXPORT unzGetCurrentFileInfo(unzFile file,
unz_file_info * pfile_info,
char * szFileName, uLong fileNameBufferSize,
void *extraField, uLong extraFieldBufferSize,
char* szComment, uLong commentBufferSize) {
int err;
unz_file_info64 file_info64;
err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL,
szFileName,fileNameBufferSize,
extraField,extraFieldBufferSize,
szComment,commentBufferSize);
if ((err==UNZ_OK) && (pfile_info != NULL))
{
pfile_info->version = file_info64.version;
pfile_info->version_needed = file_info64.version_needed;
pfile_info->flag = file_info64.flag;
pfile_info->compression_method = file_info64.compression_method;
pfile_info->dosDate = file_info64.dosDate;
pfile_info->crc = file_info64.crc;
pfile_info->size_filename = file_info64.size_filename;
pfile_info->size_file_extra = file_info64.size_file_extra;
pfile_info->size_file_comment = file_info64.size_file_comment;
pfile_info->disk_num_start = file_info64.disk_num_start;
pfile_info->internal_fa = file_info64.internal_fa;
pfile_info->external_fa = file_info64.external_fa;
pfile_info->tmu_date = file_info64.tmu_date;
pfile_info->compressed_size = (uLong)file_info64.compressed_size;
pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size;
}
return err;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_49BE91", "function_addr": 4832913, "binary_name": "3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.elf_extract.pkl\n"}, "code": [[0, "sub rsp, 0C8h"], [1, "mov [rsp+0C8h+var_A0], rdi"], [2, "mov [rsp+0C8h+var_A8], rsi"], [3, "mov [rsp+0C8h+var_B0], rdx"], [4, "mov [rsp+0C8h+var_B8], rcx"], [5, "mov [rsp+0C8h+var_C0], r8"], [6, "mov [rsp+0C8h+var_C8], r9"], [7, "mov rdi, [rsp+0C8h+var_C0]"], [8, "mov rcx, [rsp+0C8h+var_B8]"], [9, "mov rdx, [rsp+0C8h+var_B0]"], [10, "lea rsi, [rsp+0C8h+var_98]"], [11, "mov rax, [rsp+0C8h+var_A0]"], [12, "sub rsp, 8"], [13, "push [rsp+0D0h+arg_8]"], [14, "push [rsp+0D8h+arg_0]"], [15, "push [rsp+0E0h+var_C8]"], [16, "mov r9, rdi"], [17, "mov r8, rcx"], [18, "mov rcx, rdx"], [19, "mov edx, 0"], [20, "mov rdi, rax"], [21, "call sub_49B27B"], [22, "add rsp, 20h"], [23, "mov [rsp+0C8h+var_C], eax"], [24, "cmp [rsp+0C8h+var_C], 0"], [25, "jnz loc_49C01A"], [26, "cmp [rsp+0C8h+var_A8], 0"], [27, "jz loc_49C01A"], [28, "mov rdx, [rsp+0C8h+var_98]"], [29, "mov rax, [rsp+0C8h+var_A8]"], [30, "mov [rax], rdx"], [31, "mov rdx, [rsp+0C8h+var_90]"], [32, "mov rax, [rsp+0C8h+var_A8]"], [33, "mov [rax+8], rdx"], [34, "mov rdx, [rsp+0C8h+var_88]"], [35, "mov rax, [rsp+0C8h+var_A8]"], [36, "mov [rax+10h], rdx"], [37, "mov rdx, [rsp+0C8h+var_80]"], [38, "mov rax, [rsp+0C8h+var_A8]"], [39, "mov [rax+18h], rdx"], [40, "mov rdx, [rsp+0C8h+var_78]"], [41, "mov rax, [rsp+0C8h+var_A8]"], [42, "mov [rax+20h], rdx"], [43, "mov rdx, [rsp+0C8h+var_70]"], [44, "mov rax, [rsp+0C8h+var_A8]"], [45, "mov [rax+28h], rdx"], [46, "mov rdx, [rsp+0C8h+var_58]"], [47, "mov rax, [rsp+0C8h+var_A8]"], [48, "mov [rax+40h], rdx"], [49, "mov rdx, [rsp+0C8h+var_50]"], [50, "mov rax, [rsp+0C8h+var_A8]"], [51, "mov [rax+48h], rdx"], [52, "mov rdx, [rsp+0C8h+var_48]"], [53, "mov rax, [rsp+0C8h+var_A8]"], [54, "mov [rax+50h], rdx"], [55, "mov rdx, [rsp+0C8h+var_40]"], [56, "mov rax, [rsp+0C8h+var_A8]"], [57, "mov [rax+58h], rdx"], [58, "mov rdx, [rsp+0C8h+var_38]"], [59, "mov rax, [rsp+0C8h+var_A8]"], [60, "mov [rax+60h], rdx"], [61, "mov rdx, [rsp+0C8h+var_30]"], [62, "mov rax, [rsp+0C8h+var_A8]"], [63, "mov [rax+68h], rdx"], [64, "mov rcx, [rsp+0C8h+var_A8]"], [65, "mov rax, [rsp+0C8h+var_28]"], [66, "mov rdx, [rsp+0C8h+var_20]"], [67, "mov [rcx+70h], rax"], [68, "mov [rcx+78h], rdx"], [69, "mov rax, [rsp+0C8h+var_18]"], [70, "mov [rcx+80h], rax"], [71, "mov rdx, [rsp+0C8h+var_68]"], [72, "mov rax, [rsp+0C8h+var_A8]"], [73, "mov [rax+30h], rdx"], [74, "mov rdx, [rsp+0C8h+var_60]"], [75, "mov rax, [rsp+0C8h+var_A8]"], [76, "mov [rax+38h], rdx"], [77, "mov eax, [rsp+0C8h+var_C]"], [78, "add rsp, 0C8h"], [79, "retn"]], "data_dep": [[7, 5], [8, 4], [9, 3], [11, 1], [12, 0], [16, 7], [17, 8], [18, 9], [20, 11], [22, 12], [23, 21], [24, 23], [25, 24], [26, 2], [27, 26], [29, 2], [30, 29], [30, 28], [32, 2], [33, 32], [33, 31], [35, 2], [36, 34], [36, 35], [38, 2], [39, 38], [39, 37], [41, 2], [42, 41], [42, 40], [44, 2], [45, 43], [45, 44], [47, 2], [48, 47], [48, 46], [50, 2], [51, 50], [51, 49], [53, 2], [54, 52], [54, 53], [56, 2], [57, 56], [57, 55], [59, 2], [60, 59], [60, 58], [62, 2], [63, 62], [63, 61], [64, 2], [67, 65], [67, 64], [68, 66], [68, 64], [70, 64], [70, 69], [72, 2], [73, 71], [73, 72], [75, 2], [76, 75], [76, 74], [77, 23], [78, 22], [79, 77]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f_3dcf9b97b1c5d69ccd59d180de83033718cc3b2064c9c1e1f91608bdd820595f.jsonl.gz", "strip_func_name": "sub_49BE91", "query": "\n\n\n__int64 __fastcall sub_49BE91(__int64 *a1, _QWORD *a2, __int64 a3, unsigned __int64 a4, __int64 a5, unsigned __int64 a6, __int64 a7, unsigned __int64 a8)\n{\n__int64 v8; // rdx\n__int64 v10[17]; // [rsp+38h] [rbp-98h] BYREF\nunsigned int v11; // [rsp+C4h] [rbp-Ch]\n\nv11 = sub_49B27B(a1, v10, 0LL, a3, a4, a5, a6, a7, a8);\nif ( !v11 && a2 )\n{\n*a2 = v10[0];\na2[1] = v10[1];\na2[2] = v10[2];\na2[3] = v10[3];\na2[4] = v10[4];\na2[5] = v10[5];\na2[8] = v10[8];\na2[9] = v10[9];\na2[10] = v10[10];\na2[11] = v10[11];\na2[12] = v10[12];\na2[13] = v10[13];\nv8 = v10[15];\na2[14] = v10[14];\na2[15] = v8;\na2[16] = v10[16];\na2[6] = v10[6];\na2[7] = v10[7];\n}\nreturn v11;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,v10,v11,sub_49BE91,sub_49B27B,]", "hints": "[]", "response": "{'a3': 'szFileName', 'a4': 'fileNameBufferSize', 'a1': 'file', 'a2': 'pfile_info', 'a5': 'extraField', 'a6': 'extraFieldBufferSize', 'a7': 'szComment', 'a8': 'commentBufferSize', 'v10': 'file_info64', 'v11': 'err', 'sub_49BE91': 'unzGetCurrentFileInfo', 'sub_49B27B': 'unz64local_GetCurrentFileInfoInternal'}"} | [
[
0.7624426484107971,
0.7342768907546997,
0.7296555638313293,
0.724596381187439,
0.7201266288757324,
0.718341588973999,
0.7182329893112183,
0.7114392518997192,
0.7112400531768799,
0.7097619771957397,
0.7061439156532288,
0.7016392350196838,
0.6979238986968994,
0.695269763469696,
0.691207230091095,
0.6901613473892212,
0.6868253946304321,
0.6863596439361572,
0.6843621730804443,
0.6843081116676331
],
[
19339,
82344,
123034,
10283,
116861,
66626,
191799,
15217,
164710,
142206,
82572,
179392,
26298,
112787,
49414,
178685,
165282,
197715,
33252,
64965
]
] |
|
baTime2tmEx | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | BA_API int
baTime2tmEx(const BaTimeEx* tex, const BaBool emulategicv2, struct BaTm* tm)
{
S64 sec;
U32 rdn;
U32 sid;
U32 Z, H, A, B;
U16 C, y, m, d;
if(!writeclkdivn(tex))
return -1;
sec = tex->sec + EPOCHS;
if(emulategicv2)
sec += tex->offset * 60;
rdn = (U32)(sec / 86400);
sid = sec % 86400;
Z = rdn + 306;
H = 100 * Z - 25;
A = H / 3652425;
B = A - (A >> 2);
y = (100 * B + H) / 36525;
C = B + Z - (1461 * y >> 2);
m = (535 * C + 48950) >> 14;
if (m > 12)
d = C - 306, y++, m -= 12;
else
d = C + 59 + ((y & 3) == 0 && (y % 100 != 0 || y % 400 == 0));
tm->tm_mday = C - protocolmailbox[m];
tm->tm_mon = m - 1;
tm->tm_year = y;
tm->tm_wday = rdn % 7;
tm->tm_yday = d - 1;
tm->tm_sec = sid % 60; sid /= 60;
tm->tm_min = sid % 60; sid /= 60;
tm->tm_hour = sid;
tm->nsec = tex->nsec;
tm->offset=tex->offset;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41890A", "function_addr": 4294922, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 48h"], [3, "mov [rbp+var_38], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_48], rdx"], [6, "mov [rbp+var_3C], al"], [7, "mov rax, [rbp+var_38]"], [8, "mov rdi, rax"], [9, "call sub_418825"], [10, "test eax, eax"], [11, "jnz short loc_418939"], [12, "mov eax, 0FFFFFFFFh"], [13, "jmp locret_418C37"], [14, "mov rax, [rbp+var_38]"], [15, "mov rax, [rax]"], [16, "mov rdx, 0E77934880h"], [17, "add rax, rdx"], [18, "mov [rbp+var_8], rax"], [19, "cmp [rbp+var_3C], 0"], [20, "jz short loc_418969"], [21, "mov rax, [rbp+var_38]"], [22, "movzx eax, word ptr [rax+0Ch]"], [23, "cwde"], [24, "imul eax, 3Ch "], [25, "cdqe"], [26, "add [rbp+var_8], rax"], [27, "mov rcx, [rbp+var_8]"], [28, "mov rdx, 1845C8A0CE512957h"], [29, "mov rax, rcx"], [30, "imul rdx"], [31, "mov rax, rdx"], [32, "sar rax, 0Dh"], [33, "sar rcx, 3Fh"], [34, "mov rdx, rcx"], [35, "sub rax, rdx"], [36, "mov [rbp+var_14], eax"], [37, "mov rcx, [rbp+var_8]"], [38, "mov rdx, 1845C8A0CE512957h"], [39, "mov rax, rcx"], [40, "imul rdx"], [41, "mov rax, rdx"], [42, "sar rax, 0Dh"], [43, "mov rdx, rcx"], [44, "sar rdx, 3Fh"], [45, "sub rax, rdx"], [46, "imul rdx, rax, 15180h"], [47, "mov rax, rcx"], [48, "sub rax, rdx"], [49, "mov [rbp+var_18], eax"], [50, "mov eax, [rbp+var_14]"], [51, "add eax, 132h"], [52, "mov [rbp+var_1C], eax"], [53, "mov eax, [rbp+var_1C]"], [54, "imul eax, 64h "], [55, "sub eax, 19h"], [56, "mov [rbp+var_20], eax"], [57, "mov eax, [rbp+var_20]"], [58, "mov edx, eax"], [59, "imul rdx, 25FB03C7h"], [60, "shr rdx, 20h"], [61, "sub eax, edx"], [62, "shr eax, 1"], [63, "add eax, edx"], [64, "shr eax, 15h"], [65, "mov [rbp+var_24], eax"], [66, "mov eax, [rbp+var_24]"], [67, "shr eax, 2"], [68, "mov edx, eax"], [69, "mov eax, [rbp+var_24]"], [70, "sub eax, edx"], [71, "mov [rbp+var_28], eax"], [72, "mov eax, [rbp+var_28]"], [73, "imul edx, eax, 64h "], [74, "mov eax, [rbp+var_20]"], [75, "add eax, edx"], [76, "mov edx, eax"], [77, "mov eax, 0E5AAE5E1h"], [78, "imul rax, rdx"], [79, "shr rax, 20h"], [80, "shr eax, 0Fh"], [81, "mov [rbp+var_A], ax"], [82, "mov eax, [rbp+var_28]"], [83, "mov edx, eax"], [84, "mov eax, [rbp+var_1C]"], [85, "add edx, eax"], [86, "movzx eax, [rbp+var_A]"], [87, "imul eax, 5B5h"], [88, "sar eax, 2"], [89, "mov ecx, eax"], [90, "mov eax, edx"], [91, "sub eax, ecx"], [92, "mov [rbp+var_2A], ax"], [93, "movzx eax, [rbp+var_2A]"], [94, "imul eax, 217h"], [95, "add eax, 0BF36h"], [96, "sar eax, 0Eh"], [97, "mov [rbp+var_C], ax"], [98, "cmp [rbp+var_C], 0Ch"], [99, "jbe short loc_418A89"], [100, "movzx eax, [rbp+var_2A]"], [101, "sub ax, 132h"], [102, "mov [rbp+var_E], ax"], [103, "movzx eax, [rbp+var_A]"], [104, "add eax, 1"], [105, "mov [rbp+var_A], ax"], [106, "sub [rbp+var_C], 0Ch"], [107, "jmp loc_418B18"], [108, "movzx eax, [rbp+var_A]"], [109, "and eax, 3"], [110, "test eax, eax"], [111, "jnz short loc_418B04"], [112, "movzx ecx, [rbp+var_A]"], [113, "mov eax, ecx"], [114, "shr ax, 2"], [115, "movzx eax, ax"], [116, "imul eax, 147Bh"], [117, "shr eax, 10h"], [118, "mov edx, eax"], [119, "shr dx, 1"], [120, "mov eax, edx"], [121, "shl eax, 2"], [122, "add eax, edx"], [123, "lea edx, ds:0[rax*4]"], [124, "add eax, edx"], [125, "shl eax, 2"], [126, "sub ecx, eax"], [127, "mov edx, ecx"], [128, "test dx, dx"], [129, "jnz short loc_418AFD"], [130, "movzx edx, [rbp+var_A]"], [131, "mov eax, edx"], [132, "shr ax, 4"], [133, "movzx eax, ax"], [134, "imul eax, 0A3Eh"], [135, "shr eax, 10h"], [136, "mov ecx, eax"], [137, "mov eax, ecx"], [138, "shl eax, 2"], [139, "add eax, ecx"], [140, "lea ecx, ds:0[rax*4]"], [141, "add eax, ecx"], [142, "shl eax, 4"], [143, "sub edx, eax"], [144, "test dx, dx"], [145, "jnz short loc_418B04"], [146, "mov eax, 1"], [147, "jmp short loc_418B09"], [148, "mov eax, 0"], [149, "mov edx, eax"], [150, "movzx eax, [rbp+var_2A]"], [151, "add eax, edx"], [152, "add eax, 3Bh "], [153, "mov [rbp+var_E], ax"], [154, "movzx edx, [rbp+var_2A]"], [155, "movzx eax, [rbp+var_C]"], [156, "cdqe"], [157, "movzx eax, ds:word_47A690[rax+rax]"], [158, "movzx eax, ax"], [159, "sub edx, eax"], [160, "mov rax, [rbp+var_48]"], [161, "mov [rax+0Ch], edx"], [162, "movzx eax, [rbp+var_C]"], [163, "lea edx, [rax-1]"], [164, "mov rax, [rbp+var_48]"], [165, "mov [rax+10h], edx"], [166, "movzx edx, [rbp+var_A]"], [167, "mov rax, [rbp+var_48]"], [168, "mov [rax+14h], edx"], [169, "mov ecx, [rbp+var_14]"], [170, "mov eax, ecx"], [171, "imul rax, 24924925h"], [172, "shr rax, 20h"], [173, "mov rdx, rax"], [174, "mov eax, ecx"], [175, "sub eax, edx"], [176, "shr eax, 1"], [177, "add eax, edx"], [178, "shr eax, 2"], [179, "mov edx, eax"], [180, "shl edx, 3"], [181, "sub edx, eax"], [182, "mov eax, ecx"], [183, "sub eax, edx"], [184, "mov edx, eax"], [185, "mov rax, [rbp+var_48]"], [186, "mov [rax+18h], edx"], [187, "movzx eax, [rbp+var_E]"], [188, "lea edx, [rax-1]"], [189, "mov rax, [rbp+var_48]"], [190, "mov [rax+1Ch], edx"], [191, "mov edx, [rbp+var_18]"], [192, "mov ecx, edx"], [193, "mov eax, 88888889h"], [194, "imul rax, rcx"], [195, "shr rax, 20h"], [196, "shr eax, 5"], [197, "imul ecx, eax, 3Ch "], [198, "mov eax, edx"], [199, "sub eax, ecx"], [200, "mov edx, eax"], [201, "mov rax, [rbp+var_48]"], [202, "mov [rax], edx"], [203, "mov eax, [rbp+var_18]"], [204, "mov edx, eax"], [205, "mov eax, 88888889h"], [206, "imul rax, rdx"], [207, "shr rax, 20h"], [208, "shr eax, 5"], [209, "mov [rbp+var_18], eax"], [210, "mov edx, [rbp+var_18]"], [211, "mov ecx, edx"], [212, "mov eax, 88888889h"], [213, "imul rax, rcx"], [214, "shr rax, 20h"], [215, "shr eax, 5"], [216, "imul ecx, eax, 3Ch "], [217, "mov eax, edx"], [218, "sub eax, ecx"], [219, "mov edx, eax"], [220, "mov rax, [rbp+var_48]"], [221, "mov [rax+4], edx"], [222, "mov eax, [rbp+var_18]"], [223, "mov edx, eax"], [224, "mov eax, 88888889h"], [225, "imul rax, rdx"], [226, "shr rax, 20h"], [227, "shr eax, 5"], [228, "mov [rbp+var_18], eax"], [229, "mov edx, [rbp+var_18]"], [230, "mov rax, [rbp+var_48]"], [231, "mov [rax+8], edx"], [232, "mov rax, [rbp+var_38]"], [233, "mov edx, [rax+8]"], [234, "mov rax, [rbp+var_48]"], [235, "mov [rax+20h], edx"], [236, "mov rax, [rbp+var_38]"], [237, "movzx eax, word ptr [rax+0Ch]"], [238, "movsx edx, ax"], [239, "mov rax, [rbp+var_48]"], [240, "mov [rax+24h], edx"], [241, "mov eax, 0"], [242, "leave"], [243, "retn"]], "data_dep": [[6, 4], [7, 3], [8, 7], [10, 9], [11, 10], [14, 3], [15, 14], [17, 16], [17, 15], [18, 17], [19, 6], [20, 19], [21, 3], [22, 21], [24, 22], [26, 18], [26, 24], [27, 26], [27, 18], [29, 27], [30, 28], [31, 30], [32, 31], [33, 27], [34, 33], [35, 32], [35, 34], [36, 35], [37, 26], [37, 18], [39, 37], [40, 38], [41, 40], [42, 41], [43, 37], [44, 43], [45, 42], [45, 44], [46, 45], [46, 44], [47, 37], [48, 47], [48, 46], [49, 48], [50, 36], [51, 50], [52, 51], [53, 52], [54, 53], [55, 54], [56, 55], [57, 56], [58, 57], [59, 58], [60, 59], [61, 60], [61, 57], [62, 61], [63, 60], [63, 62], [64, 63], [65, 64], [66, 65], [67, 66], [68, 67], [69, 65], [70, 68], [70, 69], [71, 70], [72, 71], [73, 68], [73, 72], [74, 56], [75, 74], [75, 73], [76, 75], [78, 77], [78, 76], [79, 78], [80, 79], [81, 80], [82, 71], [83, 82], [84, 52], [85, 84], [85, 83], [86, 81], [87, 86], [88, 87], [89, 88], [90, 85], [91, 89], [91, 90], [92, 91], [93, 92], [94, 93], [95, 94], [96, 95], [97, 96], [98, 97], [99, 98], [100, 92], [101, 100], [102, 101], [103, 81], [104, 103], [105, 104], [106, 97], [108, 81], [109, 108], [110, 109], [111, 110], [112, 81], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 117], [119, 118], [120, 119], [121, 120], [122, 119], [122, 121], [123, 119], [124, 122], [124, 123], [125, 124], [126, 112], [126, 125], [127, 126], [128, 127], [129, 128], [130, 81], [131, 130], [132, 131], [133, 132], [134, 133], [135, 134], [136, 135], [137, 136], [138, 137], [139, 136], [139, 138], [140, 136], [141, 140], [141, 139], [142, 141], [143, 142], [143, 130], [144, 143], [145, 144], [149, 146], [149, 148], [150, 92], [151, 150], [151, 149], [152, 151], [153, 152], [154, 92], [155, 97], [155, 106], [158, 157], [159, 154], [159, 158], [160, 5], [161, 159], [161, 160], [162, 97], [162, 106], [163, 159], [163, 161], [163, 162], [164, 5], [165, 163], [165, 164], [166, 105], [166, 81], [167, 5], [168, 166], [168, 167], [169, 36], [170, 169], [171, 170], [172, 171], [173, 172], [174, 169], [175, 174], [175, 173], [176, 175], [177, 176], [177, 173], [178, 177], [179, 178], [180, 179], [181, 178], [181, 180], [182, 169], [183, 181], [183, 182], [184, 183], [185, 5], [186, 184], [186, 185], [187, 153], [187, 102], [188, 187], [188, 184], [188, 186], [189, 5], [190, 188], [190, 189], [191, 49], [192, 191], [194, 192], [194, 193], [195, 194], [196, 195], [197, 192], [197, 196], [198, 191], [199, 198], [199, 197], [200, 199], [201, 5], [202, 200], [202, 201], [203, 49], [204, 203], [206, 205], [206, 204], [207, 206], [208, 207], [209, 208], [210, 209], [211, 210], [213, 212], [213, 211], [214, 213], [215, 214], [216, 211], [216, 215], [217, 210], [218, 217], [218, 216], [219, 218], [220, 5], [221, 219], [221, 220], [222, 209], [223, 222], [225, 224], [225, 223], [226, 225], [227, 226], [228, 227], [229, 228], [230, 5], [231, 230], [231, 229], [232, 3], [233, 232], [233, 231], [234, 5], [235, 234], [235, 233], [236, 3], [237, 161], [237, 236], [237, 235], [238, 237], [239, 5], [240, 239], [240, 238], [243, 241], [243, 12]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_41890A", "query": "\n\n\n__int64 __fastcall sub_41890A(__int64 a1, char a2, unsigned int *a3)\n{\nunsigned __int64 v4; // rdx\n__int16 v5; // ax\nunsigned __int16 v7; // [rsp+1Eh] [rbp-2Ah]\nunsigned int v8; // [rsp+24h] [rbp-24h]\nunsigned int v9; // [rsp+30h] [rbp-18h]\nunsigned int v10; // [rsp+30h] [rbp-18h]\nunsigned __int16 v11; // [rsp+3Ah] [rbp-Eh]\nunsigned __int16 v12; // [rsp+3Ch] [rbp-Ch]\nunsigned __int16 v13; // [rsp+3Eh] [rbp-Ah]\n__int64 v14; // [rsp+40h] [rbp-8h]\n\nif ( !sub_418825(a1) )\nreturn 0xFFFFFFFFLL;\nv14 = *(_QWORD *)a1 + 0xE77934880LL;\nif ( a2 )\nLODWORD(v14) = 60 * *(__int16 *)(a1 + 12) + v14;\nv9 = (int)v14 % 86400;\nv4 = (637207495 * (unsigned __int64)(unsigned int)(100 * ((int)v14 / 86400 + 306) - 25)) >> 32;\nv8 = ((unsigned int)v4 + ((unsigned int)(100 * ((int)v14 / 86400 + 306) - 25 - v4) >> 1)) >> 21;\nv13 = (100 * (v8 - (((unsigned int)v4 + ((unsigned int)(100 * ((int)v14 / 86400 + 306) - 25 - v4) >> 1)) >> 23))\n+ 100 * ((int)v14 / 86400 + 306)\n- 25)\n/ 0x8EAD;\nv7 = (int)v14 / 86400\n+ 306\n+ v8\n- (((unsigned int)v4 + ((unsigned int)(100 * ((int)v14 / 86400 + 306) - 25 - v4) >> 1)) >> 23)\n- ((1461 * v13) >> 2);\nv12 = (535 * v7 + 48950) >> 14;\nif ( v12 <= 0xCu )\n{\nv5 = (v13 & 3) == 0 && (v13 != 100 * (v13 / 0x64u) || !(v13 % 0x190u));\nv11 = v5 + v7 + 59;\n}\nelse\n{\nv11 = (int)v14 / 86400\n+ v8\n- (((unsigned int)v4 + ((unsigned int)(100 * ((int)v14 / 86400 + 306) - 25 - v4) >> 1)) >> 23)\n- ((1461 * v13++) >> 2);\nv12 -= 12;\n}\na3[3] = v7 - (unsigned __int16)word_47A690[v12];\na3[4] = v12 - 1;\na3[5] = v13;\na3[6] = (int)v14 / 86400 % 7u;\na3[7] = v11 - 1;\n*a3 = v9 % 0x3C;\nv10 = v9 / 0x3C;\na3[1] = v10 % 0x3C;\na3[2] = v10 / 0x3C;\na3[8] = *(_DWORD *)(a1 + 8);\na3[9] = *(__int16 *)(a1 + 12);\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v7,v8,v10,v11,v12,v13,v14,sub_41890A,sub_418825,]", "hints": "[]", "response": "{'a3': 'tm', 'a1': 'tex', 'a2': 'emulategicv2', 'v7': 'C', 'v8': 'A', 'v10': 'sid', 'v11': 'd', 'v12': 'm', 'v13': 'y', 'v14': 'sec', 'sub_41890A': 'baTime2tmEx', 'sub_418825': 'writeclkdivn'}"} | [
[
0.7391610145568848,
0.7286776900291443,
0.6849981546401978,
0.6780315637588501,
0.6708479523658752,
0.6669819951057434,
0.6666951775550842,
0.6659448146820068,
0.6623803377151489,
0.6616862416267395,
0.6610651612281799,
0.6571496725082397,
0.6511150598526001,
0.6480588316917419,
0.6460976004600525,
0.6446632146835327,
0.6441277265548706,
0.643043041229248,
0.6426361799240112,
0.6392760872840881
],
[
134141,
138181,
153496,
97314,
170454,
204437,
95110,
158809,
134951,
30940,
154577,
15673,
44705,
153104,
14838,
121059,
50534,
101081,
106686,
8239
]
] |
|
attempts_exceeded | 1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88 | tj | mon | NA | int
attempts_exceeded(monitor_t *monitor, int64_t ms) {
monitor->attempts++;
monitor->clock -= ms;
// reset
if (monitor->clock <= 0) {
monitor->clock = 60000;
monitor->attempts = 0;
return 0;
}
// all good
if (monitor->attempts < monitor->max_attempts) return 0;
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401D29", "function_addr": 4201769, "binary_name": "1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov rax, [rbp+var_8]"], [5, "mov eax, [rax+44h]"], [6, "lea edx, [rax+1]"], [7, "mov rax, [rbp+var_8]"], [8, "mov [rax+44h], edx"], [9, "mov rax, [rbp+var_8]"], [10, "mov rax, [rax+30h]"], [11, "sub rax, [rbp+var_10]"], [12, "mov rdx, rax"], [13, "mov rax, [rbp+var_8]"], [14, "mov [rax+30h], rdx"], [15, "mov rax, [rbp+var_8]"], [16, "mov rax, [rax+30h]"], [17, "test rax, rax"], [18, "jg short loc_401D88"], [19, "mov rax, [rbp+var_8]"], [20, "mov qword ptr [rax+30h], 0EA60h"], [21, "mov rax, [rbp+var_8]"], [22, "mov dword ptr [rax+44h], 0"], [23, "mov eax, 0"], [24, "jmp short loc_401DA6"], [25, "mov rax, [rbp+var_8]"], [26, "mov edx, [rax+44h]"], [27, "mov rax, [rbp+var_8]"], [28, "mov eax, [rax+40h]"], [29, "cmp edx, eax"], [30, "jge short loc_401DA1"], [31, "mov eax, 0"], [32, "jmp short loc_401DA6"], [33, "mov eax, 1"], [34, "pop rbp"], [35, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 5], [7, 2], [8, 6], [8, 7], [9, 2], [10, 9], [10, 8], [11, 10], [11, 3], [12, 11], [13, 2], [14, 13], [14, 12], [15, 2], [16, 15], [16, 14], [17, 16], [18, 17], [19, 2], [20, 19], [21, 2], [22, 21], [25, 2], [26, 8], [26, 14], [26, 25], [27, 2], [28, 27], [28, 8], [28, 14], [29, 26], [29, 28], [30, 29], [34, 0], [35, 33], [35, 23], [35, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88_1572837c62ebc501b7b0338fb8099224b479a1d9ee130af981c5996af4ee7b88.jsonl.gz", "strip_func_name": "sub_401D29", "query": "\n\n\n_BOOL8 __fastcall sub_401D29(__int64 a1, __int64 a2)\n{\n++*(_DWORD *)(a1 + 68);\n*(_QWORD *)(a1 + 48) -= a2;\nif ( *(__int64 *)(a1 + 48) > 0 )\nreturn *(_DWORD *)(a1 + 68) >= *(_DWORD *)(a1 + 64);\n*(_QWORD *)(a1 + 48) = 60000LL;\n*(_DWORD *)(a1 + 68) = 0;\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,sub_401D29,]", "hints": "[]", "response": "{'a1': 'monitor', 'a2': 'ms', 'sub_401D29': 'attempts_exceeded'}"} | [
[
0.8406407833099365,
0.8026299476623535,
0.7605137825012207,
0.7573485374450684,
0.750676155090332,
0.7396184206008911,
0.7388688325881958,
0.7372763752937317,
0.7350273132324219,
0.7319529056549072,
0.7263444662094116,
0.7215834259986877,
0.7172759771347046,
0.7167757749557495,
0.7166967391967773,
0.7160384654998779,
0.7157611846923828,
0.7152917385101318,
0.715000569820404,
0.7149207592010498
],
[
212410,
7853,
53483,
258322,
93816,
224146,
109290,
153443,
185689,
89761,
26639,
185981,
14291,
94562,
44353,
115554,
205749,
241513,
248822,
21228
]
] |
|
set_lns | 2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5 | xelerance | xl2tpd | NA | int set_lns (char *word, char *value, int context, void *item)
{
#if 0
struct hostent *hp;
#endif
struct lac *l;
struct host *ipr, *pos;
char *d;
switch (context & ~CONTEXT_DEFAULT)
{
case CONTEXT_LAC:
#ifdef DEBUG_FILE
l2tp_log (LOG_DEBUG, "set_lns: setting LNS to '%s'\n", value);
#endif
l = (struct lac *) item;
d = strchr (value, ':');
if (d)
{
d[0] = 0;
d++;
}
#if 0
// why would you want to lookup hostnames at this time?
hp = gethostbyname (value);
if (!hp)
{
snprintf (filerr, sizeof (filerr), "no such host '%s'\n", value);
return -1;
}
#endif
ipr = malloc (sizeof (struct host));
ipr->next = NULL;
pos = l->lns;
if (!pos)
{
l->lns = ipr;
}
else
{
while (pos->next)
pos = pos->next;
pos->next = ipr;
}
strncpy (ipr->hostname, value, sizeof (ipr->hostname));
if (d)
ipr->port = atoi (d);
else
ipr->port = UDP_LISTEN_PORT;
break;
default:
snprintf (filerr, sizeof (filerr), "'%s' not valid in this context\n",
word);
return -1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_416FEF", "function_addr": 4288495, "binary_name": "2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+s], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov [rbp+var_40], rcx"], [7, "mov eax, [rbp+var_34]"], [8, "and ah, 0FEh"], [9, "cmp eax, 3"], [10, "jnz loc_4170E6"], [11, "mov rax, [rbp+var_40]"], [12, "mov [rbp+var_18], rax"], [13, "mov rax, [rbp+s]"], [14, "mov esi, 3Ah "], [15, "mov rdi, rax"], [16, "call _strchr"], [17, "mov [rbp+nptr], rax"], [18, "cmp [rbp+nptr], 0"], [19, "jz short loc_417045"], [20, "mov rax, [rbp+nptr]"], [21, "mov byte ptr [rax], 0"], [22, "add [rbp+nptr], 1"], [23, "mov edi, 70h "], [24, "call _malloc"], [25, "mov [rbp+dest], rax"], [26, "mov rax, [rbp+dest]"], [27, "mov qword ptr [rax+68h], 0"], [28, "mov rax, [rbp+var_18]"], [29, "mov rax, [rax+8]"], [30, "mov [rbp+var_8], rax"], [31, "cmp [rbp+var_8], 0"], [32, "jnz short loc_41708C"], [33, "mov rax, [rbp+var_18]"], [34, "mov rdx, [rbp+dest]"], [35, "mov [rax+8], rdx"], [36, "jmp short loc_4170A5"], [37, "mov rax, [rbp+var_8]"], [38, "mov rax, [rax+68h]"], [39, "mov [rbp+var_8], rax"], [40, "mov rax, [rbp+var_8]"], [41, "mov rax, [rax+68h]"], [42, "test rax, rax"], [43, "jnz short loc_417080"], [44, "mov rax, [rbp+var_8]"], [45, "mov rdx, [rbp+dest]"], [46, "mov [rax+68h], rdx"], [47, "mov rax, [rbp+dest]"], [48, "mov rcx, [rbp+s]"], [49, "mov edx, 64h "], [50, "mov rsi, rcx"], [51, "mov rdi, rax"], [52, "call _strncpy"], [53, "cmp [rbp+nptr], 0"], [54, "jz short loc_4170D9"], [55, "mov rax, [rbp+nptr]"], [56, "mov rdi, rax"], [57, "call _atoi"], [58, "mov rdx, [rbp+dest]"], [59, "mov [rdx+64h], eax"], [60, "jmp short loc_41710D"], [61, "mov rax, [rbp+dest]"], [62, "mov dword ptr [rax+64h], 6A5h"], [63, "jmp short loc_41710D"], [64, "mov rax, [rbp+var_28]"], [65, "mov rcx, rax"], [66, "mov edx, offset aSNotValidInThi"], [67, "mov esi, 64h "], [68, "mov edi, offset byte_426340"], [69, "mov eax, 0"], [70, "call _snprintf"], [71, "mov eax, 0FFFFFFFFh"], [72, "jmp short locret_417112"], [73, "mov eax, 0"], [74, "leave"], [75, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 8], [10, 9], [11, 6], [12, 11], [13, 4], [15, 13], [17, 16], [18, 17], [19, 18], [20, 17], [21, 20], [22, 17], [25, 24], [26, 25], [27, 26], [28, 12], [29, 28], [29, 27], [30, 29], [31, 30], [32, 31], [33, 12], [34, 25], [35, 33], [35, 34], [37, 30], [37, 39], [38, 37], [38, 21], [38, 27], [39, 38], [40, 30], [40, 39], [41, 40], [41, 21], [41, 27], [42, 41], [43, 42], [44, 39], [44, 30], [45, 25], [46, 45], [46, 44], [47, 25], [48, 4], [50, 48], [51, 47], [53, 17], [53, 22], [54, 53], [55, 17], [55, 22], [56, 55], [58, 25], [59, 58], [59, 57], [61, 25], [62, 61], [64, 3], [65, 64], [75, 71], [75, 73]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5_2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.jsonl.gz", "strip_func_name": "sub_416FEF", "query": "\n\n\n__int64 __fastcall sub_416FEF(const char *a1, const char *a2, int a3, __int64 a4)\n{\nint v4; // eax\n__int64 result; // rax\nchar *dest; // [rsp+20h] [rbp-20h]\nconst char *nptr; // [rsp+30h] [rbp-10h]\n__int64 v9; // [rsp+38h] [rbp-8h]\n\nv4 = a3;\nBYTE1(v4) = BYTE1(a3) & 0xFE;\nif ( v4 == 3 )\n{\nnptr = strchr(a2, 58);\nif ( nptr )\n*nptr++ = 0;\ndest = (char *)malloc(0x70uLL);\n*((_QWORD *)dest + 13) = 0LL;\nv9 = *(_QWORD *)(a4 + 8);\nif ( v9 )\n{\nwhile ( *(_QWORD *)(v9 + 104) )\nv9 = *(_QWORD *)(v9 + 104);\n*(_QWORD *)(v9 + 104) = dest;\n}\nelse\n{\n*(_QWORD *)(a4 + 8) = dest;\n}\nstrncpy(dest, a2, 0x64uLL);\nif ( nptr )\n*((_DWORD *)dest + 25) = atoi(nptr);\nelse\n*((_DWORD *)dest + 25) = 1701;\nresult = 0LL;\n}\nelse\n{\nsnprintf(byte_426340, 0x64uLL, \"'%s' not valid in this context\\n\", a1);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,dest,nptr,v9,sub_416FEF,]", "hints": "[]", "response": "{'a3': 'context', 'a4': 'item', 'a1': 'word', 'a2': 'value', 'dest': 'ipr', 'nptr': 'd', 'v9': 'pos', 'sub_416FEF': 'set_lns'}"} | [
[
0.7244203090667725,
0.7231982946395874,
0.7009409070014954,
0.699653148651123,
0.6817777156829834,
0.6794275641441345,
0.6740525960922241,
0.6649277806282043,
0.6588077545166016,
0.6576846241950989,
0.6549044251441956,
0.6538353562355042,
0.6525834798812866,
0.6505753397941589,
0.6481319665908813,
0.6419753432273865,
0.6415627002716064,
0.6397732496261597,
0.6395379304885864,
0.6385756731033325
],
[
23080,
238858,
241940,
122025,
75252,
79707,
208523,
185810,
43760,
58462,
225813,
111650,
116353,
55644,
64356,
145518,
236179,
205772,
127933,
228395
]
] |
|
float_initialize | 516ce2a9db5c061aae5f401c446903d6244864e373920aa79c419472cdcea5c4 | foss-for-synopsys-dwc-arc-processors | lmbench | NA | void
float_initialize(iter_t iterations, void* cookie)
{
struct _state *pState = (struct _state*)cookie;
register int i;
register float* x;
if (iterations) return;
x = (float*)malloc(pState->M * sizeof(float));
pState->data = (double*)x;
if (!pState->data) {
perror("malloc");
exit(1);
}
for (i = 0; i < pState->M; ++i) {
x[i] = 3.14159265;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013C2", "function_addr": 4199362, "binary_name": "516ce2a9db5c061aae5f401c446903d6244864e373920aa79c419472cdcea5c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 20h"], [5, "mov [rbp+var_28], rdi"], [6, "mov [rbp+var_30], rsi"], [7, "mov rax, [rbp+var_30]"], [8, "mov [rbp+var_18], rax"], [9, "cmp [rbp+var_28], 0"], [10, "jnz short loc_401452"], [11, "mov rax, [rbp+var_18]"], [12, "mov eax, [rax+4]"], [13, "cdqe"], [14, "shl rax, 2"], [15, "mov rdi, rax"], [16, "call _malloc"], [17, "mov r12, rax"], [18, "mov rax, [rbp+var_18]"], [19, "mov [rax+10h], r12"], [20, "mov rax, [rbp+var_18]"], [21, "mov rax, [rax+10h]"], [22, "test rax, rax"], [23, "jnz short loc_401425"], [24, "mov edi, offset s"], [25, "call _perror"], [26, "mov edi, 1"], [27, "call _exit"], [28, "mov ebx, 0"], [29, "jmp short loc_401445"], [30, "movsxd rax, ebx"], [31, "shl rax, 2"], [32, "add rax, r12"], [33, "movss xmm0, cs:dword_40B124"], [34, "movss dword ptr [rax], xmm0"], [35, "add ebx, 1"], [36, "mov rax, [rbp+var_18]"], [37, "mov eax, [rax+4]"], [38, "cmp ebx, eax"], [39, "jl short loc_40142C"], [40, "jmp short loc_401453"], [41, "nop"], [42, "add rsp, 20h"], [43, "pop rbx"], [44, "pop r12"], [45, "pop rbp"], [46, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 5], [10, 9], [11, 8], [12, 11], [14, 12], [15, 14], [17, 16], [18, 8], [19, 18], [19, 17], [20, 8], [21, 19], [21, 20], [22, 21], [23, 22], [30, 35], [30, 28], [31, 30], [32, 31], [32, 17], [34, 33], [34, 32], [35, 35], [35, 28], [36, 8], [37, 36], [37, 19], [37, 34], [38, 35], [38, 28], [38, 37], [39, 38], [42, 4], [43, 3], [44, 2], [45, 0], [46, 7], [46, 37]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/516ce2a9db5c061aae5f401c446903d6244864e373920aa79c419472cdcea5c4_516ce2a9db5c061aae5f401c446903d6244864e373920aa79c419472cdcea5c4.jsonl.gz", "strip_func_name": "sub_4013C2", "query": "\n\n\n__int64 __fastcall sub_4013C2(__int64 a1, __int64 a2)\n{\n__int64 result; // rax\n_DWORD *v3; // r12\nint i; // ebx\n\nresult = a2;\nif ( !a1 )\n{\nv3 = malloc(4LL * *(int *)(a2 + 4));\n*(_QWORD *)(a2 + 16) = v3;\nif ( !*(_QWORD *)(a2 + 16) )\n{\nperror(\"malloc\");\nexit(1);\n}\nfor ( i = 0; ; ++i )\n{\nresult = *(unsigned int *)(a2 + 4);\nif ( i >= (int)result )\nbreak;\nv3[i] = 1078530011;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_4013C2,]", "hints": "[]", "response": "{'a1': 'iterations', 'a2': 'cookie', 'sub_4013C2': 'float_initialize'}"} | [
[
0.6512076258659363,
0.6409838199615479,
0.6394225358963013,
0.6299680471420288,
0.6276262402534485,
0.6275005340576172,
0.6253071427345276,
0.6244082450866699,
0.624047040939331,
0.6208480000495911,
0.6094099283218384,
0.6068419218063354,
0.6050885319709778,
0.6026625037193298,
0.6022325754165649,
0.6002495884895325,
0.5981162190437317,
0.5971506834030151,
0.5939391851425171,
0.5927132368087769
],
[
117139,
193104,
130027,
254327,
19134,
189392,
181492,
136443,
137158,
38951,
114961,
55802,
18383,
30249,
199388,
261705,
187949,
56141,
198736,
175724
]
] |
|
removerecursive | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | SharkSslCert removerecursive(SharkSslCertEnum *o)
{
#if SHARKSSL_ENABLE_CERT_CHAIN
if (o->cert != NULL)
{
if (o->priv_notFirstCertFlag)
{
if (o->priv_chainLen)
{
o->priv_chainLen--;
o->cert += o->certLen;
}
else
{
o->cert = NULL;
}
}
else
{
U16 setpropinplace, chargeerror;
o->priv_notFirstCertFlag++;
o->cert += o->certLen;
while (0xFF == *o->cert)
{
o->cert++;
}
setpropinplace = (U16)(*(o->cert++)) << 8;
setpropinplace += *(o->cert++);
o->priv_chainLen = monadiccheck(setpropinplace);
if (o->priv_chainLen)
{
o->priv_chainLen--;
chargeerror = (U16)(*(o->cert++)) << 8;
chargeerror += *(o->cert++);
o->cert += mousethresh(setpropinplace);
#if SHARKSSL_ENABLE_RSA
if (machinekexec(setpropinplace))
{
baAssert(chargeerror == supportedvector(chargeerror));
baAssert((chargeerror <= 0x3FFF) && (0 == (chargeerror & 0x01)));
o->cert += (U16)(chargeerror << 2);
o->cert -= (U16)(chargeerror >> 1);
}
#if SHARKSSL_USE_ECC
else
#endif
#endif
#if SHARKSSL_USE_ECC
if (machinereboot(setpropinplace))
{
chargeerror = attachdevice(chargeerror);
baAssert((chargeerror < 0x00FF) && (0 == (chargeerror & 0x01)));
o->cert += (U16)(chargeerror << 1);
}
#endif
else
{
o->cert = NULL;
}
}
else
{
o->cert = NULL;
}
}
}
#else
o->cert = NULL;
#endif
o->certLen = SharkSslCert_len(o->cert);
return o->cert;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_457212", "function_addr": 4551186, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, [rbp+var_18]"], [5, "mov rax, [rax]"], [6, "test rax, rax"], [7, "jz loc_45748A"], [8, "mov rax, [rbp+var_18]"], [9, "movzx eax, byte ptr [rax+0Ah]"], [10, "test al, al"], [11, "jz short loc_457289"], [12, "mov rax, [rbp+var_18]"], [13, "movzx eax, byte ptr [rax+0Bh]"], [14, "test al, al"], [15, "jz short loc_457279"], [16, "mov rax, [rbp+var_18]"], [17, "movzx eax, byte ptr [rax+0Bh]"], [18, "lea edx, [rax-1]"], [19, "mov rax, [rbp+var_18]"], [20, "mov [rax+0Bh], dl"], [21, "mov rax, [rbp+var_18]"], [22, "mov rdx, [rax]"], [23, "mov rax, [rbp+var_18]"], [24, "movzx eax, word ptr [rax+8]"], [25, "movzx eax, ax"], [26, "add rdx, rax"], [27, "mov rax, [rbp+var_18]"], [28, "mov [rax], rdx"], [29, "jmp loc_45748A"], [30, "mov rax, [rbp+var_18]"], [31, "mov qword ptr [rax], 0"], [32, "jmp loc_45748A"], [33, "mov rax, [rbp+var_18]"], [34, "movzx eax, byte ptr [rax+0Ah]"], [35, "lea edx, [rax+1]"], [36, "mov rax, [rbp+var_18]"], [37, "mov [rax+0Ah], dl"], [38, "mov rax, [rbp+var_18]"], [39, "mov rdx, [rax]"], [40, "mov rax, [rbp+var_18]"], [41, "movzx eax, word ptr [rax+8]"], [42, "movzx eax, ax"], [43, "add rdx, rax"], [44, "mov rax, [rbp+var_18]"], [45, "mov [rax], rdx"], [46, "jmp short loc_4572CB"], [47, "mov rax, [rbp+var_18]"], [48, "mov rax, [rax]"], [49, "lea rdx, [rax+1]"], [50, "mov rax, [rbp+var_18]"], [51, "mov [rax], rdx"], [52, "mov rax, [rbp+var_18]"], [53, "mov rax, [rax]"], [54, "movzx eax, byte ptr [rax]"], [55, "cmp al, 0FFh"], [56, "jz short loc_4572B9"], [57, "mov rax, [rbp+var_18]"], [58, "mov rax, [rax]"], [59, "lea rcx, [rax+1]"], [60, "mov rdx, [rbp+var_18]"], [61, "mov [rdx], rcx"], [62, "movzx eax, byte ptr [rax]"], [63, "movzx eax, al"], [64, "shl eax, 8"], [65, "mov [rbp+var_2], ax"], [66, "mov rax, [rbp+var_18]"], [67, "mov rax, [rax]"], [68, "lea rcx, [rax+1]"], [69, "mov rdx, [rbp+var_18]"], [70, "mov [rdx], rcx"], [71, "movzx eax, byte ptr [rax]"], [72, "movzx eax, al"], [73, "add [rbp+var_2], ax"], [74, "movzx eax, [rbp+var_2]"], [75, "shr ax, 0Ch"], [76, "mov edx, eax"], [77, "mov rax, [rbp+var_18]"], [78, "mov [rax+0Bh], dl"], [79, "mov rax, [rbp+var_18]"], [80, "movzx eax, byte ptr [rax+0Bh]"], [81, "test al, al"], [82, "jz loc_45747F"], [83, "mov rax, [rbp+var_18]"], [84, "movzx eax, byte ptr [rax+0Bh]"], [85, "lea edx, [rax-1]"], [86, "mov rax, [rbp+var_18]"], [87, "mov [rax+0Bh], dl"], [88, "mov rax, [rbp+var_18]"], [89, "mov rax, [rax]"], [90, "lea rcx, [rax+1]"], [91, "mov rdx, [rbp+var_18]"], [92, "mov [rdx], rcx"], [93, "movzx eax, byte ptr [rax]"], [94, "movzx eax, al"], [95, "shl eax, 8"], [96, "mov [rbp+var_4], ax"], [97, "mov rax, [rbp+var_18]"], [98, "mov rax, [rax]"], [99, "lea rcx, [rax+1]"], [100, "mov rdx, [rbp+var_18]"], [101, "mov [rdx], rcx"], [102, "movzx eax, byte ptr [rax]"], [103, "movzx eax, al"], [104, "add [rbp+var_4], ax"], [105, "mov rax, [rbp+var_18]"], [106, "mov rdx, [rax]"], [107, "movzx eax, [rbp+var_2]"], [108, "movzx eax, al"], [109, "add rdx, rax"], [110, "mov rax, [rbp+var_18]"], [111, "mov [rax], rdx"], [112, "movzx eax, [rbp+var_2]"], [113, "sar eax, 8"], [114, "movzx eax, ax"], [115, "and eax, 6"], [116, "test eax, eax"], [117, "jnz short loc_457412"], [118, "cmp [rbp+var_4], 3FFFh"], [119, "ja short loc_4573BE"], [120, "movzx eax, [rbp+var_4]"], [121, "and eax, 1"], [122, "test eax, eax"], [123, "jz short loc_4573D7"], [124, "mov ecx, 9D28h"], [125, "mov edx, offset aSrcBwsC"], [126, "mov esi, 0"], [127, "mov edi, 2"], [128, "call sub_47031B"], [129, "mov rax, [rbp+var_18]"], [130, "mov rdx, [rax]"], [131, "movzx eax, [rbp+var_4]"], [132, "shl eax, 2"], [133, "movzx eax, ax"], [134, "add rdx, rax"], [135, "mov rax, [rbp+var_18]"], [136, "mov [rax], rdx"], [137, "mov rax, [rbp+var_18]"], [138, "mov rdx, [rax]"], [139, "movzx eax, [rbp+var_4]"], [140, "shr ax, 1"], [141, "movzx eax, ax"], [142, "neg rax"], [143, "add rdx, rax"], [144, "mov rax, [rbp+var_18]"], [145, "mov [rax], rdx"], [146, "jmp short loc_45748A"], [147, "movzx eax, [rbp+var_2]"], [148, "sar eax, 8"], [149, "movzx eax, ax"], [150, "and eax, 6"], [151, "cmp eax, 2"], [152, "jnz short loc_457472"], [153, "and [rbp+var_4], 0FFh"], [154, "cmp [rbp+var_4], 0FEh"], [155, "ja short loc_45743D"], [156, "movzx eax, [rbp+var_4]"], [157, "and eax, 1"], [158, "test eax, eax"], [159, "jz short loc_457456"], [160, "mov ecx, 9D34h"], [161, "mov edx, offset aSrcBwsC"], [162, "mov esi, 0"], [163, "mov edi, 2"], [164, "call sub_47031B"], [165, "mov rax, [rbp+var_18]"], [166, "mov rdx, [rax]"], [167, "movzx eax, [rbp+var_4]"], [168, "add eax, eax"], [169, "movzx eax, ax"], [170, "add rdx, rax"], [171, "mov rax, [rbp+var_18]"], [172, "mov [rax], rdx"], [173, "jmp short loc_45748A"], [174, "mov rax, [rbp+var_18]"], [175, "mov qword ptr [rax], 0"], [176, "jmp short loc_45748A"], [177, "mov rax, [rbp+var_18]"], [178, "mov qword ptr [rax], 0"], [179, "mov rax, [rbp+var_18]"], [180, "mov rax, [rax]"], [181, "mov rdi, rax"], [182, "call sub_4587DD"], [183, "mov rdx, [rbp+var_18]"], [184, "mov [rdx+8], ax"], [185, "mov rax, [rbp+var_18]"], [186, "mov rax, [rax]"], [187, "leave"], [188, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [11, 10], [12, 3], [13, 12], [14, 13], [15, 14], [16, 3], [17, 16], [18, 17], [19, 3], [20, 19], [20, 18], [21, 3], [22, 21], [22, 20], [23, 3], [24, 20], [24, 23], [25, 24], [26, 25], [26, 22], [27, 3], [28, 27], [28, 26], [30, 3], [31, 30], [33, 3], [34, 33], [35, 34], [36, 3], [37, 35], [37, 36], [38, 3], [39, 38], [39, 37], [40, 3], [41, 37], [41, 40], [42, 41], [43, 39], [43, 42], [44, 3], [45, 43], [45, 44], [47, 3], [48, 45], [48, 47], [48, 51], [48, 37], [49, 51], [49, 45], [49, 49], [49, 48], [49, 43], [49, 37], [50, 3], [51, 50], [51, 49], [52, 3], [53, 52], [53, 51], [53, 37], [53, 45], [54, 51], [54, 45], [54, 53], [54, 37], [55, 54], [56, 55], [57, 3], [58, 57], [58, 61], [58, 70], [58, 51], [58, 37], [58, 78], [58, 45], [59, 45], [59, 58], [59, 61], [59, 70], [59, 37], [59, 51], [59, 78], [60, 3], [61, 60], [61, 59], [62, 45], [62, 58], [62, 61], [62, 51], [63, 62], [64, 63], [65, 64], [66, 3], [67, 45], [67, 66], [67, 61], [67, 51], [68, 59], [68, 67], [68, 61], [69, 3], [70, 68], [70, 69], [71, 51], [71, 45], [71, 67], [71, 70], [72, 71], [73, 72], [73, 65], [74, 73], [75, 74], [76, 75], [77, 3], [78, 77], [78, 76], [79, 3], [80, 79], [80, 78], [81, 80], [82, 81], [83, 3], [84, 111], [84, 83], [84, 92], [84, 101], [84, 78], [84, 87], [84, 45], [84, 61], [84, 70], [84, 51], [84, 37], [85, 84], [85, 61], [85, 70], [85, 51], [85, 37], [85, 111], [85, 92], [85, 101], [85, 78], [85, 87], [85, 45], [85, 76], [86, 3], [87, 86], [87, 85], [88, 3], [89, 45], [89, 51], [89, 88], [89, 87], [90, 87], [90, 68], [90, 89], [91, 3], [92, 91], [92, 90], [93, 51], [93, 92], [93, 45], [93, 89], [94, 93], [95, 94], [96, 95], [97, 3], [98, 97], [98, 92], [98, 45], [98, 51], [99, 90], [99, 98], [99, 92], [100, 3], [101, 100], [101, 99], [102, 98], [102, 51], [102, 101], [102, 45], [103, 102], [104, 96], [104, 103], [105, 3], [106, 101], [106, 105], [106, 45], [106, 51], [107, 73], [108, 107], [109, 106], [109, 108], [110, 3], [111, 110], [111, 109], [112, 73], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 104], [119, 118], [120, 104], [121, 120], [122, 121], [123, 122], [129, 3], [130, 92], [130, 101], [130, 78], [130, 87], [130, 45], [130, 136], [130, 61], [130, 70], [130, 51], [130, 145], [130, 37], [130, 111], [130, 129], [131, 104], [132, 131], [133, 132], [134, 130], [134, 133], [135, 3], [136, 135], [136, 134], [137, 3], [138, 137], [138, 136], [139, 104], [140, 139], [141, 140], [142, 141], [143, 138], [143, 142], [144, 3], [145, 144], [145, 143], [147, 73], [148, 147], [149, 148], [150, 149], [151, 150], [152, 151], [153, 104], [154, 153], [155, 154], [156, 153], [157, 156], [158, 157], [159, 158], [165, 3], [166, 37], [166, 111], [166, 92], [166, 101], [166, 78], [166, 87], [166, 45], [166, 165], [166, 61], [166, 70], [166, 51], [166, 172], [167, 153], [168, 167], [169, 168], [170, 169], [170, 166], [171, 3], [172, 171], [172, 170], [174, 3], [175, 174], [177, 3], [178, 177], [179, 3], [180, 61], [180, 70], [180, 51], [180, 172], [180, 28], [180, 37], [180, 111], [180, 92], [180, 101], [180, 78], [180, 87], [180, 45], [180, 175], [180, 184], [180, 31], [180, 179], [180, 178], [180, 20], [180, 136], [180, 145], [181, 180], [183, 3], [184, 183], [184, 182], [185, 3], [186, 145], [186, 28], [186, 172], [186, 185], [186, 175], [186, 31], [186, 184], [186, 178], [188, 186]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_457212", "query": "\n\n\n__int64 __fastcall sub_457212(__int64 a1)\n{\nunsigned __int8 *v1; // rax\nunsigned __int8 *v2; // rax\nunsigned __int8 *v3; // rax\nunsigned __int8 *v4; // rax\n__int16 v6; // [rsp+1Ch] [rbp-4h]\nunsigned __int16 v7; // [rsp+1Ch] [rbp-4h]\n__int16 v8; // [rsp+1Eh] [rbp-2h]\nunsigned __int16 v9; // [rsp+1Eh] [rbp-2h]\n\nif ( *(_QWORD *)a1 )\n{\nif ( *(_BYTE *)(a1 + 10) )\n{\nif ( *(_BYTE *)(a1 + 11) )\n{\n--*(_BYTE *)(a1 + 11);\n*(_QWORD *)a1 += *(unsigned __int16 *)(a1 + 8);\n}\nelse\n{\n*(_QWORD *)a1 = 0LL;\n}\n}\nelse\n{\n++*(_BYTE *)(a1 + 10);\nfor ( *(_QWORD *)a1 += *(unsigned __int16 *)(a1 + 8); **(_BYTE **)a1 == 0xFF; ++*(_QWORD *)a1 )\n;\nv1 = (unsigned __int8 *)(*(_QWORD *)a1)++;\nv8 = *v1 << 8;\nv2 = (unsigned __int8 *)(*(_QWORD *)a1)++;\nv9 = *v2 + v8;\n*(_BYTE *)(a1 + 11) = v9 >> 12;\nif ( *(_BYTE *)(a1 + 11) )\n{\n--*(_BYTE *)(a1 + 11);\nv3 = (unsigned __int8 *)(*(_QWORD *)a1)++;\nv6 = *v3 << 8;\nv4 = (unsigned __int8 *)(*(_QWORD *)a1)++;\nv7 = *v4 + v6;\n*(_QWORD *)a1 += (unsigned __int8)v9;\nif ( (((int)v9 >> 8) & 6) != 0 )\n{\nif ( (((int)v9 >> 8) & 6) == 2 )\n{\nif ( (unsigned __int8)v7 == 255 || (v7 & 1) != 0 )\nsub_47031B(2LL, 0LL, \"../../src/BWS.c\", 40244LL);\n*(_QWORD *)a1 += (unsigned __int16)(2 * (unsigned __int8)v7);\n}\nelse\n{\n*(_QWORD *)a1 = 0LL;\n}\n}\nelse\n{\nif ( v7 > 0x3FFFu || (v7 & 1) != 0 )\nsub_47031B(2LL, 0LL, \"../../src/BWS.c\", 40232LL);\n*(_QWORD *)a1 += (unsigned __int16)(4 * v7);\n*(_QWORD *)a1 -= v7 >> 1;\n}\n}\nelse\n{\n*(_QWORD *)a1 = 0LL;\n}\n}\n}\n*(_WORD *)(a1 + 8) = sub_4587DD(*(_QWORD *)a1);\nreturn *(_QWORD *)a1;\n}\n\n\n\nQ:[a1,v6,v8,sub_457212,sub_47031B,sub_4587DD,]", "hints": "[]", "response": "{'a1': 'o', 'v6': 'chargeerror', 'v8': 'setpropinplace', 'sub_457212': 'removerecursive', 'sub_47031B': 'baFatalEf', 'sub_4587DD': 'SharkSslCert_len'}"} | [
[
0.7836887836456299,
0.7797528505325317,
0.7477660179138184,
0.7469822764396667,
0.7432827949523926,
0.7409965395927429,
0.73392254114151,
0.7325286865234375,
0.7221202254295349,
0.7219815254211426,
0.7199168801307678,
0.7153312563896179,
0.7035937309265137,
0.7020308971405029,
0.7018078565597534,
0.6968477964401245,
0.6946889758110046,
0.6924046277999878,
0.6913942098617554,
0.6912713050842285
],
[
15125,
198065,
112697,
53081,
204457,
147905,
130999,
77844,
102017,
2114,
258004,
250897,
108096,
48112,
159159,
164367,
76571,
75181,
4841,
186258
]
] |
|
adj_dirty | f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b | 0x09 | hfsfuse | NA | static inline void
adj_dirty(ublio_filehandle_t ufh, struct ublio_cache *ubc, uint8_t state)
{
if (state && ! ubc->uc_dirty)
LIST_INSERT_HEAD(&ufh->uf_dirty_head, ubc, uc_dirty_link);
if (! state && ubc->uc_dirty)
LIST_REMOVE(ubc, uc_dirty_link);
ubc->uc_dirty = state;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40C64E", "function_addr": 4245070, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov eax, edx"], [5, "mov [rbp+var_14], al"], [6, "cmp [rbp+var_14], 0"], [7, "jz short loc_40C6CD"], [8, "mov rax, [rbp+var_10]"], [9, "movzx eax, byte ptr [rax+70h]"], [10, "and eax, 1"], [11, "test al, al"], [12, "jnz short loc_40C6CD"], [13, "mov rax, [rbp+var_8]"], [14, "mov rdx, [rax+80h]"], [15, "mov rax, [rbp+var_10]"], [16, "mov [rax+60h], rdx"], [17, "mov rax, [rbp+var_10]"], [18, "mov rax, [rax+60h]"], [19, "test rax, rax"], [20, "jz short loc_40C6AB"], [21, "mov rax, [rbp+var_8]"], [22, "mov rax, [rax+80h]"], [23, "mov rdx, [rbp+var_10]"], [24, "add rdx, 60h "], [25, "mov [rax+68h], rdx"], [26, "mov rax, [rbp+var_8]"], [27, "mov rdx, [rbp+var_10]"], [28, "mov [rax+80h], rdx"], [29, "mov rax, [rbp+var_8]"], [30, "lea rdx, [rax+80h]"], [31, "mov rax, [rbp+var_10]"], [32, "mov [rax+68h], rdx"], [33, "cmp [rbp+var_14], 0"], [34, "jnz short loc_40C716"], [35, "mov rax, [rbp+var_10]"], [36, "movzx eax, byte ptr [rax+70h]"], [37, "and eax, 1"], [38, "test al, al"], [39, "jz short loc_40C716"], [40, "mov rax, [rbp+var_10]"], [41, "mov rax, [rax+60h]"], [42, "test rax, rax"], [43, "jz short loc_40C703"], [44, "mov rax, [rbp+var_10]"], [45, "mov rax, [rax+60h]"], [46, "mov rdx, [rbp+var_10]"], [47, "mov rdx, [rdx+68h]"], [48, "mov [rax+68h], rdx"], [49, "mov rax, [rbp+var_10]"], [50, "mov rax, [rax+68h]"], [51, "mov rdx, [rbp+var_10]"], [52, "mov rdx, [rdx+60h]"], [53, "mov [rax], rdx"], [54, "movzx eax, [rbp+var_14]"], [55, "and eax, 1"], [56, "mov edx, eax"], [57, "mov rax, [rbp+var_10]"], [58, "mov ecx, edx"], [59, "and ecx, 1"], [60, "movzx edx, byte ptr [rax+70h]"], [61, "and edx, 0FFFFFFFEh"], [62, "or edx, ecx"], [63, "mov [rax+70h], dl"], [64, "nop"], [65, "pop rbp"], [66, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [11, 10], [12, 11], [13, 2], [14, 13], [15, 3], [16, 15], [16, 14], [17, 3], [18, 17], [18, 16], [19, 18], [20, 19], [21, 2], [22, 21], [22, 16], [22, 25], [23, 3], [24, 23], [25, 22], [25, 24], [26, 2], [27, 3], [28, 27], [28, 26], [29, 2], [30, 27], [30, 29], [30, 28], [31, 3], [32, 30], [32, 31], [33, 5], [34, 33], [35, 3], [36, 16], [36, 25], [36, 35], [36, 28], [36, 32], [37, 36], [38, 37], [39, 38], [40, 3], [41, 40], [41, 28], [41, 32], [41, 16], [41, 25], [42, 41], [43, 42], [44, 3], [45, 28], [45, 32], [45, 16], [45, 25], [45, 48], [45, 44], [46, 3], [47, 16], [47, 25], [47, 48], [47, 28], [47, 46], [47, 32], [48, 45], [48, 47], [49, 3], [50, 49], [50, 28], [50, 32], [50, 53], [50, 16], [50, 25], [50, 48], [51, 3], [52, 51], [52, 28], [52, 32], [52, 53], [52, 16], [52, 25], [52, 48], [53, 50], [53, 52], [54, 5], [55, 54], [56, 55], [57, 3], [58, 56], [59, 58], [60, 53], [60, 28], [60, 48], [60, 32], [60, 16], [60, 25], [60, 57], [60, 63], [61, 60], [62, 59], [62, 61], [63, 62], [63, 57], [65, 0], [66, 57]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b_f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.jsonl.gz", "strip_func_name": "sub_40C64E", "query": "\n\n\n__int64 __fastcall sub_40C64E(__int64 a1, __int64 a2, char a3)\n{\n__int64 result; // rax\n\nif ( a3 && (*(_BYTE *)(a2 + 112) & 1) == 0 )\n{\n*(_QWORD *)(a2 + 96) = *(_QWORD *)(a1 + 128);\nif ( *(_QWORD *)(a2 + 96) )\n*(_QWORD *)(*(_QWORD *)(a1 + 128) + 104LL) = a2 + 96;\n*(_QWORD *)(a1 + 128) = a2;\n*(_QWORD *)(a2 + 104) = a1 + 128;\n}\nif ( !a3 && (*(_BYTE *)(a2 + 112) & 1) != 0 )\n{\nif ( *(_QWORD *)(a2 + 96) )\n*(_QWORD *)(*(_QWORD *)(a2 + 96) + 104LL) = *(_QWORD *)(a2 + 104);\n**(_QWORD **)(a2 + 104) = *(_QWORD *)(a2 + 96);\n}\nresult = a2;\n*(_BYTE *)(a2 + 112) = a3 & 1 | *(_BYTE *)(a2 + 112) & 0xFE;\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_40C64E,]", "hints": "[]", "response": "{'a3': 'state', 'a1': 'ufh', 'a2': 'ubc', 'sub_40C64E': 'adj_dirty'}"} | [
[
0.8727919459342957,
0.7963059544563293,
0.7786487936973572,
0.7714477777481079,
0.7706941366195679,
0.7637290358543396,
0.7622727155685425,
0.7617082595825195,
0.7616208791732788,
0.7602972388267517,
0.7590761184692383,
0.7590101957321167,
0.744989812374115,
0.7432284951210022,
0.7399923801422119,
0.736671507358551,
0.7329403758049011,
0.7294402718544006,
0.7218214869499207,
0.7215808629989624
],
[
75108,
166066,
88709,
207431,
189043,
4275,
177835,
252548,
84816,
186545,
37582,
231637,
231538,
244215,
28788,
56574,
235040,
45572,
100032,
263644
]
] |
|
json_value_free_ex | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | void json_value_free_ex (json_settings * settings, json_value * value)
{
json_value * cur_value;
if (!value)
return;
value->parent = 0;
while (value)
{
switch (value->type)
{
case json_array:
if (!value->u.array.length)
{
if (value->u.array.values) settings->memory_free (value->u.array.values, settings->user_data);
break;
}
value = value->u.array.values [-- value->u.array.length];
continue;
case json_object:
if (!value->u.object.length)
{
settings->memory_free (value->u.object.values, settings->user_data);
break;
}
value = value->u.object.values [-- value->u.object.length].value;
continue;
case json_string:
settings->memory_free (value->u.string.ptr, settings->user_data);
break;
default:
break;
};
cur_value = value;
value = value->parent;
settings->memory_free (cur_value, settings->user_data);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_45D830", "function_addr": 4577328, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "cmp [rbp+var_20], 0"], [6, "jz loc_45D9C3"], [7, "mov rax, [rbp+var_20]"], [8, "mov qword ptr [rax], 0"], [9, "jmp loc_45D9B6"], [10, "mov rax, [rbp+var_20]"], [11, "mov eax, [rax+8]"], [12, "cmp eax, 5"], [13, "jz loc_45D961"], [14, "cmp eax, 5"], [15, "ja loc_45D983"], [16, "cmp eax, 1"], [17, "jz short loc_45D8F8"], [18, "cmp eax, 2"], [19, "jnz loc_45D983"], [20, "mov rax, [rbp+var_20]"], [21, "mov eax, [rax+10h]"], [22, "test eax, eax"], [23, "jnz short loc_45D8C3"], [24, "mov rax, [rbp+var_20]"], [25, "mov rax, [rax+18h]"], [26, "test rax, rax"], [27, "jz loc_45D986"], [28, "mov rax, [rbp+var_18]"], [29, "mov rcx, [rax+18h]"], [30, "mov rax, [rbp+var_18]"], [31, "mov rdx, [rax+20h]"], [32, "mov rax, [rbp+var_20]"], [33, "mov rax, [rax+18h]"], [34, "mov rsi, rdx"], [35, "mov rdi, rax"], [36, "call rcx"], [37, "jmp loc_45D986"], [38, "mov rax, [rbp+var_20]"], [39, "mov rcx, [rax+18h]"], [40, "mov rax, [rbp+var_20]"], [41, "mov eax, [rax+10h]"], [42, "lea edx, [rax-1]"], [43, "mov rax, [rbp+var_20]"], [44, "mov [rax+10h], edx"], [45, "mov rax, [rbp+var_20]"], [46, "mov eax, [rax+10h]"], [47, "mov eax, eax"], [48, "shl rax, 3"], [49, "add rax, rcx"], [50, "mov rax, [rax]"], [51, "mov [rbp+var_20], rax"], [52, "jmp loc_45D9B6"], [53, "mov rax, [rbp+var_20]"], [54, "mov eax, [rax+10h]"], [55, "test eax, eax"], [56, "jnz short loc_45D925"], [57, "mov rax, [rbp+var_18]"], [58, "mov rcx, [rax+18h]"], [59, "mov rax, [rbp+var_18]"], [60, "mov rdx, [rax+20h]"], [61, "mov rax, [rbp+var_20]"], [62, "mov rax, [rax+18h]"], [63, "mov rsi, rdx"], [64, "mov rdi, rax"], [65, "call rcx"], [66, "jmp short loc_45D987"], [67, "mov rax, [rbp+var_20]"], [68, "mov rcx, [rax+18h]"], [69, "mov rax, [rbp+var_20]"], [70, "mov eax, [rax+10h]"], [71, "lea edx, [rax-1]"], [72, "mov rax, [rbp+var_20]"], [73, "mov [rax+10h], edx"], [74, "mov rax, [rbp+var_20]"], [75, "mov eax, [rax+10h]"], [76, "mov edx, eax"], [77, "mov rax, rdx"], [78, "add rax, rax"], [79, "add rax, rdx"], [80, "shl rax, 3"], [81, "add rax, rcx"], [82, "mov rax, [rax+10h]"], [83, "mov [rbp+var_20], rax"], [84, "jmp short loc_45D9B6"], [85, "mov rax, [rbp+var_18]"], [86, "mov rcx, [rax+18h]"], [87, "mov rax, [rbp+var_18]"], [88, "mov rdx, [rax+20h]"], [89, "mov rax, [rbp+var_20]"], [90, "mov rax, [rax+18h]"], [91, "mov rsi, rdx"], [92, "mov rdi, rax"], [93, "call rcx"], [94, "jmp short loc_45D987"], [95, "nop"], [96, "jmp short loc_45D987"], [97, "nop"], [98, "mov rax, [rbp+var_20]"], [99, "mov [rbp+var_8], rax"], [100, "mov rax, [rbp+var_20]"], [101, "mov rax, [rax]"], [102, "mov [rbp+var_20], rax"], [103, "mov rax, [rbp+var_18]"], [104, "mov rcx, [rax+18h]"], [105, "mov rax, [rbp+var_18]"], [106, "mov rdx, [rax+20h]"], [107, "mov rax, [rbp+var_8]"], [108, "mov rsi, rdx"], [109, "mov rdi, rax"], [110, "call rcx"], [111, "cmp [rbp+var_20], 0"], [112, "jnz loc_45D85B"], [113, "jmp short locret_45D9C4"], [114, "nop"], [115, "leave"], [116, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 4], [8, 7], [10, 102], [10, 51], [10, 83], [10, 4], [11, 44], [11, 73], [11, 8], [11, 10], [12, 11], [13, 12], [14, 11], [15, 14], [16, 11], [17, 16], [18, 11], [19, 18], [20, 102], [20, 51], [20, 83], [20, 4], [21, 73], [21, 20], [21, 8], [21, 44], [22, 21], [23, 22], [24, 51], [24, 83], [24, 4], [24, 102], [25, 24], [25, 8], [25, 44], [25, 73], [26, 25], [27, 26], [28, 3], [29, 8], [29, 44], [29, 28], [29, 73], [30, 3], [31, 8], [31, 44], [31, 30], [31, 73], [32, 4], [32, 102], [32, 51], [32, 83], [33, 8], [33, 44], [33, 73], [33, 32], [34, 31], [35, 33], [36, 29], [38, 4], [38, 102], [38, 83], [38, 51], [39, 44], [39, 73], [39, 8], [39, 38], [40, 4], [40, 102], [40, 51], [40, 83], [41, 40], [41, 8], [41, 44], [41, 73], [42, 41], [42, 42], [42, 106], [42, 8], [42, 76], [42, 44], [42, 73], [43, 83], [43, 4], [43, 102], [43, 51], [44, 42], [44, 43], [45, 83], [45, 4], [45, 102], [45, 51], [46, 45], [46, 44], [47, 46], [48, 47], [49, 39], [49, 48], [50, 49], [50, 8], [50, 44], [51, 50], [53, 4], [53, 102], [53, 51], [53, 83], [54, 8], [54, 44], [54, 53], [54, 73], [55, 54], [56, 55], [57, 3], [58, 44], [58, 73], [58, 57], [58, 8], [59, 3], [60, 44], [60, 73], [60, 59], [60, 8], [61, 102], [61, 51], [61, 83], [61, 4], [62, 8], [62, 44], [62, 73], [62, 61], [63, 60], [64, 62], [65, 58], [67, 4], [67, 102], [67, 51], [67, 83], [68, 8], [68, 44], [68, 67], [68, 73], [69, 51], [69, 83], [69, 4], [69, 102], [70, 73], [70, 8], [70, 44], [70, 69], [71, 42], [71, 106], [71, 8], [71, 44], [71, 76], [71, 73], [71, 70], [72, 4], [72, 102], [72, 51], [72, 83], [73, 71], [73, 72], [74, 4], [74, 102], [74, 51], [74, 83], [75, 74], [75, 73], [76, 75], [77, 76], [78, 77], [79, 76], [79, 78], [80, 79], [81, 80], [81, 68], [82, 81], [82, 73], [83, 82], [85, 3], [86, 44], [86, 85], [86, 73], [86, 8], [87, 3], [88, 8], [88, 44], [88, 87], [88, 73], [89, 4], [89, 102], [89, 51], [89, 83], [90, 44], [90, 89], [90, 73], [90, 8], [91, 88], [92, 90], [93, 86], [98, 4], [98, 102], [98, 51], [98, 83], [99, 98], [100, 83], [100, 4], [100, 102], [100, 51], [101, 44], [101, 73], [101, 100], [101, 8], [102, 101], [103, 3], [104, 73], [104, 8], [104, 44], [104, 103], [105, 3], [106, 8], [106, 44], [106, 105], [106, 73], [107, 99], [108, 106], [109, 107], [110, 104], [111, 83], [111, 4], [111, 102], [111, 51], [112, 111], [116, 110], [116, 7], [116, 82], [116, 50]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97_b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.jsonl.gz", "strip_func_name": "sub_45D830", "query": "\n\n\nvoid __fastcall sub_45D830(__int64 a1, _QWORD *a2)\n{\nunsigned int v2; // eax\n__int64 v3; // rcx\n__int64 v4; // rcx\n_QWORD *v5; // [rsp+0h] [rbp-20h]\n_QWORD *v6; // [rsp+18h] [rbp-8h]\n\nv5 = a2;\nif ( a2 )\n{\n*a2 = 0LL;\nwhile ( 1 )\n{\nif ( !v5 )\nreturn;\nv2 = *((_DWORD *)v5 + 2);\nif ( v2 == 5 )\ngoto LABEL_13;\nif ( v2 > 5 )\ngoto LABEL_14;\nif ( v2 == 1 )\n{\nif ( *((_DWORD *)v5 + 4) )\n{\nv4 = v5[3];\nv5 = *(_QWORD **)(v4 + 24LL * (unsigned int)--*((_DWORD *)v5 + 4) + 16);\n}\nelse\n{\nLABEL_13:\n(*(void (__fastcall **)(_QWORD, _QWORD))(a1 + 24))(v5[3], *(_QWORD *)(a1 + 32));\nLABEL_14:\nv6 = v5;\nv5 = (_QWORD *)*v5;\n(*(void (__fastcall **)(_QWORD *, _QWORD))(a1 + 24))(v6, *(_QWORD *)(a1 + 32));\n}\n}\nelse\n{\nif ( v2 != 2 )\ngoto LABEL_14;\nif ( !*((_DWORD *)v5 + 4) )\n{\nif ( !v5[3] )\ngoto LABEL_14;\ngoto LABEL_13;\n}\nv3 = v5[3];\nv5 = *(_QWORD **)(v3 + 8LL * (unsigned int)--*((_DWORD *)v5 + 4));\n}\n}\n}\n}\n\n\n\nQ:[a1,a2,v5,v6,sub_45D830,]", "hints": "[]", "response": "{'a1': 'settings', 'a2': 'value', 'v5': 'valuea', 'v6': 'cur_value', 'sub_45D830': 'json_value_free_ex'}"} | [
[
0.7399582266807556,
0.7301849126815796,
0.7203065156936646,
0.7166279554367065,
0.7107579112052917,
0.7103157043457031,
0.7102171778678894,
0.7098037004470825,
0.7009801864624023,
0.7000196576118469,
0.6976739168167114,
0.6975829601287842,
0.6922258138656616,
0.6901369690895081,
0.689469575881958,
0.6886234283447266,
0.6854366660118103,
0.6832356452941895,
0.6827157735824585,
0.6749368906021118
],
[
98413,
35776,
12179,
94334,
222615,
16847,
44621,
179828,
237578,
106028,
131629,
161882,
59876,
180481,
144232,
165063,
125340,
172534,
74993,
79620
]
] |
|
pik_parserInit | 6ead3e2c5df9f0cec91e1679fd76dac60559aa5587baa29b2e436f8abc022a6f | drhsqlite | pikchr | NA | void pik_parserInit(void *yypRawParser pik_parserCTX_PDECL){
yyParser *yypParser = (yyParser*)yypRawParser;
pik_parserCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH
yypParser->yyhwm = 0;
#endif
#if YYSTACKDEPTH<=0
yypParser->yytos = NULL;
yypParser->yystack = NULL;
yypParser->yystksz = 0;
if( yyGrowStack(yypParser) ){
yypParser->yystack = &yypParser->yystk0;
yypParser->yystksz = 1;
}
#endif
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yypParser->yytos = yypParser->yystack;
yypParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4013B2", "function_addr": 4199346, "binary_name": "6ead3e2c5df9f0cec91e1679fd76dac60559aa5587baa29b2e436f8abc022a6f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_20], rsi"], [4, "mov rax, [rbp+var_18]"], [5, "mov [rbp+var_8], rax"], [6, "mov rax, [rbp+var_8]"], [7, "mov rdx, [rbp+var_20]"], [8, "mov [rax+10h], rdx"], [9, "mov rax, [rbp+var_8]"], [10, "mov dword ptr [rax+8], 0FFFFFFFFh"], [11, "mov rax, [rbp+var_8]"], [12, "lea rdx, [rax+18h]"], [13, "mov rax, [rbp+var_8]"], [14, "mov [rax], rdx"], [15, "mov rax, [rbp+var_8]"], [16, "mov word ptr [rax+18h], 0"], [17, "mov rax, [rbp+var_8]"], [18, "mov byte ptr [rax+1Ah], 0"], [19, "mov rax, [rbp+var_8]"], [20, "lea rdx, [rax+960h]"], [21, "mov rax, [rbp+var_8]"], [22, "mov [rax+978h], rdx"], [23, "nop"], [24, "pop rbp"], [25, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 5], [7, 3], [8, 6], [8, 7], [9, 5], [10, 9], [11, 5], [12, 7], [12, 10], [12, 11], [13, 5], [14, 13], [14, 12], [15, 5], [16, 15], [17, 5], [18, 17], [19, 5], [20, 19], [20, 12], [20, 18], [21, 5], [22, 20], [22, 21], [24, 0], [25, 21]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/6ead3e2c5df9f0cec91e1679fd76dac60559aa5587baa29b2e436f8abc022a6f_6ead3e2c5df9f0cec91e1679fd76dac60559aa5587baa29b2e436f8abc022a6f.jsonl.gz", "strip_func_name": "sub_4013B2", "query": "\n\n\n__int64 __fastcall sub_4013B2(__int64 a1, __int64 a2)\n{\n__int64 result; // rax\n\n*(_QWORD *)(a1 + 16) = a2;\n*(_DWORD *)(a1 + 8) = -1;\n*(_QWORD *)a1 = a1 + 24;\n*(_WORD *)(a1 + 24) = 0;\n*(_BYTE *)(a1 + 26) = 0;\nresult = a1;\n*(_QWORD *)(a1 + 2424) = a1 + 2400;\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_4013B2,]", "hints": "[]", "response": "{'a1': 'yypRawParser', 'a2': 'p', 'sub_4013B2': 'pik_parserInit'}"} | [
[
0.8109074234962463,
0.8093304634094238,
0.7995762228965759,
0.7954367995262146,
0.7930675745010376,
0.7802727222442627,
0.7760051488876343,
0.7731801271438599,
0.7709169983863831,
0.7703794836997986,
0.7689266800880432,
0.7685402035713196,
0.7677867412567139,
0.7668524980545044,
0.7629187107086182,
0.7554633617401123,
0.7551869750022888,
0.7488706111907959,
0.7484147548675537,
0.7451019883155823
],
[
254001,
256087,
129572,
142317,
109799,
5656,
37093,
150690,
58519,
253147,
217851,
86985,
264770,
102715,
41146,
107853,
107615,
16687,
144864,
3500
]
] |
|
amt_verify_response_header | e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a | mandiant | rvmi | NA | static uint32_t amt_verify_response_header(uint32_t command,
const struct amt_host_if_msg_header *resp_hdr,
uint32_t response_size)
{
if (response_size < sizeof(struct amt_host_if_resp_header)) {
return AMT_STATUS_INTERNAL_ERROR;
} else if (response_size != (resp_hdr->length +
sizeof(struct amt_host_if_msg_header))) {
return AMT_STATUS_INTERNAL_ERROR;
} else if (resp_hdr->command != command) {
return AMT_STATUS_INTERNAL_ERROR;
} else if (resp_hdr->_reserved != 0) {
return AMT_STATUS_INTERNAL_ERROR;
} else if (resp_hdr->version.major != AMT_MAJOR_VERSION ||
resp_hdr->version.minor < AMT_MINOR_VERSION) {
return AMT_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4019B4", "function_addr": 4200884, "binary_name": "e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "mov [rbp+var_10], rsi"], [4, "mov [rbp+var_8], edx"], [5, "cmp [rbp+var_8], 0Fh"], [6, "ja short loc_4019CF"], [7, "mov eax, 1"], [8, "jmp short loc_401A35"], [9, "mov edx, [rbp+var_8]"], [10, "mov rax, [rbp+var_10]"], [11, "mov eax, [rax+8]"], [12, "mov eax, eax"], [13, "add rax, 0Ch"], [14, "cmp rdx, rax"], [15, "jz short loc_4019EB"], [16, "mov eax, 1"], [17, "jmp short loc_401A35"], [18, "mov rax, [rbp+var_10]"], [19, "mov eax, [rax+4]"], [20, "cmp [rbp+var_4], eax"], [21, "jz short loc_4019FE"], [22, "mov eax, 1"], [23, "jmp short loc_401A35"], [24, "mov rax, [rbp+var_10]"], [25, "movzx eax, word ptr [rax+2]"], [26, "test ax, ax"], [27, "jz short loc_401A12"], [28, "mov eax, 1"], [29, "jmp short loc_401A35"], [30, "mov rax, [rbp+var_10]"], [31, "movzx eax, byte ptr [rax]"], [32, "cmp al, 1"], [33, "jnz short loc_401A29"], [34, "mov rax, [rbp+var_10]"], [35, "movzx eax, byte ptr [rax+1]"], [36, "test al, al"], [37, "jnz short loc_401A30"], [38, "mov eax, 1"], [39, "jmp short loc_401A35"], [40, "mov eax, 0"], [41, "pop rbp"], [42, "retn"]], "data_dep": [[5, 4], [6, 5], [9, 4], [10, 3], [11, 10], [12, 11], [13, 12], [14, 13], [14, 9], [15, 14], [18, 3], [19, 18], [20, 19], [20, 2], [21, 20], [24, 3], [25, 24], [26, 25], [27, 26], [30, 3], [31, 30], [32, 31], [33, 32], [34, 3], [35, 34], [36, 35], [37, 36], [41, 0], [42, 38], [42, 7], [42, 16], [42, 22], [42, 28], [42, 40]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a_e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a.jsonl.gz", "strip_func_name": "sub_4019B4", "query": "\n\n\n_BOOL8 __fastcall sub_4019B4(int a1, __int64 a2, unsigned int a3)\n{\nif ( a3 <= 0xF )\nreturn 1LL;\nif ( a3 != *(unsigned int *)(a2 + 8) + 12LL )\nreturn 1LL;\nif ( a1 != *(_DWORD *)(a2 + 4) )\nreturn 1LL;\nif ( *(_WORD *)(a2 + 2) )\nreturn 1LL;\nreturn *(_BYTE *)a2 != 1 || !*(_BYTE *)(a2 + 1);\n}\n\n\n\nQ:[a3,a1,a2,sub_4019B4,]", "hints": "[]", "response": "{'a3': 'response_size', 'a1': 'command', 'a2': 'resp_hdr', 'sub_4019B4': 'amt_verify_response_header'}"} | [
[
0.8381232023239136,
0.8315554857254028,
0.7764106392860413,
0.7681916952133179,
0.7533723711967468,
0.7527055740356445,
0.7518470287322998,
0.7486723065376282,
0.7484289407730103,
0.7395891547203064,
0.7333847284317017,
0.7332267761230469,
0.7254117727279663,
0.7243998050689697,
0.7239404320716858,
0.7213666439056396,
0.7190086841583252,
0.7188337445259094,
0.7183812856674194,
0.7179064750671387
],
[
228335,
144140,
55460,
197556,
244179,
97970,
121077,
247630,
43966,
23162,
124446,
38599,
96252,
92166,
198851,
118560,
61836,
33377,
135146,
65523
]
] |
|
doamp | c9e9b5b3d11acdc1b9b694fd074b5b52f7edc3a705971a298bac22a81d00e1fa | Gottox | smu | NA | int
doamp(const char *begin, const char *end, int newblock) {
const char *p;
if(*begin != '&')
return 0;
if(!nohtml) {
for(p = begin + 1; p != end && !strchr("; \\\n\t", *p); p++);
if(p == end || *p == ';')
return 0;
}
fputs("&", stdout);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401312", "function_addr": 4199186, "binary_name": "c9e9b5b3d11acdc1b9b694fd074b5b52f7edc3a705971a298bac22a81d00e1fa.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+var_24], edx"], [6, "mov rax, [rbp+var_18]"], [7, "movzx eax, byte ptr [rax]"], [8, "cmp al, 26h "], [9, "jz short loc_40133A"], [10, "mov eax, 0"], [11, "jmp locret_4013BB"], [12, "mov eax, cs:dword_4064EC"], [13, "test eax, eax"], [14, "jnz short loc_401398"], [15, "mov rax, [rbp+var_18]"], [16, "add rax, 1"], [17, "mov [rbp+var_8], rax"], [18, "jmp short loc_401357"], [19, "add [rbp+var_8], 1"], [20, "mov rax, [rbp+var_8]"], [21, "cmp rax, [rbp+var_20]"], [22, "jz short loc_40137C"], [23, "mov rax, [rbp+var_8]"], [24, "movzx eax, byte ptr [rax]"], [25, "movsx eax, al"], [26, "mov esi, eax"], [27, "mov edi, offset s"], [28, "call _strchr"], [29, "test rax, rax"], [30, "jz short loc_401352"], [31, "mov rax, [rbp+var_8]"], [32, "cmp rax, [rbp+var_20]"], [33, "jz short loc_401391"], [34, "mov rax, [rbp+var_8]"], [35, "movzx eax, byte ptr [rax]"], [36, "cmp al, 3Bh "], [37, "jnz short loc_401398"], [38, "mov eax, 0"], [39, "jmp short locret_4013BB"], [40, "mov rax, cs:stdout"], [41, "mov rcx, rax"], [42, "mov edx, 5"], [43, "mov esi, 1"], [44, "mov edi, offset aAmp"], [45, "call _fwrite"], [46, "mov eax, 1"], [47, "leave"], [48, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [13, 12], [14, 13], [15, 3], [16, 15], [17, 16], [19, 17], [19, 19], [20, 17], [20, 19], [21, 20], [21, 4], [22, 21], [23, 19], [23, 17], [24, 23], [25, 24], [26, 25], [29, 28], [30, 29], [31, 17], [31, 19], [32, 31], [32, 4], [33, 32], [34, 19], [34, 17], [35, 34], [36, 35], [37, 36], [41, 40], [48, 38], [48, 10], [48, 46]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/c9e9b5b3d11acdc1b9b694fd074b5b52f7edc3a705971a298bac22a81d00e1fa_c9e9b5b3d11acdc1b9b694fd074b5b52f7edc3a705971a298bac22a81d00e1fa.jsonl.gz", "strip_func_name": "sub_401312", "query": "\n\n\n__int64 __fastcall sub_401312(_BYTE *a1, _BYTE *a2)\n{\n_BYTE *i; // [rsp+28h] [rbp-8h]\n\nif ( *a1 != 38 )\nreturn 0LL;\nif ( !dword_4064EC )\n{\nfor ( i = a1 + 1; i != a2 && !strchr(\"; \\\\\\n\\t\", (char)*i); ++i )\n;\nif ( i == a2 || *i == 59 )\nreturn 0LL;\n}\nfwrite(\"&\", 1uLL, 5uLL, stdout);\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,i,sub_401312,]", "hints": "[]", "response": "{'a1': 'begin', 'a2': 'end', 'i': 'p', 'sub_401312': 'doamp'}"} | [
[
0.7969914078712463,
0.7851712107658386,
0.7608956098556519,
0.7482764720916748,
0.7437787652015686,
0.7281192541122437,
0.7167022824287415,
0.715423583984375,
0.6962792873382568,
0.6957470178604126,
0.6915660500526428,
0.6913087368011475,
0.6896001696586609,
0.683556318283081,
0.6815880537033081,
0.6781510710716248,
0.678102970123291,
0.674644947052002,
0.6715403199195862,
0.668350338935852
],
[
197494,
235296,
170625,
38531,
55260,
163191,
257458,
26869,
204536,
50104,
211726,
21414,
175686,
70725,
46843,
40940,
262264,
252755,
31487,
195170
]
] |
|
send_desync_data | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | void send_desync_data(struct mypacket *orig_packet, unsigned int flags)
{
char sip[16], dip[16];
unsigned short sport, dport;
unsigned int seq_num, ack_num;
struct send_tcp_vars vars = {};
struct in_addr s_in_addr = {orig_packet->iphdr->saddr};
struct in_addr d_in_addr = {orig_packet->iphdr->daddr};
strncpy(sip, inet_ntoa(s_in_addr), 16);
strncpy(dip, inet_ntoa(d_in_addr), 16);
sport = ntohs(orig_packet->tcphdr->th_sport);
dport = ntohs(orig_packet->tcphdr->th_dport);
seq_num = ntohl(orig_packet->tcphdr->th_seq);
ack_num = ntohl(orig_packet->tcphdr->th_ack);
memset(&vars, 0, sizeof vars);
strncpy(vars.src_ip, sip, 16);
strncpy(vars.dst_ip, dip, 16);
vars.src_port = sport;
vars.dst_port = dport;
vars.flags = TCP_ACK;
vars.seq_num = seq_num + 1000;
vars.ack_num = ack_num;
// mss (aliyun discards SYN without mss option header)
//u_char bytes[4] = {0x02, 0x04, 0x05, 0xb4};
//memcpy(vars.tcp_opt, bytes, 4);
//vars.tcp_opt_len = 4;
// copy the tcp option header to the insertion packet
char *tcp_opt = (char*)orig_packet->tcphdr + 20;
unsigned char tcp_opt_len = orig_packet->tcphdr->th_off * 4 - 20;
memcpy(vars.tcp_opt, tcp_opt, tcp_opt_len);
vars.tcp_opt_len = tcp_opt_len;
// one-byte payload
vars.payload_len = 1;
vars.payload[0] = 'A';
vars.payload[1] = 0;
send_insertion_packet(&vars, flags);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_412055", "function_addr": 4268117, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10D0h"], [3, "mov [rbp+var_10C8], rdi"], [4, "mov [rbp+var_10CC], esi"], [5, "lea rdx, [rbp+s]"], [6, "mov eax, 0"], [7, "mov ecx, 20Ch"], [8, "mov rdi, rdx"], [9, "rep stosq"], [10, "mov rdx, rdi"], [11, "mov [rdx], eax"], [12, "add rdx, 4"], [13, "mov rax, [rbp+var_10C8]"], [14, "mov rax, [rax+10h]"], [15, "mov eax, [rax+0Ch]"], [16, "mov [rbp+in.s_addr], eax"], [17, "mov rax, [rbp+var_10C8]"], [18, "mov rax, [rax+10h]"], [19, "mov eax, [rax+10h]"], [20, "mov [rbp+var_10B8.s_addr], eax"], [21, "mov eax, [rbp+in.s_addr]"], [22, "mov edi, eax"], [23, "call _inet_ntoa"], [24, "mov rcx, rax"], [25, "lea rax, [rbp+dest]"], [26, "mov edx, 10h"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _strncpy"], [30, "mov eax, [rbp+var_10B8.s_addr]"], [31, "mov edi, eax"], [32, "call _inet_ntoa"], [33, "mov rcx, rax"], [34, "lea rax, [rbp+src]"], [35, "mov edx, 10h"], [36, "mov rsi, rcx"], [37, "mov rdi, rax"], [38, "call _strncpy"], [39, "mov rax, [rbp+var_10C8]"], [40, "mov rax, [rax+18h]"], [41, "movzx eax, word ptr [rax]"], [42, "movzx eax, ax"], [43, "mov edi, eax"], [44, "call _ntohs"], [45, "mov [rbp+var_2], ax"], [46, "mov rax, [rbp+var_10C8]"], [47, "mov rax, [rax+18h]"], [48, "movzx eax, word ptr [rax+2]"], [49, "movzx eax, ax"], [50, "mov edi, eax"], [51, "call _ntohs"], [52, "mov [rbp+var_4], ax"], [53, "mov rax, [rbp+var_10C8]"], [54, "mov rax, [rax+18h]"], [55, "mov eax, [rax+4]"], [56, "mov edi, eax"], [57, "call _ntohl"], [58, "mov [rbp+var_8], eax"], [59, "mov rax, [rbp+var_10C8]"], [60, "mov rax, [rax+18h]"], [61, "mov eax, [rax+8]"], [62, "mov edi, eax"], [63, "call _ntohl"], [64, "mov [rbp+var_C], eax"], [65, "lea rax, [rbp+s]"], [66, "mov edx, 1064h"], [67, "mov esi, 0"], [68, "mov rdi, rax"], [69, "call _memset"], [70, "lea rcx, [rbp+dest]"], [71, "lea rax, [rbp+s]"], [72, "mov edx, 10h"], [73, "mov rsi, rcx"], [74, "mov rdi, rax"], [75, "call _strncpy"], [76, "lea rax, [rbp+src]"], [77, "lea rdx, [rbp+s]"], [78, "lea rcx, [rdx+10h]"], [79, "mov edx, 10h"], [80, "mov rsi, rax"], [81, "mov rdi, rcx"], [82, "call _strncpy"], [83, "movzx eax, [rbp+var_2]"], [84, "mov [rbp+var_108C], ax"], [85, "movzx eax, [rbp+var_4]"], [86, "mov [rbp+var_108A], ax"], [87, "mov [rbp+var_107D], 10h"], [88, "mov eax, [rbp+var_8]"], [89, "add eax, 3E8h"], [90, "mov [rbp+var_1088], eax"], [91, "mov eax, [rbp+var_C]"], [92, "mov [rbp+var_1084], eax"], [93, "mov rax, [rbp+var_10C8]"], [94, "mov rax, [rax+18h]"], [95, "add rax, 14h"], [96, "mov [rbp+var_18], rax"], [97, "mov rax, [rbp+var_10C8]"], [98, "mov rax, [rax+18h]"], [99, "movzx eax, byte ptr [rax+0Ch]"], [100, "shr al, 4"], [101, "movzx eax, al"], [102, "sub eax, 5"], [103, "shl eax, 2"], [104, "mov [rbp+var_19], al"], [105, "movzx edx, [rbp+var_19]"], [106, "mov rax, [rbp+var_18]"], [107, "lea rcx, [rbp+s]"], [108, "add rcx, 37h "], [109, "mov rsi, rax"], [110, "mov rdi, rcx"], [111, "call _memcpy"], [112, "movzx eax, [rbp+var_19]"], [113, "mov [rbp+var_1051], al"], [114, "mov [rbp+var_50], 1"], [115, "mov [rbp+var_1050], 41h "], [116, "mov [rbp+var_104F], 0"], [117, "mov edx, [rbp+var_10CC]"], [118, "lea rax, [rbp+s]"], [119, "mov esi, edx"], [120, "mov rdi, rax"], [121, "call sub_41146E"], [122, "nop"], [123, "leave"], [124, "retn"]], "data_dep": [[8, 5], [10, 8], [11, 6], [11, 10], [12, 10], [13, 3], [14, 13], [14, 11], [15, 14], [15, 11], [16, 15], [17, 3], [18, 17], [18, 11], [19, 18], [19, 11], [20, 19], [21, 16], [22, 21], [24, 23], [25, 23], [27, 24], [28, 25], [30, 20], [31, 30], [33, 32], [34, 32], [36, 33], [37, 34], [39, 3], [40, 39], [40, 11], [41, 40], [41, 11], [42, 41], [43, 42], [45, 44], [46, 3], [47, 11], [47, 46], [48, 47], [48, 11], [49, 48], [50, 49], [52, 51], [53, 3], [54, 53], [54, 11], [55, 11], [55, 54], [56, 55], [58, 57], [59, 3], [60, 11], [60, 59], [61, 60], [61, 11], [62, 61], [64, 63], [65, 63], [68, 65], [70, 33], [71, 69], [73, 70], [74, 71], [76, 75], [77, 72], [78, 77], [78, 70], [78, 11], [80, 76], [81, 78], [83, 45], [84, 83], [85, 52], [86, 85], [88, 58], [89, 88], [90, 89], [91, 64], [92, 91], [93, 3], [94, 11], [94, 93], [95, 94], [96, 95], [97, 3], [98, 11], [98, 97], [99, 98], [99, 11], [100, 99], [101, 100], [102, 101], [103, 102], [104, 103], [105, 104], [106, 96], [107, 78], [108, 107], [109, 106], [110, 108], [112, 104], [113, 112], [117, 4], [118, 112], [119, 117], [120, 118], [124, 121]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6_4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.jsonl.gz", "strip_func_name": "sub_412055", "query": "\n\n\nint __fastcall sub_412055(__int64 a1, char a2)\n{\nchar *v2; // rax\nchar *v3; // rax\nstruct in_addr v5; // [rsp+18h] [rbp-10B8h]\nint s[1048]; // [rsp+20h] [rbp-10B0h] BYREF\nint v7; // [rsp+1080h] [rbp-50h]\nchar src[16]; // [rsp+1090h] [rbp-40h] BYREF\nchar dest[23]; // [rsp+10A0h] [rbp-30h] BYREF\nunsigned __int8 v10; // [rsp+10B7h] [rbp-19h]\nvoid *v11; // [rsp+10B8h] [rbp-18h]\nuint32_t v12; // [rsp+10C4h] [rbp-Ch]\nuint32_t v13; // [rsp+10C8h] [rbp-8h]\nuint16_t v14; // [rsp+10CCh] [rbp-4h]\nuint16_t v15; // [rsp+10CEh] [rbp-2h]\n\nmemset(s, 0, sizeof(s));\nv7 = 0;\nv5.s_addr = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 16LL);\nv2 = inet_ntoa(*(struct in_addr *)(*(_QWORD *)(a1 + 16) + 12LL));\nstrncpy(dest, v2, 0x10uLL);\nv3 = inet_ntoa(v5);\nstrncpy(src, v3, 0x10uLL);\nv15 = ntohs(**(_WORD **)(a1 + 24));\nv14 = ntohs(*(_WORD *)(*(_QWORD *)(a1 + 24) + 2LL));\nv13 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL));\nv12 = ntohl(*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL));\nmemset(s, 0, 0x1064uLL);\nstrncpy((char *)s, dest, 0x10uLL);\nstrncpy((char *)&s[4], src, 0x10uLL);\nLOWORD(s[9]) = v15;\nHIWORD(s[9]) = v14;\nHIBYTE(s[12]) = 16;\ns[10] = v13 + 1000;\ns[11] = v12;\nv11 = (void *)(*(_QWORD *)(a1 + 24) + 20LL);\nv10 = 4 * ((*(_BYTE *)(*(_QWORD *)(a1 + 24) + 12LL) >> 4) - 5);\nmemcpy((char *)&s[13] + 3, v11, v10);\nHIBYTE(s[23]) = v10;\nLOWORD(v7) = 1;\nLOWORD(s[24]) = 65;\nreturn sub_41146E((__int64)s, a2);\n}\n\n\n\nQ:[a1,a2,v5,s,src,dest,v10,v11,v12,v13,v14,v15,sub_412055,sub_41146E,]", "hints": "[]", "response": "{'a1': 'orig_packet', 'a2': 'flags', 'v5': 'd_in_addr', 's': 'vars', 'src': 'dip', 'dest': 'sip', 'v10': 'tcp_opt_len', 'v11': 'tcp_opt', 'v12': 'ack_num', 'v13': 'seq_num', 'v14': 'dport', 'v15': 'sport', 'sub_412055': 'send_desync_data', 'sub_41146E': 'send_insertion_packet'}"} | [
[
0.770481288433075,
0.7420542240142822,
0.7391578555107117,
0.7227770686149597,
0.7223911881446838,
0.7180140018463135,
0.7176715135574341,
0.7116632461547852,
0.7116014957427979,
0.6897369623184204,
0.6891397833824158,
0.6856796741485596,
0.6786859035491943,
0.6769385933876038,
0.676792562007904,
0.6766180992126465,
0.6752505898475647,
0.6742582321166992,
0.673052191734314,
0.6728498935699463
],
[
210631,
118856,
150537,
193477,
47776,
63563,
241188,
4576,
163817,
146142,
244619,
150355,
171554,
19392,
82308,
204094,
155235,
209741,
932,
170406
]
] |
|
stderr_print | 2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9 | martanne | ciopfs | NA | void stderr_print(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fputs("ciopfs: ", stderr);
vfprintf(stderr, fmt, ap);
va_end(ap);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402640", "function_addr": 4204096, "binary_name": "2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0E0h"], [3, "mov [rbp+format], rdi"], [4, "mov [rbp+var_A8], rsi"], [5, "mov [rbp+var_A0], rdx"], [6, "mov [rbp+var_98], rcx"], [7, "mov [rbp+var_90], r8"], [8, "mov [rbp+var_88], r9"], [9, "test al, al"], [10, "jz short loc_402699"], [11, "movaps [rbp+var_80], xmm0"], [12, "movaps [rbp+var_70], xmm1"], [13, "movaps [rbp+var_60], xmm2"], [14, "movaps [rbp+var_50], xmm3"], [15, "movaps [rbp+var_40], xmm4"], [16, "movaps [rbp+var_30], xmm5"], [17, "movaps [rbp+var_20], xmm6"], [18, "movaps [rbp+var_10], xmm7"], [19, "mov [rbp+arg], 8"], [20, "mov [rbp+var_C4], 30h "], [21, "lea rax, [rbp+arg_0]"], [22, "mov [rbp+var_C0], rax"], [23, "lea rax, [rbp+var_B0]"], [24, "mov [rbp+var_B8], rax"], [25, "mov rax, cs:stderr"], [26, "mov rcx, rax"], [27, "mov edx, 8"], [28, "mov esi, 1"], [29, "mov edi, offset aCiopfs"], [30, "call _fwrite"], [31, "mov rax, cs:stderr"], [32, "lea rdx, [rbp+arg]"], [33, "mov rcx, [rbp+format]"], [34, "mov rsi, rcx"], [35, "mov rdi, rax"], [36, "call _vfprintf"], [37, "nop"], [38, "leave"], [39, "retn"]], "data_dep": [[10, 9], [21, 9], [22, 21], [23, 21], [24, 23], [26, 25], [32, 27], [32, 19], [33, 3], [34, 33], [35, 31], [39, 36]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9_2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9.jsonl.gz", "strip_func_name": "sub_402640", "query": "\n\n\nint sub_402640(const char *a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, ...)\n{\ngcc_va_list arg; // [rsp+18h] [rbp-C8h] BYREF\n__int64 v8; // [rsp+38h] [rbp-A8h]\n__int64 v9; // [rsp+40h] [rbp-A0h]\n__int64 v10; // [rsp+48h] [rbp-98h]\n__int64 v11; // [rsp+50h] [rbp-90h]\n__int64 v12; // [rsp+58h] [rbp-88h]\n\nva_start(arg, a6);\nv8 = a2;\nv9 = a3;\nv10 = a4;\nv11 = a5;\nv12 = a6;\narg[0].gp_offset = 8;\nfwrite(\"ciopfs: \", 1uLL, 8uLL, stderr);\nreturn vfprintf(stderr, a1, arg);\n}\n\n\n\nQ:[a1,arg,sub_402640,]", "hints": "[]", "response": "{'a1': 'fmt', 'arg': 'ap', 'sub_402640': 'stderr_print'}"} | [
[
0.8879002332687378,
0.8861120939254761,
0.8841121196746826,
0.8812217712402344,
0.8791500329971313,
0.8757723569869995,
0.875534176826477,
0.8728852272033691,
0.8728216290473938,
0.872701108455658,
0.8709679841995239,
0.8677760362625122,
0.856275737285614,
0.854184627532959,
0.849825382232666,
0.8401839733123779,
0.8281430006027222,
0.8199586272239685,
0.8168761730194092,
0.8036872148513794
],
[
50004,
10567,
162688,
37173,
235989,
220859,
64626,
39943,
151925,
149304,
235043,
70559,
78802,
21254,
217453,
68746,
256775,
63629,
24152,
143955
]
] |
|
run_test | f0d41f608765601b62f491fdd27d86563871066d97e65cdf3d0fab183b0190f7 | Broadcom | brcm80211 | NA | static int run_test(int (*test)(void), char *name)
{
int result;
pid_t childpid;
fflush(stdout);
childpid = fork();
if (childpid) {
waitpid(childpid, &result, 0);
if (WIFEXITED(result))
return WEXITSTATUS(result);
return 1;
}
printf("[RUN]\tExecuting %s\n", name);
exit(test());
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401282", "function_addr": 4199042, "binary_name": "f0d41f608765601b62f491fdd27d86563871066d97e65cdf3d0fab183b0190f7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov rax, cs:stdout"], [6, "mov rdi, rax"], [7, "call _fflush"], [8, "call _fork"], [9, "mov [rbp+pid], eax"], [10, "cmp [rbp+pid], 0"], [11, "jz short loc_4012E1"], [12, "lea rcx, [rbp+stat_loc]"], [13, "mov eax, [rbp+pid]"], [14, "mov edx, 0"], [15, "mov rsi, rcx"], [16, "mov edi, eax"], [17, "call _waitpid"], [18, "mov eax, [rbp+stat_loc]"], [19, "and eax, 7Fh"], [20, "test eax, eax"], [21, "jnz short loc_4012DA"], [22, "mov eax, [rbp+stat_loc]"], [23, "sar eax, 8"], [24, "movzx eax, al"], [25, "jmp short locret_401304"], [26, "mov eax, 1"], [27, "jmp short locret_401304"], [28, "mov rax, [rbp+var_20]"], [29, "mov rsi, rax"], [30, "mov edi, offset format"], [31, "mov eax, 0"], [32, "call _printf"], [33, "mov rax, [rbp+var_18]"], [34, "call rax"], [35, "mov edi, eax"], [36, "call _exit"], [37, "leave"], [38, "retn"]], "data_dep": [[6, 5], [9, 8], [10, 9], [11, 10], [13, 9], [15, 12], [16, 13], [19, 18], [20, 19], [21, 20], [23, 22], [24, 23], [28, 4], [29, 28], [33, 3], [34, 33], [35, 34], [38, 26], [38, 24]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f0d41f608765601b62f491fdd27d86563871066d97e65cdf3d0fab183b0190f7_f0d41f608765601b62f491fdd27d86563871066d97e65cdf3d0fab183b0190f7.jsonl.gz", "strip_func_name": "sub_401282", "query": "\n\n\n__int64 __fastcall sub_401282(__int64 (*a1)(void), const char *a2)\n{\n__int64 result; // rax\nint v3; // eax\nint stat_loc; // [rsp+18h] [rbp-8h] BYREF\n__pid_t pid; // [rsp+1Ch] [rbp-4h]\n\nfflush(stdout);\npid = fork();\nif ( !pid )\n{\nprintf(\"[RUN]\\tExecuting %s\\n\", a2);\nv3 = a1();\nexit(v3);\n}\nwaitpid(pid, &stat_loc, 0);\nif ( (stat_loc & 0x7F) != 0 )\nresult = 1LL;\nelse\nresult = BYTE1(stat_loc);\nreturn result;\n}\n\n\n\nQ:[a1,a2,stat_loc,pid,sub_401282,]", "hints": "[]", "response": "{'a1': 'test', 'a2': 'name', 'stat_loc': 'result', 'pid': 'childpid', 'sub_401282': 'run_test'}"} | [
[
0.759178638458252,
0.7422707676887512,
0.7273035645484924,
0.7266892194747925,
0.7220850586891174,
0.7141172885894775,
0.7046541571617126,
0.7034701108932495,
0.7030802965164185,
0.7024879455566406,
0.7010878324508667,
0.7009093761444092,
0.7006174325942993,
0.6984697580337524,
0.685175359249115,
0.6818989515304565,
0.6798285245895386,
0.6758081316947937,
0.6747592687606812,
0.6721640825271606
],
[
175849,
63169,
116227,
261363,
41722,
56018,
196740,
200859,
67982,
208393,
180182,
14037,
18301,
15182,
100832,
188921,
131885,
57508,
181727,
259897
]
] |
|
ZipResDecrypt_keyCalc | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | static int
ZipResDecrypt_keyCalc(ZipResDecrypt* o, char *pwd, U16 pwdLen,
BaBool pwdBin, int* sffsdrnandflash, const char** flushoffset)
{
size_t icachealiases;
U32 *h1, *h2, hu[5], hx[5];
U16 i, k;
U8 *ph2, *kbuf, *p;
if (pwdBin)
{
icachealiases = pwdLen;
p = (U8*)AllocatorIntf_malloc(o->alloc, &icachealiases);
if (!p)
return -1;
for (i = 0; i < pwdLen; i++)
{
p[i] = '\101' + ((U8)pwd[i] & 0x0F) + ((U8)pwd[i] >> 4);
if ((U8)pwd[i] & 0x01)
p[i] += '\143' - '\101';
if ((p[i] < '\101') || (p[i] > '\127'))
if ((p[i] < '\141') || (p[i] > '\171'))
p[i] = '\142' + ((U8)pwd[i] & 0x1F);
while (p[i] > '\170')
p[i] -= 9;
}
#if 0
printf("\012\160\141\163\163\167\157\162\144\050\045\144\051\072\040\074",pwdLen);
for (i = 0; i < pwdLen; i++) printf("\045\143", p[i]);
printf("\076\012");
#endif
}
else
p = (U8*)pwd;
icachealiases = 21 * sizeof(U32);
h1 = (U32*)AllocatorIntf_malloc(o->alloc, &icachealiases);
h2 = (U32*)AllocatorIntf_malloc(o->alloc, &icachealiases);
icachealiases = o->AESKeyLen*2 + 2;
icachealiases = (icachealiases + 19)/20 * 20;
kbuf = (U8*)AllocatorIntf_malloc(o->alloc, &icachealiases);
if (!h1 || !h2 || !kbuf)
{
setError(IOINTF_MEM, 0, sffsdrnandflash, flushoffset);
if (pwdBin)
{
memset(p, 0, pwdLen);
AllocatorIntf_free(o->alloc, p);
}
return -1;
}
memset(h1, 0, 64);
memset(h2, 0, 64);
memcpy(h1, p, pwdLen);
memcpy(h2, p, pwdLen);
for (i = 0; (i & 0x0010) == 0; i++)
{
h1[i] ^= 0x36363636;
h2[i] ^= 0x5C5C5C5C;
}
ph2 = (U8*)&h2[16];
k = 1;
_next_key_loop:
memcpy(&h1[16], o->inBuf, o->saltSize);
h1[16 + (o->saltSize >> 2)] =
#ifdef B_LITTLE_ENDIAN
((U32)k << 24);
#elif defined(B_BIG_ENDIAN)
k;
#else
#error Must define one of B_BIG_ENDIAN or B_LITTLE_ENDIAN
#endif
sharkssl_sha1((U8*)h1, 64 + o->saltSize + 4, ph2);
sharkssl_sha1((U8*)h2, 84, (U8*)hu);
memcpy(hx, hu, 20);
for (i = 999; i > 0; i--)
{
memcpy(&h1[16], hx, 20);
sharkssl_sha1((U8*)h1, 84, ph2);
sharkssl_sha1((U8*)h2, 84, (U8*)hx);
hu[0] ^= hx[0];
hu[1] ^= hx[1];
hu[2] ^= hx[2];
hu[3] ^= hx[3];
hu[4] ^= hx[4];
}
memcpy(kbuf + (k-1)*20, hu, 20);
if (icachealiases > (U16)(k*20))
{
k++;
goto _next_key_loop;
}
AllocatorIntf_free(o->alloc, h2);
AllocatorIntf_free(o->alloc, h1);
if (*(U16*)&o->inBuf[o->saltSize] != *(U16*)&kbuf[o->AESKeyLen*2])
{
AllocatorIntf_free(o->alloc, kbuf);
setError(IOINTF_WRONG_PASSWORD, 0, sffsdrnandflash, flushoffset);
if (pwdBin)
{
memset(p, 0, pwdLen);
AllocatorIntf_free(o->alloc, p);
}
return -1;
}
memcpy(o->AESKey, kbuf, o->AESKeyLen);
memcpy(o->AuthKey, kbuf + o->AESKeyLen, o->AESKeyLen);
AllocatorIntf_free(o->alloc, kbuf);
if (pwdBin)
{
memset(p, 0, pwdLen);
AllocatorIntf_free(o->alloc, p);
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43490F", "function_addr": 4409615, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+var_78], rdi"], [4, "mov [rbp+var_80], rsi"], [5, "mov eax, edx"], [6, "mov edx, ecx"], [7, "mov [rbp+var_90], r8"], [8, "mov [rbp+var_98], r9"], [9, "mov [rbp+var_84], ax"], [10, "mov eax, edx"], [11, "mov [rbp+var_88], al"], [12, "cmp [rbp+var_88], 0"], [13, "jz loc_434AC2"], [14, "movzx eax, [rbp+var_84]"], [15, "mov [rbp+var_38], rax"], [16, "mov rax, [rbp+var_78]"], [17, "mov rax, [rax+40h]"], [18, "mov rcx, [rax]"], [19, "mov rax, [rbp+var_78]"], [20, "mov rax, [rax+40h]"], [21, "lea rdx, [rbp+var_38]"], [22, "mov rsi, rdx"], [23, "mov rdi, rax"], [24, "call rcx"], [25, "mov [rbp+s], rax"], [26, "cmp [rbp+s], 0"], [27, "jnz short loc_43498F"], [28, "mov eax, 0FFFFFFFFh"], [29, "jmp locret_43506C"], [30, "mov [rbp+var_2], 0"], [31, "jmp loc_434AAF"], [32, "movzx edx, [rbp+var_2]"], [33, "mov rax, [rbp+var_80]"], [34, "add rax, rdx"], [35, "movzx eax, byte ptr [rax]"], [36, "and eax, 0Fh"], [37, "mov ecx, eax"], [38, "movzx edx, [rbp+var_2]"], [39, "mov rax, [rbp+var_80]"], [40, "add rax, rdx"], [41, "movzx eax, byte ptr [rax]"], [42, "shr al, 4"], [43, "lea edx, [rcx+rax]"], [44, "movzx ecx, [rbp+var_2]"], [45, "mov rax, [rbp+s]"], [46, "add rax, rcx"], [47, "add edx, 41h "], [48, "mov [rax], dl"], [49, "movzx edx, [rbp+var_2]"], [50, "mov rax, [rbp+var_80]"], [51, "add rax, rdx"], [52, "movzx eax, byte ptr [rax]"], [53, "movzx eax, al"], [54, "and eax, 1"], [55, "test eax, eax"], [56, "jz short loc_434A07"], [57, "movzx edx, [rbp+var_2]"], [58, "mov rax, [rbp+s]"], [59, "add rax, rdx"], [60, "movzx edx, byte ptr [rax]"], [61, "movzx ecx, [rbp+var_2]"], [62, "mov rax, [rbp+s]"], [63, "add rax, rcx"], [64, "add edx, 22h "], [65, "mov [rax], dl"], [66, "movzx edx, [rbp+var_2]"], [67, "mov rax, [rbp+s]"], [68, "add rax, rdx"], [69, "movzx eax, byte ptr [rax]"], [70, "cmp al, 40h "], [71, "jbe short loc_434A2B"], [72, "movzx edx, [rbp+var_2]"], [73, "mov rax, [rbp+s]"], [74, "add rax, rdx"], [75, "movzx eax, byte ptr [rax]"], [76, "cmp al, 57h "], [77, "jbe short loc_434A92"], [78, "movzx edx, [rbp+var_2]"], [79, "mov rax, [rbp+s]"], [80, "add rax, rdx"], [81, "movzx eax, byte ptr [rax]"], [82, "cmp al, 60h "], [83, "jbe short loc_434A4F"], [84, "movzx edx, [rbp+var_2]"], [85, "mov rax, [rbp+s]"], [86, "add rax, rdx"], [87, "movzx eax, byte ptr [rax]"], [88, "cmp al, 79h "], [89, "jbe short loc_434A92"], [90, "movzx edx, [rbp+var_2]"], [91, "mov rax, [rbp+var_80]"], [92, "add rax, rdx"], [93, "movzx eax, byte ptr [rax]"], [94, "and eax, 1Fh"], [95, "mov edx, eax"], [96, "movzx ecx, [rbp+var_2]"], [97, "mov rax, [rbp+s]"], [98, "add rax, rcx"], [99, "add edx, 62h "], [100, "mov [rax], dl"], [101, "jmp short loc_434A92"], [102, "movzx edx, [rbp+var_2]"], [103, "mov rax, [rbp+s]"], [104, "add rax, rdx"], [105, "movzx edx, byte ptr [rax]"], [106, "movzx ecx, [rbp+var_2]"], [107, "mov rax, [rbp+s]"], [108, "add rax, rcx"], [109, "sub edx, 9"], [110, "mov [rax], dl"], [111, "movzx edx, [rbp+var_2]"], [112, "mov rax, [rbp+s]"], [113, "add rax, rdx"], [114, "movzx eax, byte ptr [rax]"], [115, "cmp al, 78h "], [116, "ja short loc_434A74"], [117, "movzx eax, [rbp+var_2]"], [118, "add eax, 1"], [119, "mov [rbp+var_2], ax"], [120, "movzx eax, [rbp+var_2]"], [121, "cmp ax, [rbp+var_84]"], [122, "jb loc_43499A"], [123, "jmp short loc_434ACA"], [124, "mov rax, [rbp+var_80]"], [125, "mov [rbp+s], rax"], [126, "mov [rbp+var_38], 54h "], [127, "mov rax, [rbp+var_78]"], [128, "mov rax, [rax+40h]"], [129, "mov rcx, [rax]"], [130, "mov rax, [rbp+var_78]"], [131, "mov rax, [rax+40h]"], [132, "lea rdx, [rbp+var_38]"], [133, "mov rsi, rdx"], [134, "mov rdi, rax"], [135, "call rcx"], [136, "mov [rbp+dest], rax"], [137, "mov rax, [rbp+var_78]"], [138, "mov rax, [rax+40h]"], [139, "mov rcx, [rax]"], [140, "mov rax, [rbp+var_78]"], [141, "mov rax, [rax+40h]"], [142, "lea rdx, [rbp+var_38]"], [143, "mov rsi, rdx"], [144, "mov rdi, rax"], [145, "call rcx"], [146, "mov [rbp+var_20], rax"], [147, "mov rax, [rbp+var_78]"], [148, "movzx eax, byte ptr [rax+98h]"], [149, "movzx eax, al"], [150, "add eax, 1"], [151, "add eax, eax"], [152, "cdqe"], [153, "mov [rbp+var_38], rax"], [154, "mov rax, [rbp+var_38]"], [155, "add rax, 13h"], [156, "mov rdx, 0CCCCCCCCCCCCCCCDh"], [157, "mul rdx"], [158, "shr rdx, 4"], [159, "mov rax, rdx"], [160, "shl rax, 2"], [161, "add rax, rdx"], [162, "shl rax, 2"], [163, "mov [rbp+var_38], rax"], [164, "mov rax, [rbp+var_78]"], [165, "mov rax, [rax+40h]"], [166, "mov rcx, [rax]"], [167, "mov rax, [rbp+var_78]"], [168, "mov rax, [rax+40h]"], [169, "lea rdx, [rbp+var_38]"], [170, "mov rsi, rdx"], [171, "mov rdi, rax"], [172, "call rcx"], [173, "mov [rbp+var_28], rax"], [174, "cmp [rbp+dest], 0"], [175, "jz short loc_434B94"], [176, "cmp [rbp+var_20], 0"], [177, "jz short loc_434B94"], [178, "cmp [rbp+var_28], 0"], [179, "jnz short loc_434C02"], [180, "mov rdx, [rbp+var_98]"], [181, "mov rax, [rbp+var_90]"], [182, "mov rcx, rdx"], [183, "mov rdx, rax"], [184, "mov esi, 0"], [185, "mov edi, 0FFFFFFEDh"], [186, "call sub_4340BD"], [187, "cmp [rbp+var_88], 0"], [188, "jz short loc_434BF8"], [189, "movzx edx, [rbp+var_84]"], [190, "mov rax, [rbp+s]"], [191, "mov esi, 0"], [192, "mov rdi, rax"], [193, "call _memset"], [194, "mov rax, [rbp+var_78]"], [195, "mov rax, [rax+40h]"], [196, "mov rcx, [rax+10h]"], [197, "mov rax, [rbp+var_78]"], [198, "mov rax, [rax+40h]"], [199, "mov rdx, [rbp+s]"], [200, "mov rsi, rdx"], [201, "mov rdi, rax"], [202, "call rcx"], [203, "mov eax, 0FFFFFFFFh"], [204, "jmp locret_43506C"], [205, "mov rax, [rbp+dest]"], [206, "mov edx, 40h "], [207, "mov esi, 0"], [208, "mov rdi, rax"], [209, "call _memset"], [210, "mov rax, [rbp+var_20]"], [211, "mov edx, 40h "], [212, "mov esi, 0"], [213, "mov rdi, rax"], [214, "call _memset"], [215, "movzx edx, [rbp+var_84]"], [216, "mov rcx, [rbp+s]"], [217, "mov rax, [rbp+dest]"], [218, "mov rsi, rcx"], [219, "mov rdi, rax"], [220, "call _memcpy"], [221, "movzx edx, [rbp+var_84]"], [222, "mov rcx, [rbp+s]"], [223, "mov rax, [rbp+var_20]"], [224, "mov rsi, rcx"], [225, "mov rdi, rax"], [226, "call _memcpy"], [227, "mov [rbp+var_2], 0"], [228, "jmp short loc_434CD5"], [229, "movzx eax, [rbp+var_2]"], [230, "lea rdx, ds:0[rax*4]"], [231, "mov rax, [rbp+dest]"], [232, "add rax, rdx"], [233, "mov edx, [rax]"], [234, "movzx eax, [rbp+var_2]"], [235, "lea rcx, ds:0[rax*4]"], [236, "mov rax, [rbp+dest]"], [237, "add rax, rcx"], [238, "xor edx, 36363636h"], [239, "mov [rax], edx"], [240, "movzx eax, [rbp+var_2]"], [241, "lea rdx, ds:0[rax*4]"], [242, "mov rax, [rbp+var_20]"], [243, "add rax, rdx"], [244, "mov edx, [rax]"], [245, "movzx eax, [rbp+var_2]"], [246, "lea rcx, ds:0[rax*4]"], [247, "mov rax, [rbp+var_20]"], [248, "add rax, rcx"], [249, "xor edx, 5C5C5C5Ch"], [250, "mov [rax], edx"], [251, "movzx eax, [rbp+var_2]"], [252, "add eax, 1"], [253, "mov [rbp+var_2], ax"], [254, "movzx eax, [rbp+var_2]"], [255, "and eax, 10h"], [256, "test eax, eax"], [257, "jz short loc_434C6A"], [258, "mov rax, [rbp+var_20]"], [259, "add rax, 40h "], [260, "mov [rbp+var_30], rax"], [261, "mov [rbp+var_4], 1"], [262, "mov rax, [rbp+var_78]"], [263, "movzx eax, byte ptr [rax+99h]"], [264, "movzx eax, al"], [265, "mov rdx, [rbp+var_78]"], [266, "lea rsi, [rdx+120h]"], [267, "mov rdx, [rbp+dest]"], [268, "lea rcx, [rdx+40h]"], [269, "mov rdx, rax"], [270, "mov rdi, rcx"], [271, "call _memcpy"], [272, "movzx edx, [rbp+var_4]"], [273, "mov rax, [rbp+var_78]"], [274, "movzx eax, byte ptr [rax+99h]"], [275, "shr al, 2"], [276, "movzx eax, al"], [277, "add eax, 10h"], [278, "cdqe"], [279, "lea rcx, ds:0[rax*4]"], [280, "mov rax, [rbp+dest]"], [281, "add rax, rcx"], [282, "shl edx, 18h"], [283, "mov [rax], edx"], [284, "mov rax, [rbp+var_78]"], [285, "movzx eax, byte ptr [rax+99h]"], [286, "movzx eax, al"], [287, "add eax, 44h "], [288, "movzx ecx, ax"], [289, "mov rdx, [rbp+var_30]"], [290, "mov rax, [rbp+dest]"], [291, "mov esi, ecx"], [292, "mov rdi, rax"], [293, "call sub_44A62D"], [294, "lea rdx, [rbp+var_50]"], [295, "mov rax, [rbp+var_20]"], [296, "mov esi, 54h "], [297, "mov rdi, rax"], [298, "call sub_44A62D"], [299, "mov rax, [rbp+var_50]"], [300, "mov rdx, [rbp+var_48]"], [301, "mov [rbp+src], rax"], [302, "mov [rbp+var_68], rdx"], [303, "mov eax, [rbp+var_40]"], [304, "mov [rbp+var_60], eax"], [305, "mov [rbp+var_2], 3E7h"], [306, "jmp loc_434E30"], [307, "mov rax, [rbp+dest]"], [308, "lea rcx, [rax+40h]"], [309, "lea rax, [rbp+src]"], [310, "mov edx, 14h"], [311, "mov rsi, rax"], [312, "mov rdi, rcx"], [313, "call _memcpy"], [314, "mov rdx, [rbp+var_30]"], [315, "mov rax, [rbp+dest]"], [316, "mov esi, 54h "], [317, "mov rdi, rax"], [318, "call sub_44A62D"], [319, "lea rdx, [rbp+src]"], [320, "mov rax, [rbp+var_20]"], [321, "mov esi, 54h "], [322, "mov rdi, rax"], [323, "call sub_44A62D"], [324, "mov edx, dword ptr [rbp+var_50]"], [325, "mov eax, dword ptr [rbp+src]"], [326, "xor eax, edx"], [327, "mov dword ptr [rbp+var_50], eax"], [328, "mov edx, dword ptr [rbp+var_50+4]"], [329, "mov eax, dword ptr [rbp+src+4]"], [330, "xor eax, edx"], [331, "mov dword ptr [rbp+var_50+4], eax"], [332, "mov edx, dword ptr [rbp+var_48]"], [333, "mov eax, dword ptr [rbp+var_68]"], [334, "xor eax, edx"], [335, "mov dword ptr [rbp+var_48], eax"], [336, "mov edx, dword ptr [rbp+var_48+4]"], [337, "mov eax, dword ptr [rbp+var_68+4]"], [338, "xor eax, edx"], [339, "mov dword ptr [rbp+var_48+4], eax"], [340, "mov edx, [rbp+var_40]"], [341, "mov eax, [rbp+var_60]"], [342, "xor eax, edx"], [343, "mov [rbp+var_40], eax"], [344, "movzx eax, [rbp+var_2]"], [345, "sub eax, 1"], [346, "mov [rbp+var_2], ax"], [347, "cmp [rbp+var_2], 0"], [348, "jnz loc_434DA8"], [349, "movzx eax, [rbp+var_4]"], [350, "lea edx, [rax-1]"], [351, "mov eax, edx"], [352, "shl eax, 2"], [353, "add eax, edx"], [354, "shl eax, 2"], [355, "movsxd rdx, eax"], [356, "mov rax, [rbp+var_28]"], [357, "lea rcx, [rdx+rax]"], [358, "lea rax, [rbp+var_50]"], [359, "mov edx, 14h"], [360, "mov rsi, rax"], [361, "mov rdi, rcx"], [362, "call _memcpy"], [363, "movzx edx, [rbp+var_4]"], [364, "mov eax, edx"], [365, "shl eax, 2"], [366, "add eax, edx"], [367, "shl eax, 2"], [368, "movzx edx, ax"], [369, "mov rax, [rbp+var_38]"], [370, "cmp rdx, rax"], [371, "jnb short loc_434E95"], [372, "movzx eax, [rbp+var_4]"], [373, "add eax, 1"], [374, "mov [rbp+var_4], ax"], [375, "jmp loc_434CF2"], [376, "mov rax, [rbp+var_78]"], [377, "mov rax, [rax+40h]"], [378, "mov rcx, [rax+10h]"], [379, "mov rax, [rbp+var_78]"], [380, "mov rax, [rax+40h]"], [381, "mov rdx, [rbp+var_20]"], [382, "mov rsi, rdx"], [383, "mov rdi, rax"], [384, "call rcx"], [385, "mov rax, [rbp+var_78]"], [386, "mov rax, [rax+40h]"], [387, "mov rcx, [rax+10h]"], [388, "mov rax, [rbp+var_78]"], [389, "mov rax, [rax+40h]"], [390, "mov rdx, [rbp+dest]"], [391, "mov rsi, rdx"], [392, "mov rdi, rax"], [393, "call rcx"], [394, "mov rax, [rbp+var_78]"], [395, "movzx eax, byte ptr [rax+99h]"], [396, "movzx eax, al"], [397, "cdqe"], [398, "lea rdx, [rax+120h]"], [399, "mov rax, [rbp+var_78]"], [400, "add rax, rdx"], [401, "movzx edx, word ptr [rax]"], [402, "mov rax, [rbp+var_78]"], [403, "movzx eax, byte ptr [rax+98h]"], [404, "movzx eax, al"], [405, "add eax, eax"], [406, "movsxd rcx, eax"], [407, "mov rax, [rbp+var_28]"], [408, "add rax, rcx"], [409, "movzx eax, word ptr [rax]"], [410, "cmp dx, ax"], [411, "jz loc_434FAA"], [412, "mov rax, [rbp+var_78]"], [413, "mov rax, [rax+40h]"], [414, "mov rcx, [rax+10h]"], [415, "mov rax, [rbp+var_78]"], [416, "mov rax, [rax+40h]"], [417, "mov rdx, [rbp+var_28]"], [418, "mov rsi, rdx"], [419, "mov rdi, rax"], [420, "call rcx"], [421, "mov rdx, [rbp+var_98]"], [422, "mov rax, [rbp+var_90]"], [423, "mov rcx, rdx"], [424, "mov rdx, rax"], [425, "mov esi, 0"], [426, "mov edi, 0FFFFFF35h"], [427, "call sub_4340BD"], [428, "cmp [rbp+var_88], 0"], [429, "jz short loc_434FA0"], [430, "movzx edx, [rbp+var_84]"], [431, "mov rax, [rbp+s]"], [432, "mov esi, 0"], [433, "mov rdi, rax"], [434, "call _memset"], [435, "mov rax, [rbp+var_78]"], [436, "mov rax, [rax+40h]"], [437, "mov rcx, [rax+10h]"], [438, "mov rax, [rbp+var_78]"], [439, "mov rax, [rax+40h]"], [440, "mov rdx, [rbp+s]"], [441, "mov rsi, rdx"], [442, "mov rdi, rax"], [443, "call rcx"], [444, "mov eax, 0FFFFFFFFh"], [445, "jmp locret_43506C"], [446, "mov rax, [rbp+var_78]"], [447, "movzx eax, byte ptr [rax+98h]"], [448, "movzx edx, al"], [449, "mov rax, [rbp+var_78]"], [450, "lea rcx, [rax+58h]"], [451, "mov rax, [rbp+var_28]"], [452, "mov rsi, rax"], [453, "mov rdi, rcx"], [454, "call _memcpy"], [455, "mov rax, [rbp+var_78]"], [456, "movzx eax, byte ptr [rax+98h]"], [457, "movzx eax, al"], [458, "mov rdx, [rbp+var_78]"], [459, "movzx edx, byte ptr [rdx+98h]"], [460, "movzx ecx, dl"], [461, "mov rdx, [rbp+var_28]"], [462, "lea rsi, [rcx+rdx]"], [463, "mov rdx, [rbp+var_78]"], [464, "lea rcx, [rdx+78h]"], [465, "mov rdx, rax"], [466, "mov rdi, rcx"], [467, "call _memcpy"], [468, "mov rax, [rbp+var_78]"], [469, "mov rax, [rax+40h]"], [470, "mov rcx, [rax+10h]"], [471, "mov rax, [rbp+var_78]"], [472, "mov rax, [rax+40h]"], [473, "mov rdx, [rbp+var_28]"], [474, "mov rsi, rdx"], [475, "mov rdi, rax"], [476, "call rcx"], [477, "cmp [rbp+var_88], 0"], [478, "jz short loc_435067"], [479, "movzx edx, [rbp+var_84]"], [480, "mov rax, [rbp+s]"], [481, "mov esi, 0"], [482, "mov rdi, rax"], [483, "call _memset"], [484, "mov rax, [rbp+var_78]"], [485, "mov rax, [rax+40h]"], [486, "mov rcx, [rax+10h]"], [487, "mov rax, [rbp+var_78]"], [488, "mov rax, [rax+40h]"], [489, "mov rdx, [rbp+s]"], [490, "mov rsi, rdx"], [491, "mov rdi, rax"], [492, "call rcx"], [493, "mov eax, 0"], [494, "leave"], [495, "retn"]], "data_dep": [[9, 5], [10, 6], [11, 10], [12, 11], [13, 12], [14, 9], [15, 14], [16, 3], [17, 16], [18, 17], [19, 3], [20, 19], [21, 6], [21, 15], [22, 21], [23, 20], [24, 18], [25, 24], [26, 25], [27, 26], [32, 30], [32, 119], [33, 4], [34, 33], [34, 32], [35, 65], [35, 110], [35, 100], [35, 48], [35, 34], [36, 35], [37, 36], [38, 30], [38, 119], [39, 4], [40, 39], [40, 38], [41, 110], [41, 40], [41, 100], [41, 48], [41, 65], [42, 41], [43, 110], [43, 100], [43, 48], [43, 38], [43, 65], [43, 42], [44, 30], [44, 119], [45, 25], [46, 45], [46, 44], [47, 43], [48, 47], [48, 46], [49, 30], [49, 119], [50, 4], [51, 50], [51, 49], [52, 51], [52, 48], [53, 52], [54, 53], [55, 54], [56, 55], [57, 30], [57, 119], [58, 25], [59, 58], [59, 57], [60, 110], [60, 59], [60, 48], [60, 100], [60, 65], [61, 30], [61, 119], [62, 25], [63, 61], [63, 62], [64, 60], [65, 64], [65, 63], [66, 30], [66, 119], [67, 25], [68, 67], [68, 66], [69, 48], [69, 65], [69, 110], [69, 68], [69, 100], [70, 69], [71, 70], [72, 119], [72, 30], [73, 25], [74, 73], [74, 72], [75, 110], [75, 100], [75, 48], [75, 65], [75, 74], [76, 75], [77, 76], [78, 30], [78, 119], [79, 25], [80, 79], [80, 78], [81, 100], [81, 48], [81, 80], [81, 65], [81, 110], [82, 81], [83, 82], [84, 30], [84, 119], [85, 25], [86, 85], [86, 84], [87, 110], [87, 100], [87, 86], [87, 48], [87, 65], [88, 87], [89, 88], [90, 30], [90, 119], [91, 4], [92, 91], [92, 90], [93, 65], [93, 92], [93, 110], [93, 100], [93, 48], [94, 93], [95, 94], [96, 119], [96, 30], [97, 25], [98, 97], [98, 96], [99, 95], [100, 99], [100, 98], [102, 119], [102, 30], [103, 25], [104, 102], [104, 103], [105, 100], [105, 104], [105, 48], [105, 65], [105, 110], [106, 119], [106, 30], [107, 25], [108, 107], [108, 106], [109, 105], [110, 109], [110, 108], [111, 119], [111, 30], [112, 25], [113, 112], [113, 111], [114, 110], [114, 100], [114, 48], [114, 113], [114, 65], [115, 114], [116, 115], [117, 119], [117, 30], [118, 117], [119, 118], [120, 30], [120, 119], [121, 9], [121, 120], [122, 121], [124, 4], [125, 124], [127, 3], [128, 110], [128, 100], [128, 48], [128, 127], [128, 65], [129, 128], [129, 65], [129, 110], [129, 100], [129, 48], [130, 3], [131, 65], [131, 130], [131, 110], [131, 100], [131, 48], [132, 6], [132, 126], [132, 111], [132, 21], [133, 132], [134, 131], [135, 129], [136, 135], [137, 3], [138, 110], [138, 100], [138, 48], [138, 137], [138, 65], [139, 138], [139, 110], [139, 100], [139, 48], [139, 65], [140, 3], [141, 110], [141, 100], [141, 48], [141, 140], [141, 65], [142, 126], [142, 132], [143, 142], [144, 141], [145, 139], [146, 145], [147, 3], [148, 65], [148, 147], [148, 110], [148, 100], [148, 48], [149, 148], [150, 149], [151, 150], [153, 151], [154, 153], [155, 154], [157, 156], [158, 157], [159, 158], [160, 159], [161, 158], [161, 160], [162, 161], [163, 162], [164, 3], [165, 48], [165, 164], [165, 65], [165, 110], [165, 100], [166, 110], [166, 100], [166, 165], [166, 48], [166, 65], [167, 3], [168, 100], [168, 48], [168, 65], [168, 167], [168, 110], [169, 163], [169, 158], [170, 169], [171, 168], [172, 166], [173, 172], [174, 136], [175, 174], [176, 146], [177, 176], [178, 173], [179, 178], [180, 8], [181, 7], [182, 180], [183, 181], [187, 11], [188, 187], [189, 9], [190, 25], [190, 125], [192, 190], [194, 3], [195, 100], [195, 48], [195, 65], [195, 194], [195, 110], [196, 110], [196, 100], [196, 48], [196, 65], [196, 195], [197, 3], [198, 100], [198, 197], [198, 48], [198, 65], [198, 110], [199, 125], [199, 25], [200, 199], [201, 198], [202, 196], [205, 136], [208, 205], [210, 146], [213, 210], [215, 9], [216, 125], [216, 25], [217, 136], [218, 216], [219, 217], [221, 9], [222, 25], [222, 125], [223, 146], [224, 222], [225, 223], [229, 227], [229, 253], [230, 249], [230, 221], [231, 136], [232, 231], [232, 230], [233, 100], [233, 239], [233, 48], [233, 232], [233, 65], [233, 250], [233, 110], [234, 227], [234, 253], [235, 246], [235, 222], [236, 136], [237, 236], [237, 235], [238, 233], [239, 238], [239, 237], [240, 227], [240, 253], [241, 238], [242, 146], [243, 242], [243, 241], [244, 239], [244, 243], [245, 253], [245, 227], [246, 235], [247, 146], [248, 247], [248, 246], [249, 244], [250, 249], [250, 248], [251, 227], [251, 253], [252, 251], [253, 252], [254, 227], [254, 253], [255, 254], [256, 255], [257, 256], [258, 146], [259, 258], [260, 259], [262, 3], [263, 100], [263, 239], [263, 48], [263, 262], [263, 65], [263, 283], [263, 250], [263, 110], [264, 263], [265, 3], [266, 250], [266, 110], [266, 100], [266, 239], [266, 360], [266, 48], [266, 265], [266, 224], [266, 65], [266, 283], [267, 136], [268, 48], [268, 246], [268, 250], [268, 65], [268, 357], [268, 222], [268, 283], [268, 110], [268, 267], [268, 100], [268, 239], [269, 264], [270, 268], [272, 374], [272, 261], [273, 3], [274, 100], [274, 239], [274, 48], [274, 65], [274, 283], [274, 273], [274, 250], [274, 110], [275, 274], [276, 275], [277, 276], [279, 268], [280, 136], [281, 280], [281, 279], [282, 272], [283, 282], [283, 281], [284, 3], [285, 284], [285, 283], [286, 285], [287, 286], [288, 287], [289, 260], [290, 136], [291, 288], [292, 290], [294, 327], [294, 289], [295, 146], [297, 295], [299, 327], [300, 335], [301, 299], [302, 300], [303, 343], [304, 303], [307, 136], [308, 250], [308, 65], [308, 283], [308, 110], [308, 100], [308, 239], [308, 48], [308, 308], [308, 307], [308, 288], [309, 307], [309, 301], [311, 309], [312, 308], [314, 260], [315, 136], [317, 315], [319, 301], [319, 314], [320, 146], [322, 320], [324, 327], [325, 301], [326, 325], [326, 324], [327, 326], [328, 331], [330, 329], [330, 328], [331, 330], [332, 335], [333, 302], [334, 332], [334, 333], [335, 334], [336, 339], [338, 337], [338, 336], [339, 338], [340, 343], [341, 304], [342, 341], [342, 340], [343, 342], [344, 305], [344, 346], [345, 344], [346, 345], [347, 346], [347, 305], [348, 347], [349, 261], [349, 374], [350, 100], [350, 239], [350, 48], [350, 340], [350, 283], [350, 349], [350, 250], [350, 65], [350, 300], [350, 110], [351, 350], [352, 351], [353, 350], [353, 352], [354, 353], [355, 354], [356, 173], [357, 250], [357, 110], [357, 100], [357, 356], [357, 239], [357, 48], [357, 308], [357, 65], [357, 288], [357, 283], [358, 327], [358, 356], [360, 358], [361, 357], [363, 261], [363, 374], [364, 363], [365, 364], [366, 363], [366, 365], [367, 366], [368, 367], [369, 163], [370, 369], [370, 368], [371, 370], [372, 374], [372, 261], [373, 372], [374, 373], [376, 3], [377, 65], [377, 283], [377, 376], [377, 250], [377, 110], [377, 100], [377, 48], [377, 239], [378, 100], [378, 239], [378, 48], [378, 65], [378, 283], [378, 377], [378, 250], [378, 110], [379, 3], [380, 379], [380, 100], [380, 239], [380, 65], [380, 283], [380, 250], [380, 110], [380, 48], [381, 146], [382, 381], [383, 380], [384, 378], [385, 3], [386, 48], [386, 239], [386, 65], [386, 283], [386, 385], [386, 250], [386, 110], [386, 100], [387, 283], [387, 386], [387, 250], [387, 110], [387, 100], [387, 48], [387, 239], [387, 65], [388, 3], [389, 388], [389, 100], [389, 239], [389, 48], [389, 65], [389, 283], [389, 250], [389, 110], [390, 136], [391, 390], [392, 389], [393, 387], [394, 3], [395, 394], [395, 250], [395, 110], [395, 100], [395, 239], [395, 48], [395, 65], [395, 283], [396, 395], [398, 283], [398, 390], [398, 250], [398, 110], [398, 100], [398, 48], [398, 239], [398, 396], [398, 65], [399, 3], [400, 398], [400, 399], [401, 65], [401, 400], [401, 283], [401, 250], [401, 110], [401, 48], [401, 100], [401, 239], [402, 3], [403, 250], [403, 110], [403, 100], [403, 48], [403, 402], [403, 239], [403, 65], [403, 283], [404, 403], [405, 404], [406, 405], [407, 173], [408, 407], [408, 406], [409, 283], [409, 250], [409, 110], [409, 408], [409, 100], [409, 239], [409, 48], [409, 65], [410, 401], [410, 409], [411, 410], [412, 3], [413, 412], [413, 48], [413, 239], [413, 65], [413, 283], [413, 250], [413, 110], [413, 100], [414, 413], [414, 250], [414, 110], [414, 100], [414, 239], [414, 48], [414, 65], [414, 283], [415, 3], [416, 48], [416, 100], [416, 239], [416, 65], [416, 415], [416, 283], [416, 250], [416, 110], [417, 173], [418, 417], [419, 416], [420, 414], [421, 8], [422, 7], [423, 421], [424, 422], [428, 11], [429, 428], [430, 9], [431, 125], [431, 25], [433, 431], [435, 3], [436, 283], [436, 250], [436, 110], [436, 100], [436, 435], [436, 48], [436, 239], [436, 65], [437, 239], [437, 65], [437, 436], [437, 283], [437, 250], [437, 110], [437, 100], [437, 48], [438, 3], [439, 438], [439, 65], [439, 283], [439, 250], [439, 110], [439, 100], [439, 48], [439, 239], [440, 125], [440, 25], [441, 440], [442, 439], [443, 437], [446, 3], [447, 446], [447, 283], [447, 250], [447, 110], [447, 100], [447, 48], [447, 239], [447, 65], [448, 447], [449, 3], [450, 65], [450, 283], [450, 250], [450, 110], [450, 100], [450, 449], [450, 48], [450, 406], [450, 239], [451, 173], [452, 451], [453, 450], [455, 3], [456, 65], [456, 455], [456, 283], [456, 250], [456, 110], [456, 100], [456, 239], [456, 48], [457, 456], [458, 3], [459, 239], [459, 65], [459, 283], [459, 250], [459, 110], [459, 100], [459, 458], [459, 48], [460, 459], [461, 173], [462, 48], [462, 239], [462, 452], [462, 65], [462, 460], [462, 283], [462, 250], [462, 110], [462, 100], [463, 3], [464, 65], [464, 460], [464, 283], [464, 250], [464, 110], [464, 100], [464, 463], [464, 48], [464, 239], [465, 457], [466, 464], [468, 3], [469, 65], [469, 283], [469, 250], [469, 110], [469, 100], [469, 468], [469, 239], [469, 48], [470, 48], [470, 65], [470, 469], [470, 283], [470, 250], [470, 110], [470, 100], [470, 239], [471, 3], [472, 471], [472, 65], [472, 283], [472, 250], [472, 110], [472, 100], [472, 48], [472, 239], [473, 173], [474, 473], [475, 472], [476, 470], [477, 11], [478, 477], [479, 9], [480, 125], [480, 25], [482, 480], [484, 3], [485, 283], [485, 250], [485, 110], [485, 100], [485, 48], [485, 239], [485, 484], [485, 65], [486, 485], [486, 65], [486, 283], [486, 250], [486, 110], [486, 100], [486, 239], [486, 48], [487, 3], [488, 65], [488, 283], [488, 250], [488, 110], [488, 487], [488, 100], [488, 48], [488, 239], [489, 25], [489, 125], [490, 489], [491, 488], [492, 486], [495, 203], [495, 444], [495, 493], [495, 28]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_43490F", "query": "\n\n\n__int64 __fastcall sub_43490F(__int64 a1, _BYTE *a2, unsigned __int16 a3, char a4, _DWORD *a5, _QWORD *a6)\n{\n__int64 result; // rax\n__int64 src; // [rsp+30h] [rbp-70h] BYREF\n__int64 v12; // [rsp+38h] [rbp-68h]\nint v13; // [rsp+40h] [rbp-60h]\n__int64 v14; // [rsp+50h] [rbp-50h] BYREF\n__int64 v15; // [rsp+58h] [rbp-48h]\nint v16; // [rsp+60h] [rbp-40h]\nunsigned __int64 v17; // [rsp+68h] [rbp-38h] BYREF\n__int64 v18; // [rsp+70h] [rbp-30h]\nvoid *v19; // [rsp+78h] [rbp-28h]\nvoid *v20; // [rsp+80h] [rbp-20h]\nvoid *dest; // [rsp+88h] [rbp-18h]\nvoid *s; // [rsp+90h] [rbp-10h]\nunsigned __int16 j; // [rsp+9Ch] [rbp-4h]\nunsigned __int16 i; // [rsp+9Eh] [rbp-2h]\n\nif ( a4 )\n{\nv17 = a3;\ns = (void *)(**(__int64 (__fastcall ***)(_QWORD, unsigned __int64 *))(a1 + 64))(*(_QWORD *)(a1 + 64), &v17);\nif ( !s )\nreturn 0xFFFFFFFFLL;\nfor ( i = 0; i < a3; ++i )\n{\n*((_BYTE *)s + i) = (a2[i] & 0xF) + (a2[i] >> 4) + 65;\nif ( (a2[i] & 1) != 0 )\n*((_BYTE *)s + i) += 34;\nif ( (*((_BYTE *)s + i) <= 0x40u || *((_BYTE *)s + i) > 0x57u)\n&& (*((_BYTE *)s + i) <= 0x60u || *((_BYTE *)s + i) > 0x79u) )\n{\n*((_BYTE *)s + i) = (a2[i] & 0x1F) + 98;\n}\nwhile ( *((_BYTE *)s + i) > 0x78u )\n*((_BYTE *)s + i) -= 9;\n}\n}\nelse\n{\ns = a2;\n}\nv17 = 84LL;\ndest = (void *)(**(__int64 (__fastcall ***)(_QWORD, unsigned __int64 *))(a1 + 64))(*(_QWORD *)(a1 + 64), &v17);\nv20 = (void *)(**(__int64 (__fastcall ***)(_QWORD, unsigned __int64 *))(a1 + 64))(*(_QWORD *)(a1 + 64), &v17);\nv17 = 2 * (*(unsigned __int8 *)(a1 + 152) + 1);\nv17 = 20 * ((v17 + 19) / 0x14);\nv19 = (void *)(**(__int64 (__fastcall ***)(_QWORD, unsigned __int64 *))(a1 + 64))(*(_QWORD *)(a1 + 64), &v17);\nif ( dest && v20 && v19 )\n{\nmemset(dest, 0, 0x40uLL);\nmemset(v20, 0, 0x40uLL);\nmemcpy(dest, s, a3);\nmemcpy(v20, s, a3);\nfor ( i = 0; (i & 0x10) == 0; ++i )\n{\n*((_DWORD *)dest + i) ^= 0x36363636u;\n*((_DWORD *)v20 + i) ^= 0x5C5C5C5Cu;\n}\nv18 = (__int64)v20 + 64;\nfor ( j = 1; ; ++j )\n{\nmemcpy((char *)dest + 64, (const void *)(a1 + 288), *(unsigned __int8 *)(a1 + 153));\n*((_DWORD *)dest + (*(_BYTE *)(a1 + 153) >> 2) + 16) = j << 24;\nsub_44A62D(dest, (unsigned __int16)(*(unsigned __int8 *)(a1 + 153) + 68), v18);\nsub_44A62D(v20, 84LL, &v14);\nsrc = v14;\nv12 = v15;\nv13 = v16;\nfor ( i = 999; i; --i )\n{\nmemcpy((char *)dest + 64, &src, 0x14uLL);\nsub_44A62D(dest, 84LL, v18);\nsub_44A62D(v20, 84LL, &src);\nv14 ^= src;\nv15 ^= v12;\nv16 ^= v13;\n}\nmemcpy((char *)v19 + 20 * j - 20, &v14, 0x14uLL);\nif ( (unsigned __int16)(20 * j) >= v17 )\nbreak;\n}\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), v20);\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), dest);\nif ( *(_WORD *)(*(unsigned __int8 *)(a1 + 153) + 288LL + a1) == *((_WORD *)v19 + *(unsigned __int8 *)(a1 + 152)) )\n{\nmemcpy((void *)(a1 + 88), v19, *(unsigned __int8 *)(a1 + 152));\nmemcpy((void *)(a1 + 120), (char *)v19 + *(unsigned __int8 *)(a1 + 152), *(unsigned __int8 *)(a1 + 152));\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), v19);\nif ( a4 )\n{\nmemset(s, 0, a3);\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), s);\n}\nresult = 0LL;\n}\nelse\n{\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), v19);\nsub_4340BD(-203, 0LL, a5, a6);\nif ( a4 )\n{\nmemset(s, 0, a3);\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), s);\n}\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nsub_4340BD(-19, 0LL, a5, a6);\nif ( a4 )\n{\nmemset(s, 0, a3);\n(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)(a1 + 64) + 16LL))(*(_QWORD *)(a1 + 64), s);\n}\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,src,v14,v17,v18,v19,v20,dest,s,sub_43490F,sub_44A62D,sub_4340BD,]", "hints": "[]", "response": "{'a3': 'pwdLen', 'a4': 'pwdBin', 'a1': 'o', 'a2': 'pwd', 'a5': 'sffsdrnandflash', 'a6': 'flushoffset', 'src': 'hx', 'v14': 'hu', 'v17': 'icachealiases', 'v18': 'ph2', 'v19': 'kbuf', 'v20': 'h2', 'dest': 'h1', 's': 'p', 'sub_43490F': 'ZipResDecrypt_keyCalc', 'sub_44A62D': 'sharkssl_sha1', 'sub_4340BD': 'setError'}"} | [
[
0.7798494100570679,
0.7569496631622314,
0.7430363297462463,
0.7400901317596436,
0.729430079460144,
0.7277970910072327,
0.7210530042648315,
0.7161968946456909,
0.714326798915863,
0.7013466358184814,
0.6985229253768921,
0.697126030921936,
0.6969578862190247,
0.6932386159896851,
0.6896755695343018,
0.6896567344665527,
0.6895996332168579,
0.6895996332168579,
0.6872655749320984,
0.6859645843505859
],
[
124921,
253221,
79030,
50969,
7495,
259696,
18482,
204501,
210440,
181023,
84721,
217526,
22881,
137603,
110707,
97314,
48729,
32734,
18493,
21329
]
] |
|
set_data_type | 4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a | embecosm | mibench | NA | local void set_data_type(s)
deflate_state *s;
{
int n = 0;
unsigned ascii_freq = 0;
unsigned bin_freq = 0;
while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41C7FB", "function_addr": 4311035, "binary_name": "4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_4], 0"], [4, "mov [rbp+var_8], 0"], [5, "mov [rbp+var_C], 0"], [6, "jmp short loc_41C838"], [7, "mov eax, [rbp+var_4]"], [8, "lea edx, [rax+1]"], [9, "mov [rbp+var_4], edx"], [10, "mov rdx, [rbp+var_18]"], [11, "cdqe"], [12, "add rax, 2Ch "], [13, "movzx eax, word ptr [rdx+rax*4+4]"], [14, "movzx eax, ax"], [15, "add [rbp+var_C], eax"], [16, "cmp [rbp+var_4], 6"], [17, "jle short loc_41C81A"], [18, "jmp short loc_41C85E"], [19, "mov eax, [rbp+var_4]"], [20, "lea edx, [rax+1]"], [21, "mov [rbp+var_4], edx"], [22, "mov rdx, [rbp+var_18]"], [23, "cdqe"], [24, "add rax, 2Ch "], [25, "movzx eax, word ptr [rdx+rax*4+4]"], [26, "movzx eax, ax"], [27, "add [rbp+var_8], eax"], [28, "cmp [rbp+var_4], 7Fh"], [29, "jle short loc_41C840"], [30, "jmp short loc_41C884"], [31, "mov eax, [rbp+var_4]"], [32, "lea edx, [rax+1]"], [33, "mov [rbp+var_4], edx"], [34, "mov rdx, [rbp+var_18]"], [35, "cdqe"], [36, "add rax, 2Ch "], [37, "movzx eax, word ptr [rdx+rax*4+4]"], [38, "movzx eax, ax"], [39, "add [rbp+var_C], eax"], [40, "cmp [rbp+var_4], 0FFh"], [41, "jle short loc_41C866"], [42, "mov eax, [rbp+var_8]"], [43, "shr eax, 2"], [44, "cmp [rbp+var_C], eax"], [45, "setbe al"], [46, "movzx eax, al"], [47, "mov edx, eax"], [48, "mov rax, [rbp+var_18]"], [49, "mov [rax+28h], dl"], [50, "nop"], [51, "pop rbp"], [52, "retn"]], "data_dep": [[7, 3], [7, 9], [8, 7], [8, 10], [9, 8], [10, 2], [12, 7], [13, 12], [14, 13], [15, 5], [15, 14], [15, 15], [16, 3], [16, 9], [17, 16], [19, 3], [19, 9], [19, 21], [20, 10], [20, 19], [20, 22], [21, 20], [22, 2], [24, 19], [25, 24], [26, 25], [27, 4], [27, 27], [27, 26], [28, 3], [28, 9], [28, 21], [29, 28], [31, 3], [31, 9], [31, 21], [31, 33], [32, 31], [32, 34], [32, 10], [32, 22], [33, 32], [34, 2], [36, 31], [37, 36], [38, 37], [39, 39], [39, 5], [39, 38], [39, 15], [40, 3], [40, 9], [40, 21], [40, 33], [41, 40], [42, 4], [42, 27], [43, 42], [44, 39], [44, 5], [44, 43], [44, 15], [45, 43], [45, 44], [46, 45], [47, 46], [48, 2], [49, 47], [49, 48], [51, 0], [52, 48]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a_4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a.jsonl.gz", "strip_func_name": "sub_41C7FB", "query": "\n\n\n__int64 __fastcall sub_41C7FB(__int64 a1)\n{\nint v1; // eax\nint v2; // eax\nint v3; // eax\n__int64 result; // rax\nunsigned int v5; // [rsp+Ch] [rbp-Ch]\nunsigned int v6; // [rsp+10h] [rbp-8h]\nint v7; // [rsp+14h] [rbp-4h]\n\nv7 = 0;\nv6 = 0;\nv5 = 0;\nwhile ( v7 <= 6 )\n{\nv1 = v7++;\nv5 += *(unsigned __int16 *)(a1 + 4 * (v1 + 44LL) + 4);\n}\nwhile ( v7 <= 127 )\n{\nv2 = v7++;\nv6 += *(unsigned __int16 *)(a1 + 4 * (v2 + 44LL) + 4);\n}\nwhile ( v7 <= 255 )\n{\nv3 = v7++;\nv5 += *(unsigned __int16 *)(a1 + 4 * (v3 + 44LL) + 4);\n}\nresult = a1;\n*(_BYTE *)(a1 + 40) = v5 <= v6 >> 2;\nreturn result;\n}\n\n\n\nQ:[a1,v5,v6,v7,sub_41C7FB,]", "hints": "[]", "response": "{'a1': 's', 'v5': 'bin_freq', 'v6': 'ascii_freq', 'v7': 'n', 'sub_41C7FB': 'set_data_type'}"} | [
[
0.8038843274116516,
0.7873254418373108,
0.7870391011238098,
0.773496687412262,
0.7628061175346375,
0.7396297454833984,
0.736204206943512,
0.7338980436325073,
0.7323892116546631,
0.7310695052146912,
0.715865433216095,
0.7126402258872986,
0.7084457278251648,
0.707590639591217,
0.7032792568206787,
0.7024427652359009,
0.7019405364990234,
0.7018137574195862,
0.6996617913246155,
0.6977576017379761
],
[
189891,
73346,
249219,
210549,
231864,
139737,
141131,
196674,
124192,
79503,
84483,
30723,
184820,
261733,
150383,
50804,
158657,
100203,
1289,
93263
]
] |
|
array_add | 4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370 | kgabis | raytracer | NA | int array_add(Array *a, void *item) {
void *reallocPtr;
unsigned int newCapacity, memOffset;
if (a->count >= a->capacity) {
newCapacity = a->capacity * 2;
reallocPtr = realloc(a->items, newCapacity * a->itemSize);
if (reallocPtr == NULL) {
return 0;
}
a->items = reallocPtr;
a->capacity = newCapacity;
}
memOffset = (a->count * a->itemSize);
memmove(a->items + memOffset, item, a->itemSize);
a->count++;
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401390", "function_addr": 4199312, "binary_name": "4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "mov [rbp+src], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov edx, [rax+0Ch]"], [7, "mov rax, [rbp+var_28]"], [8, "mov eax, [rax+10h]"], [9, "cmp edx, eax"], [10, "jb short loc_401404"], [11, "mov rax, [rbp+var_28]"], [12, "mov eax, [rax+10h]"], [13, "add eax, eax"], [14, "mov [rbp+var_4], eax"], [15, "mov rax, [rbp+var_28]"], [16, "mov eax, [rax+8]"], [17, "imul eax, [rbp+var_4]"], [18, "mov edx, eax"], [19, "mov rax, [rbp+var_28]"], [20, "mov rax, [rax]"], [21, "mov rsi, rdx"], [22, "mov rdi, rax"], [23, "call _realloc"], [24, "mov [rbp+var_10], rax"], [25, "cmp [rbp+var_10], 0"], [26, "jnz short loc_4013EF"], [27, "mov eax, 0"], [28, "jmp short locret_401453"], [29, "mov rax, [rbp+var_28]"], [30, "mov rdx, [rbp+var_10]"], [31, "mov [rax], rdx"], [32, "mov rax, [rbp+var_28]"], [33, "mov edx, [rbp+var_4]"], [34, "mov [rax+10h], edx"], [35, "mov rax, [rbp+var_28]"], [36, "mov edx, [rax+0Ch]"], [37, "mov rax, [rbp+var_28]"], [38, "mov eax, [rax+8]"], [39, "imul eax, edx"], [40, "mov [rbp+var_14], eax"], [41, "mov rax, [rbp+var_28]"], [42, "mov eax, [rax+8]"], [43, "mov edx, eax"], [44, "mov rax, [rbp+var_28]"], [45, "mov rcx, [rax]"], [46, "mov eax, [rbp+var_14]"], [47, "add rcx, rax"], [48, "mov rax, [rbp+src]"], [49, "mov rsi, rax"], [50, "mov rdi, rcx"], [51, "call _memmove"], [52, "mov rax, [rbp+var_28]"], [53, "mov eax, [rax+0Ch]"], [54, "lea edx, [rax+1]"], [55, "mov rax, [rbp+var_28]"], [56, "mov [rax+0Ch], edx"], [57, "mov eax, 1"], [58, "leave"], [59, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 3], [8, 7], [9, 8], [9, 6], [10, 9], [11, 3], [12, 11], [13, 12], [14, 13], [15, 3], [16, 15], [17, 14], [17, 16], [18, 17], [19, 3], [20, 19], [21, 18], [22, 20], [24, 23], [25, 24], [26, 25], [29, 3], [30, 24], [31, 29], [31, 30], [32, 3], [33, 14], [34, 33], [34, 32], [35, 3], [36, 56], [36, 31], [36, 34], [36, 35], [37, 3], [38, 56], [38, 31], [38, 37], [38, 34], [39, 36], [39, 38], [40, 39], [41, 3], [42, 41], [42, 56], [42, 31], [42, 34], [43, 42], [44, 3], [45, 31], [45, 34], [45, 44], [45, 56], [46, 40], [47, 46], [47, 45], [48, 4], [49, 48], [50, 47], [52, 3], [53, 56], [53, 34], [53, 31], [53, 52], [54, 43], [54, 34], [54, 31], [54, 56], [54, 53], [55, 3], [56, 55], [56, 54], [59, 27], [59, 57]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370_4a6e4fff426f3a48d28ebec9459c5547a9469ffca56d083dfa86d6206e6b0370.jsonl.gz", "strip_func_name": "sub_401390", "query": "\n\n\n__int64 __fastcall sub_401390(__int64 a1, const void *a2)\n{\nvoid *v3; // [rsp+20h] [rbp-10h]\nint v4; // [rsp+2Ch] [rbp-4h]\n\nif ( *(_DWORD *)(a1 + 12) >= *(_DWORD *)(a1 + 16) )\n{\nv4 = 2 * *(_DWORD *)(a1 + 16);\nv3 = realloc(*(void **)a1, (unsigned int)(v4 * *(_DWORD *)(a1 + 8)));\nif ( !v3 )\nreturn 0LL;\n*(_QWORD *)a1 = v3;\n*(_DWORD *)(a1 + 16) = v4;\n}\nmemmove(\n(void *)((unsigned int)(*(_DWORD *)(a1 + 12) * *(_DWORD *)(a1 + 8)) + *(_QWORD *)a1),\na2,\n*(unsigned int *)(a1 + 8));\n++*(_DWORD *)(a1 + 12);\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v3,v4,sub_401390,]", "hints": "[]", "response": "{'a1': 'a', 'a2': 'item', 'v3': 'reallocPtr', 'v4': 'newCapacity', 'sub_401390': 'array_add'}"} | [
[
0.7572891712188721,
0.73651123046875,
0.7247710227966309,
0.722240149974823,
0.7222130298614502,
0.7183333039283752,
0.7161183953285217,
0.7149659991264343,
0.7127466201782227,
0.7108783721923828,
0.7096123695373535,
0.7075233459472656,
0.7057512998580933,
0.7055680751800537,
0.7054618000984192,
0.7052311301231384,
0.7035416960716248,
0.7012352347373962,
0.7008586525917053,
0.6986424922943115
],
[
208739,
142816,
228138,
136101,
68671,
173276,
209931,
233079,
237089,
149184,
78706,
27527,
42541,
112113,
9824,
160079,
44813,
17066,
6,
153897
]
] |
|
pty_open | dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b | lavabit | pahoehoe | NA | int pty_open(int *pty_user_fd, int *pty_process_fd, char *pty_device_name, size_t pty_device_name_size, const struct termios *pty_device_termios, const struct winsize *pty_device_winsize)
{
struct termios pty_user_termios[1];
#if defined(HAVE_OPENPTY) || defined(BSD4_4)
/* openpty(3) exists in OSF/1 and some other os'es */
#ifdef HAVE_TTYNAME_R
char buf[64], *name = buf;
int err;
#else
char *name;
#endif
if (!pty_user_fd || !pty_process_fd || !pty_device_name || pty_device_name_size < 64)
return set_errno(EINVAL);
/* Open both pty descriptors, set ownership and permissions */
if (openpty(pty_user_fd, pty_process_fd, NULL, NULL, NULL) == -1)
return -1;
/* Retrieve the device name of the process side of the pty */
#ifdef HAVE_TTYNAME_R
if ((err = ttyname_r(*pty_process_fd, buf, 64)))
{
close(*pty_user_fd);
close(*pty_process_fd);
return set_errno(err);
}
#else
if (!(name = ttyname(*pty_process_fd)))
{
close(*pty_user_fd);
close(*pty_process_fd);
return set_errno(ENOTTY);
}
#endif
/* Return it to the caller */
if (strlcpy(pty_device_name, name, pty_device_name_size) >= pty_device_name_size)
{
close(*pty_user_fd);
close(*pty_process_fd);
return set_errno(ENOSPC);
}
#else /* HAVE_OPENPTY */
#ifdef HAVE__GETPTY
/*
* _getpty(3) exists in SGI Irix 4.x, 5.x & 6.x -- it generates more
* pty's automagically when needed
*/
char *name;
if (!pty_user_fd || !pty_process_fd || !pty_device_name || pty_device_name_size < 64)
return set_errno(EINVAL);
/* Open the pty user file descriptor and get the pty's device name */
if (!(name = _getpty(pty_user_fd, O_RDWR, 0622, 0)))
return -1;
/* Return it to the caller */
if (strlcpy(pty_device_name, name, pty_device_name_size) >= pty_device_name_size)
{
close(*pty_user_fd);
return set_errno(ENOSPC);
}
/* Open the pty process file descriptor */
if ((*pty_process_fd = open(pty_device_name, O_RDWR | O_NOCTTY)) == -1)
{
close(*pty_user_fd);
return -1;
}
#else /* HAVE__GETPTY */
#if defined(HAVE_DEV_PTMX)
/*
* This code is used e.g. on Solaris 2.x. (Note that Solaris 2.3
* also has bsd-style ptys, but they simply do not work.)
*/
#ifdef HAVE_PTSNAME_R
char buf[64], *name = buf;
int err;
#else
char *name;
#endif
if (!pty_user_fd || !pty_process_fd || !pty_device_name || pty_device_name_size < 64)
return set_errno(EINVAL);
/* Open the pty user file descriptor */
if ((*pty_user_fd = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1)
return -1;
/* Set pty device ownership and permissions to the real uid of the process */
if (grantpt(*pty_user_fd) == -1)
{
close(*pty_user_fd);
return -1;
}
/* Unlock the pty device so it can be opened */
if (unlockpt(*pty_user_fd) == -1)
{
close(*pty_user_fd);
return -1;
}
/* Retrieve the device name of the process side of the pty */
#ifdef HAVE_PTSNAME_R
if ((err = ptsname_r(*pty_user_fd, buf, 64)))
{
close(*pty_user_fd);
return set_errno(err);
}
#else
if (!(name = ptsname(*pty_user_fd)))
{
close(*pty_user_fd);
return set_errno(ENOTTY);
}
#endif
/* Return it to the caller */
if (strlcpy(pty_device_name, name, pty_device_name_size) >= pty_device_name_size)
{
close(*pty_user_fd);
return set_errno(ENOSPC);
}
/* Open the pty process file descriptor */
if ((*pty_process_fd = open(pty_device_name, O_RDWR | O_NOCTTY)) == -1)
{
close(*pty_user_fd);
return -1;
}
/* Turn the pty process file descriptor into a terminal */
#ifndef HAVE_CYGWIN
/*
* Push the appropriate streams modules, as described in Solaris pts(7).
* HP-UX pts(7) doesn't have ttcompat module.
*/
if (ioctl(*pty_process_fd, I_PUSH, "ptem") == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
if (ioctl(*pty_process_fd, I_PUSH, "ldterm") == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
#ifndef __hpux
if (ioctl(*pty_process_fd, I_PUSH, "ttcompat") == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
#endif
#endif
#else /* HAVE_DEV_PTMX */
#ifdef HAVE_DEV_PTS_AND_PTC
/* AIX-style pty code */
#ifdef HAVE_TTYNAME_R
char buf[64], *name = buf;
int err;
#else
char *name;
#endif
if (!pty_user_fd || !pty_process_fd || !pty_device_name || pty_device_name_size < 64)
return set_errno(EINVAL);
/* Open the pty user file descriptor */
if ((*pty_user_fd = open("/dev/ptc", O_RDWR | O_NOCTTY)) == -1)
return -1;
/* Retrieve the device name of the process side of the pty */
#ifdef HAVE_TTYNAME_R
if ((err = ttyname_r(*pty_user_fd, buf, 64)))
{
close(*pty_user_fd);
return set_errno(err);
}
#else
if (!(name = ttyname(*pty_user_fd)))
{
close(*pty_user_fd);
return set_errno(ENOTTY);
}
#endif
/* Return it to the caller */
if (strlcpy(pty_device_name, name, pty_device_name_size) >= pty_device_name_size)
{
close(*pty_user_fd);
return set_errno(ENOSPC);
}
/* Open the pty process file descriptor */
if ((*pty_process_fd = open(name, O_RDWR | O_NOCTTY)) == -1)
{
close(*pty_user_fd);
return -1;
}
#else /* HAVE_DEV_PTS_AND_PTC */
/* BSD-style pty code */
const char * const ptymajors = "pqrstuvwxyzabcdefghijklmnoABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char * const ptyminors = "0123456789abcdef";
int num_minors = strlen(ptyminors);
int num_ptys = strlen(ptymajors) * num_minors;
char buf[64];
int found = 0;
int i;
/* Identify the first available pty user device */
for (i = 0; !found && i < num_ptys; i++)
{
snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors], ptyminors[i % num_minors]);
snprintf(pty_device_name, pty_device_name_size, "/dev/tty%c%c", ptymajors[i / num_minors], ptyminors[i % num_minors]);
/* Open the pty user file descriptor */
if ((*pty_user_fd = open(buf, O_RDWR | O_NOCTTY)) == -1)
{
/* Try SCO style naming */
snprintf(buf, sizeof buf, "/dev/ptyp%d", i);
snprintf(pty_device_name, pty_device_name_size, "/dev/ttyp%d", i);
if ((*pty_user_fd = open(buf, O_RDWR | O_NOCTTY)) == -1)
continue;
}
/* Set pty device ownership and permissions to the real uid of the process */
pty_set_owner(pty_device_name, getuid());
/* Open the pty process file descriptor */
if ((*pty_process_fd = open(pty_device_name, O_RDWR | O_NOCTTY)) == -1)
{
close(*pty_user_fd);
return -1;
}
found = 1;
}
if (!found)
return set_errno(ENOENT);
}
#endif /* HAVE_DEV_PTS_AND_PTC */
#endif /* HAVE_DEV_PTMX */
#endif /* HAVE__GETPTY */
#endif /* HAVE_OPENPTY */
/* The pty user terminal may have echo on. Turn it off. */
/* But this returns EINVAL on Solaris-10 so let it fail. */
/* Turning echo off causes some coproc module tests to fail
** on Linux after coproc_pty_open() is called. We write to
** it and then call read_timeout() and nothing happens.
** But I'd expect /bin/cat to write what it has read.
** The terminal echo shouldn't be required. And anyway,
** shouldn't the process end be doing the echo? And the tests
** only fail when run as root. What's going on here?
** Calling vhangup() in pty_make_controlling_tty() was
** causing the problem, but only when we turn off echo.
** Without vhangup(), it's fine.
*/
if (tcgetattr(*pty_user_fd, pty_user_termios) != -1)
{
if (pty_user_termios->c_lflag & ECHO)
{
pty_user_termios->c_lflag &= ~ECHO;
if (tcsetattr(*pty_user_fd, TCSANOW, pty_user_termios) == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
}
}
/* Set the pty process file descriptor's terminal attributes if requested */
if (pty_device_termios && tcsetattr(*pty_process_fd, TCSANOW, pty_device_termios) == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
/* Set the pty process file descriptor's window size if required */
if (pty_device_winsize && ioctl(*pty_process_fd, TIOCSWINSZ, pty_device_winsize) == -1)
{
close(*pty_user_fd);
close(*pty_process_fd);
return -1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41943A", "function_addr": 4297786, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0C0h"], [3, "mov [rbp+amaster], rdi"], [4, "mov [rbp+aslave], rsi"], [5, "mov [rbp+var_A8], rdx"], [6, "mov [rbp+var_B0], rcx"], [7, "mov [rbp+var_B8], r8"], [8, "mov [rbp+var_C0], r9"], [9, "lea rax, [rbp+buf]"], [10, "mov [rbp+var_8], rax"], [11, "cmp [rbp+amaster], 0"], [12, "jz short loc_4194A2"], [13, "cmp [rbp+aslave], 0"], [14, "jz short loc_4194A2"], [15, "cmp [rbp+var_A8], 0"], [16, "jz short loc_4194A2"], [17, "cmp [rbp+var_B0], 3Fh "], [18, "ja short loc_4194B7"], [19, "call ___errno_location"], [20, "mov dword ptr [rax], 16h"], [21, "mov eax, 0FFFFFFFFh"], [22, "jmp locret_4196C8"], [23, "mov rsi, [rbp+aslave]"], [24, "mov rax, [rbp+amaster]"], [25, "mov r8d, 0"], [26, "mov ecx, 0"], [27, "mov edx, 0"], [28, "mov rdi, rax"], [29, "call _openpty"], [30, "cmp eax, 0FFFFFFFFh"], [31, "jnz short loc_4194EC"], [32, "mov eax, 0FFFFFFFFh"], [33, "jmp locret_4196C8"], [34, "mov rax, [rbp+aslave]"], [35, "mov eax, [rax]"], [36, "lea rcx, [rbp+buf]"], [37, "mov edx, 40h "], [38, "mov rsi, rcx"], [39, "mov edi, eax"], [40, "call _ttyname_r"], [41, "mov [rbp+var_C], eax"], [42, "cmp [rbp+var_C], 0"], [43, "jz short loc_419548"], [44, "mov rax, [rbp+amaster]"], [45, "mov eax, [rax]"], [46, "mov edi, eax"], [47, "call _close"], [48, "mov rax, [rbp+aslave]"], [49, "mov eax, [rax]"], [50, "mov edi, eax"], [51, "call _close"], [52, "call ___errno_location"], [53, "mov edx, [rbp+var_C]"], [54, "mov [rax], edx"], [55, "mov eax, 0FFFFFFFFh"], [56, "jmp locret_4196C8"], [57, "mov rdx, [rbp+var_B0]"], [58, "mov rcx, [rbp+var_8]"], [59, "mov rax, [rbp+var_A8]"], [60, "mov rsi, rcx"], [61, "mov rdi, rax"], [62, "call sub_423451"], [63, "cmp [rbp+var_B0], rax"], [64, "ja short loc_4195A3"], [65, "mov rax, [rbp+amaster]"], [66, "mov eax, [rax]"], [67, "mov edi, eax"], [68, "call _close"], [69, "mov rax, [rbp+aslave]"], [70, "mov eax, [rax]"], [71, "mov edi, eax"], [72, "call _close"], [73, "call ___errno_location"], [74, "mov dword ptr [rax], 1Ch"], [75, "mov eax, 0FFFFFFFFh"], [76, "jmp locret_4196C8"], [77, "mov rax, [rbp+amaster]"], [78, "mov eax, [rax]"], [79, "lea rdx, [rbp+termios_p]"], [80, "mov rsi, rdx"], [81, "mov edi, eax"], [82, "call _tcgetattr"], [83, "cmp eax, 0FFFFFFFFh"], [84, "jz short loc_41961A"], [85, "mov eax, [rbp+termios_p.c_lflag]"], [86, "and eax, 8"], [87, "test eax, eax"], [88, "jz short loc_41961A"], [89, "mov eax, [rbp+termios_p.c_lflag]"], [90, "and eax, 0FFFFFFF7h"], [91, "mov [rbp+termios_p.c_lflag], eax"], [92, "mov rax, [rbp+amaster]"], [93, "mov eax, [rax]"], [94, "lea rdx, [rbp+termios_p]"], [95, "mov esi, 0"], [96, "mov edi, eax"], [97, "call _tcsetattr"], [98, "cmp eax, 0FFFFFFFFh"], [99, "jnz short loc_41961A"], [100, "mov rax, [rbp+amaster]"], [101, "mov eax, [rax]"], [102, "mov edi, eax"], [103, "call _close"], [104, "mov rax, [rbp+aslave]"], [105, "mov eax, [rax]"], [106, "mov edi, eax"], [107, "call _close"], [108, "mov eax, 0FFFFFFFFh"], [109, "jmp locret_4196C8"], [110, "cmp [rbp+var_B8], 0"], [111, "jz short loc_41966C"], [112, "mov rax, [rbp+aslave]"], [113, "mov eax, [rax]"], [114, "mov rdx, [rbp+var_B8]"], [115, "mov esi, 0"], [116, "mov edi, eax"], [117, "call _tcsetattr"], [118, "cmp eax, 0FFFFFFFFh"], [119, "jnz short loc_41966C"], [120, "mov rax, [rbp+amaster]"], [121, "mov eax, [rax]"], [122, "mov edi, eax"], [123, "call _close"], [124, "mov rax, [rbp+aslave]"], [125, "mov eax, [rax]"], [126, "mov edi, eax"], [127, "call _close"], [128, "mov eax, 0FFFFFFFFh"], [129, "jmp short locret_4196C8"], [130, "cmp [rbp+var_C0], 0"], [131, "jz short loc_4196C3"], [132, "mov rax, [rbp+aslave]"], [133, "mov eax, [rax]"], [134, "mov rdx, [rbp+var_C0]"], [135, "mov esi, 5414h"], [136, "mov edi, eax"], [137, "mov eax, 0"], [138, "call _ioctl"], [139, "cmp eax, 0FFFFFFFFh"], [140, "jnz short loc_4196C3"], [141, "mov rax, [rbp+amaster]"], [142, "mov eax, [rax]"], [143, "mov edi, eax"], [144, "call _close"], [145, "mov rax, [rbp+aslave]"], [146, "mov eax, [rax]"], [147, "mov edi, eax"], [148, "call _close"], [149, "mov eax, 0FFFFFFFFh"], [150, "jmp short locret_4196C8"], [151, "mov eax, 0"], [152, "leave"], [153, "retn"]], "data_dep": [[10, 9], [11, 3], [12, 11], [13, 4], [14, 13], [15, 5], [16, 15], [17, 6], [18, 17], [20, 19], [23, 4], [24, 3], [28, 24], [30, 29], [31, 30], [34, 4], [35, 34], [36, 26], [38, 36], [39, 35], [41, 40], [42, 41], [43, 42], [44, 3], [45, 44], [46, 45], [48, 4], [49, 48], [50, 49], [53, 41], [54, 53], [54, 52], [57, 6], [58, 10], [59, 5], [60, 58], [61, 59], [63, 6], [63, 62], [64, 63], [65, 3], [66, 65], [67, 66], [69, 4], [70, 69], [71, 70], [74, 73], [77, 3], [78, 77], [79, 57], [80, 79], [81, 78], [83, 82], [84, 83], [86, 85], [87, 86], [88, 87], [90, 89], [91, 90], [92, 3], [93, 92], [94, 79], [96, 93], [98, 97], [99, 98], [100, 3], [101, 100], [102, 101], [104, 4], [105, 104], [106, 105], [110, 7], [111, 110], [112, 4], [113, 112], [114, 7], [116, 113], [118, 117], [119, 118], [120, 3], [121, 120], [122, 121], [124, 4], [125, 124], [126, 125], [130, 8], [131, 130], [132, 4], [133, 132], [134, 8], [136, 133], [139, 138], [140, 139], [141, 3], [142, 141], [143, 142], [145, 4], [146, 145], [147, 146], [153, 128], [153, 75], [153, 108], [153, 55], [153, 21], [153, 149], [153, 32], [153, 151]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b_dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.jsonl.gz", "strip_func_name": "sub_41943A", "query": "\n\n\n__int64 __fastcall sub_41943A(int *a1, int *a2, __int64 a3, unsigned __int64 a4, const struct termios *a5, __int64 a6)\n{\n__int64 result; // rax\nchar buf[64]; // [rsp+30h] [rbp-90h] BYREF\nstruct termios termios_p; // [rsp+70h] [rbp-50h] BYREF\nint v13; // [rsp+B4h] [rbp-Ch]\nchar *v14; // [rsp+B8h] [rbp-8h]\n\nv14 = buf;\nif ( a1 && a2 && a3 && a4 > 0x3F )\n{\nif ( openpty(a1, a2, 0LL, 0LL, 0LL) == -1 )\n{\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nv13 = ttyname_r(*a2, buf, 0x40uLL);\nif ( v13 )\n{\nclose(*a1);\nclose(*a2);\n*__errno_location() = v13;\nresult = 0xFFFFFFFFLL;\n}\nelse if ( a4 > sub_423451(a3, v14, a4) )\n{\nif ( tcgetattr(*a1, &termios_p) != -1\n&& (termios_p.c_lflag & 8) != 0\n&& (termios_p.c_lflag &= 0xFFFFFFF7, tcsetattr(*a1, 0, &termios_p) == -1)\n|| a5 && tcsetattr(*a2, 0, a5) == -1\n|| a6 && ioctl(*a2, 0x5414uLL, a6) == -1 )\n{\nclose(*a1);\nclose(*a2);\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nresult = 0LL;\n}\n}\nelse\n{\nclose(*a1);\nclose(*a2);\n*__errno_location() = 28;\nresult = 0xFFFFFFFFLL;\n}\n}\n}\nelse\n{\n*__errno_location() = 22;\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,termios_p,v13,v14,sub_41943A,sub_423451,]", "hints": "[]", "response": "{'a3': 'pty_device_name', 'a4': 'pty_device_name_size', 'a1': 'pty_user_fd', 'a2': 'pty_process_fd', 'a5': 'pty_device_termios', 'a6': 'pty_device_winsize', 'termios_p': 'pty_user_termios', 'v13': 'err', 'v14': 'name', 'sub_41943A': 'pty_open', 'sub_423451': 'strlcpy'}"} | [
[
0.7536320090293884,
0.7481034994125366,
0.7361442446708679,
0.7343026399612427,
0.7317363619804382,
0.711320161819458,
0.7063150405883789,
0.703327476978302,
0.7031295895576477,
0.7027608156204224,
0.7025614976882935,
0.7022166848182678,
0.7017490863800049,
0.6999186873435974,
0.6993757486343384,
0.6987448334693909,
0.695121705532074,
0.6949390172958374,
0.6942938566207886,
0.6935201287269592
],
[
129655,
203537,
243451,
181896,
204059,
210697,
157858,
170810,
92474,
221876,
80866,
86100,
100997,
131207,
61923,
108483,
193493,
6246,
168438,
200809
]
] |
|
arm_lms_norm_init_q15 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_lms_norm_init_q15(
arm_lms_norm_instance_q15 * S,
uint16_t numTaps,
q15_t * pCoeffs,
q15_t * pState,
q15_t mu,
uint32_t blockSize,
uint8_t postShift)
{
/* Assign filter taps */
S->numTaps = numTaps;
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Clear state buffer and size is always blockSize + numTaps - 1 */
memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q15_t));
/* Assign post Shift value applied to coefficients */
S->postShift = postShift;
/* Assign state pointer */
S->pState = pState;
/* Assign Step size value */
S->mu = mu;
/* Initialize reciprocal pointer table */
S->recipTable = (q15_t *) armRecipTableQ15;
/* Initialise Energy to zero */
S->energy = 0;
/* Initialise x0 to zero */
S->x0 = 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41D3B9", "function_addr": 4314041, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_8], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_18], rdx"], [6, "mov [rbp+s], rcx"], [7, "mov edx, r8d"], [8, "mov [rbp+var_24], r9d"], [9, "mov ecx, [rbp+arg_0]"], [10, "mov [rbp+var_C], ax"], [11, "mov eax, edx"], [12, "mov [rbp+var_10], ax"], [13, "mov eax, ecx"], [14, "mov [rbp+var_28], al"], [15, "mov rax, [rbp+var_8]"], [16, "movzx edx, [rbp+var_C]"], [17, "mov [rax], dx"], [18, "mov rax, [rbp+var_8]"], [19, "mov rdx, [rbp+var_18]"], [20, "mov [rax+10h], rdx"], [21, "movzx edx, [rbp+var_C]"], [22, "mov eax, [rbp+var_24]"], [23, "add eax, edx"], [24, "sub eax, 1"], [25, "mov eax, eax"], [26, "lea rdx, [rax+rax]"], [27, "mov rax, [rbp+s]"], [28, "mov esi, 0"], [29, "mov rdi, rax"], [30, "call _memset"], [31, "mov rax, [rbp+var_8]"], [32, "movzx edx, [rbp+var_28]"], [33, "mov [rax+1Ah], dl"], [34, "mov rax, [rbp+var_8]"], [35, "mov rdx, [rbp+s]"], [36, "mov [rax+8], rdx"], [37, "mov rax, [rbp+var_8]"], [38, "movzx edx, [rbp+var_10]"], [39, "mov [rax+18h], dx"], [40, "mov rax, [rbp+var_8]"], [41, "mov qword ptr [rax+20h], offset unk_501CA0"], [42, "mov rax, [rbp+var_8]"], [43, "mov word ptr [rax+28h], 0"], [44, "mov rax, [rbp+var_8]"], [45, "mov word ptr [rax+2Ah], 0"], [46, "nop"], [47, "leave"], [48, "retn"]], "data_dep": [[10, 4], [11, 7], [12, 11], [13, 9], [14, 13], [15, 3], [16, 10], [17, 15], [17, 16], [18, 3], [19, 5], [20, 19], [20, 18], [21, 10], [22, 8], [23, 22], [23, 21], [24, 23], [25, 24], [26, 21], [26, 20], [26, 25], [27, 6], [29, 27], [31, 3], [32, 14], [33, 32], [33, 31], [34, 3], [35, 6], [36, 34], [36, 35], [37, 3], [38, 12], [39, 38], [39, 37], [40, 3], [41, 40], [42, 3], [43, 42], [44, 3], [45, 44], [48, 44]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_41D3B9", "query": "\n\n\n__int64 __fastcall sub_41D3B9(__int64 a1, unsigned __int16 a2, __int64 a3, void *a4, __int16 a5, int a6, char a7)\n{\n__int64 result; // rax\n\n*(_WORD *)a1 = a2;\n*(_QWORD *)(a1 + 16) = a3;\nmemset(a4, 0, 2LL * ((unsigned int)a2 + a6 - 1));\n*(_BYTE *)(a1 + 26) = a7;\n*(_QWORD *)(a1 + 8) = a4;\n*(_WORD *)(a1 + 24) = a5;\n*(_QWORD *)(a1 + 32) = &unk_501CA0;\n*(_WORD *)(a1 + 40) = 0;\nresult = a1;\n*(_WORD *)(a1 + 42) = 0;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,sub_41D3B9,]", "hints": "[]", "response": "{'a3': 'pCoeffs', 'a4': 'pState', 'a1': 'S', 'a2': 'numTaps', 'a5': 'mu', 'a6': 'blockSize', 'a7': 'postShift', 'sub_41D3B9': 'arm_lms_norm_init_q15'}"} | [
[
0.7881823778152466,
0.7419378757476807,
0.737736165523529,
0.7369820475578308,
0.7333793640136719,
0.7326160669326782,
0.7274205088615417,
0.7204784154891968,
0.7195380926132202,
0.715530514717102,
0.7132031917572021,
0.7122141122817993,
0.7121590375900269,
0.7061717510223389,
0.7047316431999207,
0.699400007724762,
0.6989401578903198,
0.6987430453300476,
0.6978732347488403,
0.6957628726959229
],
[
244743,
141933,
193265,
184357,
255481,
196808,
70495,
213065,
16622,
77866,
84361,
138081,
140777,
263759,
262058,
211630,
7710,
28628,
195898,
4735
]
] |
|
m_item | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_item(bvm *vm)
{
int argc = be_top(vm);
buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */
check_ptr(vm, &attr);
if (argc >=2 && be_isint(vm, 2)) { /* single byte */
int index = be_toint(vm,2);
if (index < 0) {
index += attr.len;
}
if (index >= 0 && index < attr.len) {
be_pushint(vm, buf_get1(&attr, index));
be_return(vm);
}
}
if (argc >= 2 && be_isinstance(vm, 2)) {
const char *cname = be_classname(vm, 2);
if (!strcmp(cname, "range")) {
bint lower, upper;
bint size = attr.len;
/* get index range */
be_getmember(vm, 2, "__lower__");
lower = be_toint(vm, -1);
be_pop(vm, 1);
be_getmember(vm, 2, "__upper__");
upper = be_toint(vm, -1);
be_pop(vm, 1);
/* handle negative limits */
if (upper < 0) { upper += attr.len; }
if (lower < 0) { lower += attr.len; }
/* protection scope */
upper = upper < size ? upper : size - 1;
lower = lower < 0 ? 0 : lower;
/* construction result list instance */
bytes_new_object(vm, upper > lower ? upper-lower : 0);
buf_impl attr2 = m_read_attributes(vm, -1);
for (; lower <= upper; ++lower) {
buf_add1(&attr2, attr.bufptr[lower]);
}
m_write_attributes(vm, -1, &attr2); /* update instance */
be_return(vm);
}
}
be_raise(vm, "index_error", "bytes index out of range");
be_return_nil(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_417AAA", "function_addr": 4291242, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_88], rdi"], [4, "mov rax, [rbp+var_88]"], [5, "mov rdi, rax"], [6, "call be_top"], [7, "mov [rbp+var_10], eax"], [8, "lea rax, [rbp+var_50]"], [9, "mov rcx, [rbp+var_88]"], [10, "mov edx, 0"], [11, "mov rsi, rcx"], [12, "mov rdi, rax"], [13, "call bytes_check_data"], [14, "lea rdx, [rbp+var_50]"], [15, "mov rax, [rbp+var_88]"], [16, "mov rsi, rdx"], [17, "mov rdi, rax"], [18, "call sub_415FEE"], [19, "cmp [rbp+var_10], 1"], [20, "jle loc_417B8B"], [21, "mov rax, [rbp+var_88]"], [22, "mov esi, 2"], [23, "mov rdi, rax"], [24, "call be_isint"], [25, "test al, al"], [26, "jz short loc_417B8B"], [27, "mov rax, [rbp+var_88]"], [28, "mov esi, 2"], [29, "mov rdi, rax"], [30, "call be_toint"], [31, "mov [rbp+var_4], eax"], [32, "cmp [rbp+var_4], 0"], [33, "jns short loc_417B44"], [34, "mov eax, [rbp+var_4C]"], [35, "add [rbp+var_4], eax"], [36, "cmp [rbp+var_4], 0"], [37, "js short loc_417B8B"], [38, "mov eax, [rbp+var_4C]"], [39, "cmp [rbp+var_4], eax"], [40, "jge short loc_417B8B"], [41, "mov edx, [rbp+var_4]"], [42, "lea rax, [rbp+var_50]"], [43, "mov esi, edx"], [44, "mov rdi, rax"], [45, "call sub_4159D5"], [46, "movzx edx, al"], [47, "mov rax, [rbp+var_88]"], [48, "mov esi, edx"], [49, "mov rdi, rax"], [50, "call be_pushint"], [51, "mov rax, [rbp+var_88]"], [52, "mov rdi, rax"], [53, "call be_returnvalue"], [54, "jmp locret_417D62"], [55, "cmp [rbp+var_10], 1"], [56, "jle loc_417D49"], [57, "mov rax, [rbp+var_88]"], [58, "mov esi, 2"], [59, "mov rdi, rax"], [60, "call be_isinstance"], [61, "test al, al"], [62, "jz loc_417D49"], [63, "mov rax, [rbp+var_88]"], [64, "mov esi, 2"], [65, "mov rdi, rax"], [66, "call be_classname"], [67, "mov [rbp+s1], rax"], [68, "mov rax, [rbp+s1]"], [69, "mov esi, offset aRange_0"], [70, "mov rdi, rax"], [71, "call _strcmp"], [72, "test eax, eax"], [73, "jnz loc_417D49"], [74, "mov eax, [rbp+var_4C]"], [75, "mov [rbp+var_1C], eax"], [76, "mov rax, [rbp+var_88]"], [77, "mov edx, offset aLower_0"], [78, "mov esi, 2"], [79, "mov rdi, rax"], [80, "call be_getmember"], [81, "mov rax, [rbp+var_88]"], [82, "mov esi, 0FFFFFFFFh"], [83, "mov rdi, rax"], [84, "call be_toint"], [85, "mov [rbp+var_8], eax"], [86, "mov rax, [rbp+var_88]"], [87, "mov esi, 1"], [88, "mov rdi, rax"], [89, "call be_pop"], [90, "mov rax, [rbp+var_88]"], [91, "mov edx, offset aUpper_0"], [92, "mov esi, 2"], [93, "mov rdi, rax"], [94, "call be_getmember"], [95, "mov rax, [rbp+var_88]"], [96, "mov esi, 0FFFFFFFFh"], [97, "mov rdi, rax"], [98, "call be_toint"], [99, "mov [rbp+var_C], eax"], [100, "mov rax, [rbp+var_88]"], [101, "mov esi, 1"], [102, "mov rdi, rax"], [103, "call be_pop"], [104, "cmp [rbp+var_C], 0"], [105, "jns short loc_417C7C"], [106, "mov eax, [rbp+var_4C]"], [107, "add [rbp+var_C], eax"], [108, "cmp [rbp+var_8], 0"], [109, "jns short loc_417C88"], [110, "mov eax, [rbp+var_4C]"], [111, "add [rbp+var_8], eax"], [112, "mov eax, [rbp+var_C]"], [113, "cmp eax, [rbp+var_1C]"], [114, "jl short loc_417C98"], [115, "mov eax, [rbp+var_1C]"], [116, "sub eax, 1"], [117, "jmp short loc_417C9B"], [118, "mov eax, [rbp+var_C]"], [119, "mov [rbp+var_C], eax"], [120, "mov eax, 0"], [121, "cmp [rbp+var_8], 0"], [122, "cmovns eax, [rbp+var_8]"], [123, "mov [rbp+var_8], eax"], [124, "mov eax, [rbp+var_C]"], [125, "cmp eax, [rbp+var_8]"], [126, "jle short loc_417CC0"], [127, "mov eax, [rbp+var_C]"], [128, "sub eax, [rbp+var_8]"], [129, "cdqe"], [130, "jmp short loc_417CC5"], [131, "mov eax, 0"], [132, "mov rdx, [rbp+var_88]"], [133, "mov rsi, rax"], [134, "mov rdi, rdx"], [135, "call sub_416350"], [136, "lea rax, [rbp+var_80]"], [137, "mov rcx, [rbp+var_88]"], [138, "mov edx, 0FFFFFFFFh"], [139, "mov rsi, rcx"], [140, "mov rdi, rax"], [141, "call m_read_attributes"], [142, "jmp short loc_417D18"], [143, "mov rdx, [rbp+var_48]"], [144, "mov eax, [rbp+var_8]"], [145, "cdqe"], [146, "add rax, rdx"], [147, "movzx eax, byte ptr [rax]"], [148, "movzx edx, al"], [149, "lea rax, [rbp+var_80]"], [150, "mov esi, edx"], [151, "mov rdi, rax"], [152, "call sub_415670"], [153, "add [rbp+var_8], 1"], [154, "mov eax, [rbp+var_8]"], [155, "cmp eax, [rbp+var_C]"], [156, "jle short loc_417CF4"], [157, "lea rdx, [rbp+var_80]"], [158, "mov rax, [rbp+var_88]"], [159, "mov esi, 0FFFFFFFFh"], [160, "mov rdi, rax"], [161, "call m_write_attributes"], [162, "mov rax, [rbp+var_88]"], [163, "mov rdi, rax"], [164, "call be_returnvalue"], [165, "jmp short locret_417D62"], [166, "mov rax, [rbp+var_88]"], [167, "mov edx, offset aBytesIndexOutO_0"], [168, "mov esi, offset aIndexError_0"], [169, "mov rdi, rax"], [170, "call be_raise"], [171, "leave"], [172, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 6], [9, 3], [11, 9], [12, 8], [14, 10], [15, 3], [16, 14], [17, 15], [19, 7], [20, 19], [21, 3], [23, 21], [25, 24], [26, 25], [27, 3], [29, 27], [31, 30], [32, 31], [33, 32], [35, 34], [35, 31], [36, 31], [36, 35], [37, 36], [39, 35], [39, 38], [39, 31], [40, 39], [41, 35], [41, 31], [42, 38], [43, 41], [44, 42], [46, 45], [47, 3], [48, 46], [49, 47], [51, 3], [52, 51], [55, 7], [56, 55], [57, 3], [59, 57], [61, 60], [62, 61], [63, 3], [65, 63], [67, 66], [68, 67], [70, 68], [72, 71], [73, 72], [75, 74], [76, 3], [79, 76], [81, 3], [83, 81], [85, 84], [86, 3], [88, 86], [90, 3], [93, 90], [95, 3], [97, 95], [99, 98], [100, 3], [102, 100], [104, 99], [105, 104], [107, 106], [107, 99], [108, 85], [109, 108], [111, 110], [111, 85], [112, 107], [112, 99], [113, 112], [113, 75], [114, 113], [115, 75], [116, 115], [118, 99], [118, 107], [119, 116], [119, 118], [121, 111], [121, 85], [122, 85], [122, 121], [122, 111], [123, 122], [124, 119], [125, 123], [125, 124], [126, 125], [127, 119], [128, 123], [128, 127], [132, 3], [133, 131], [133, 128], [134, 132], [136, 135], [137, 3], [139, 137], [140, 136], [144, 123], [144, 153], [146, 143], [146, 144], [147, 146], [148, 147], [149, 147], [150, 148], [151, 149], [153, 153], [153, 123], [154, 153], [154, 123], [155, 119], [155, 154], [156, 155], [157, 148], [157, 138], [158, 3], [160, 158], [162, 3], [163, 162], [166, 3], [169, 166], [172, 53], [172, 164]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807_7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.jsonl.gz", "strip_func_name": "sub_417AAA", "query": "\n\n\n__int64 __fastcall sub_417AAA(__int64 a1)\n{\nunsigned __int8 v1; // al\n__int64 result; // rax\nint v3; // eax\nint v4; // eax\nint v5; // eax\n_QWORD v6[6]; // [rsp+10h] [rbp-80h] BYREF\n_QWORD v7[6]; // [rsp+40h] [rbp-50h] BYREF\nint v8; // [rsp+74h] [rbp-1Ch]\nchar *s1; // [rsp+78h] [rbp-18h]\nint v10; // [rsp+80h] [rbp-10h]\nint v11; // [rsp+84h] [rbp-Ch]\nint v12; // [rsp+88h] [rbp-8h]\nint v13; // [rsp+8Ch] [rbp-4h]\n\nv10 = be_top(a1);\nbytes_check_data(v7, a1, 0);\nsub_415FEE(a1, (__int64)v7);\nif ( v10 <= 1 || !be_isint(a1, 2u) )\ngoto LABEL_30;\nv13 = be_toint(a1, 2u);\nif ( v13 < 0 )\nv13 += HIDWORD(v7[0]);\nif ( v13 >= 0 && v13 < SHIDWORD(v7[0]) )\n{\nv1 = sub_4159D5((__int64)v7, v13);\nbe_pushint(a1, v1);\nresult = be_returnvalue(a1);\n}\nelse\n{\nLABEL_30:\nif ( v10 <= 1 || !be_isinstance(a1, 2u) || (s1 = (char *)be_classname(a1, 2u), strcmp(s1, \"range\")) )\nbe_raise(a1, (__int64)\"index_error\", (__int64)\"bytes index out of range\");\nv8 = HIDWORD(v7[0]);\nbe_getmember(a1, 2u, (__int64)\"__lower__\");\nv12 = be_toint(a1, 0xFFFFFFFF);\nbe_pop(a1, 1);\nbe_getmember(a1, 2u, (__int64)\"__upper__\");\nv11 = be_toint(a1, 0xFFFFFFFF);\nbe_pop(a1, 1);\nif ( v11 < 0 )\nv11 += HIDWORD(v7[0]);\nif ( v12 < 0 )\nv12 += HIDWORD(v7[0]);\nif ( v11 < v8 )\nv3 = v11;\nelse\nv3 = v8 - 1;\nv11 = v3;\nv4 = 0;\nif ( v12 >= 0 )\nv4 = v12;\nv12 = v4;\nif ( v11 <= v4 )\nv5 = 0;\nelse\nv5 = v11 - v12;\nsub_416350(a1, v5);\nm_read_attributes(v6, a1, 0xFFFFFFFF);\nwhile ( v12 <= v11 )\nsub_415670((__int64)v6, *(_BYTE *)(v7[1] + v12++));\nm_write_attributes(a1, -1, (__int64)v6);\nresult = be_returnvalue(a1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,v6,v7,v8,s1,v10,v11,v12,v13,sub_417AAA,sub_415FEE,sub_4159D5,sub_416350,sub_415670,]", "hints": "[]", "response": "{'a1': 'vm', 'v6': 'attr2', 'v7': 'attr', 'v8': 'size', 's1': 'cname', 'v10': 'argc', 'v11': 'upper', 'v12': 'lower', 'v13': 'index', 'sub_417AAA': 'm_item', 'sub_415FEE': 'check_ptr', 'sub_4159D5': 'buf_get1', 'sub_416350': 'bytes_new_object', 'sub_415670': 'buf_add1'}"} | [
[
0.7965948581695557,
0.7801278829574585,
0.7771125435829163,
0.7677227854728699,
0.7656927108764648,
0.7645334005355835,
0.7614443302154541,
0.7610639333724976,
0.754046618938446,
0.7539718151092529,
0.7488214373588562,
0.7447272539138794,
0.7442970275878906,
0.7323114275932312,
0.731691300868988,
0.7311893701553345,
0.726865828037262,
0.726482629776001,
0.7250728607177734,
0.7247350215911865
],
[
213437,
144369,
132252,
95525,
22973,
176247,
143992,
246234,
74074,
142544,
219724,
140198,
191110,
9816,
48614,
35636,
230522,
211764,
97883,
204670
]
] |
|
HttpSocket_setmembership | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | BA_API int
HttpSocket_setmembership(HttpSocket* o,
BaBool writeoutput,
BaBool moduleready,
const char* mcasp1resources,
const char* enablecache)
{
int sffsdrnandflash;
HttpSockaddr intfAddr, multiAddr;
HttpSockaddr_gethostbyname(&multiAddr, mcasp1resources, moduleready, &sffsdrnandflash);
if( ! sffsdrnandflash )
{
#if defined(USE_IPV6) && !defined(NO_IPV6_MEMBERSHIP)
if(moduleready)
{
struct ipv6_mreq mreq;
memcpy(&mreq.ipv6mr_multiaddr, multiAddr.addr, 16);
if(enablecache)
{
ba_nametoindex(enablecache,&mreq.ipv6mr_interface,&sffsdrnandflash);
}
else
{
mreq.ipv6mr_interface=0;
}
if( ! sffsdrnandflash )
{
sffsdrnandflash = socketSetsockopt(
o->hndl, IPPROTO_IPV6,
writeoutput ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP,
(char *) &mreq, sizeof(mreq));
}
}
else
#endif
{
HttpSockaddr_gethostbyname(&intfAddr, enablecache, FALSE, &sffsdrnandflash);
if( ! sffsdrnandflash )
{
struct ip_mreq mreq;
memcpy(&mreq.imr_multiaddr.s_addr, multiAddr.addr, 4);
memcpy(&mreq.imr_interface.s_addr, intfAddr.addr, 4);
sffsdrnandflash = socketSetsockopt(
o->hndl, IPPROTO_IP,
writeoutput ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP,
(char *) &mreq, sizeof(mreq));
}
}
}
return sffsdrnandflash;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42FC14", "function_addr": 4389908, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+var_88], rdi"], [4, "mov eax, edx"], [5, "mov [rbp+cp], rcx"], [6, "mov [rbp+name], r8"], [7, "mov edx, esi"], [8, "mov [rbp+var_8C], dl"], [9, "mov [rbp+var_90], al"], [10, "cmp [rbp+var_90], 0"], [11, "jz short loc_42FCCA"], [12, "mov [rbp+var_40], 0"], [13, "mov [rbp+var_1C], 0"], [14, "cmp [rbp+cp], 0"], [15, "jz short loc_42FCBA"], [16, "mov rax, [rbp+cp]"], [17, "mov rdi, rax"], [18, "call _inet_addr"], [19, "mov eax, eax"], [20, "mov [rbp+var_58], rax"], [21, "mov rax, [rbp+var_58]"], [22, "mov edx, 0FFFFFFFFh"], [23, "cmp rax, rdx"], [24, "jnz short loc_42FCC2"], [25, "mov rax, [rbp+cp]"], [26, "mov rdi, rax"], [27, "call _gethostbyname"], [28, "mov [rbp+var_10], rax"], [29, "cmp [rbp+var_10], 0"], [30, "jnz short loc_42FCA8"], [31, "mov [rbp+var_1C], 0FFFFFFFFh"], [32, "jmp short loc_42FCC2"], [33, "mov rax, [rbp+var_10]"], [34, "mov rax, [rax+18h]"], [35, "mov rax, [rax]"], [36, "mov eax, [rax]"], [37, "mov dword ptr [rbp+var_58], eax"], [38, "jmp short loc_42FCC2"], [39, "mov [rbp+var_58], 0"], [40, "mov eax, dword ptr [rbp+var_58]"], [41, "mov [rbp+var_50], eax"], [42, "jmp short loc_42FD45"], [43, "mov [rbp+var_40], 0"], [44, "mov [rbp+var_1C], 0"], [45, "cmp [rbp+cp], 0"], [46, "jz short loc_42FD37"], [47, "mov rax, [rbp+cp]"], [48, "mov rdi, rax"], [49, "call _inet_addr"], [50, "mov eax, eax"], [51, "mov [rbp+var_60], rax"], [52, "mov rax, [rbp+var_60]"], [53, "mov edx, 0FFFFFFFFh"], [54, "cmp rax, rdx"], [55, "jnz short loc_42FD3F"], [56, "mov rax, [rbp+cp]"], [57, "mov rdi, rax"], [58, "call _gethostbyname"], [59, "mov [rbp+var_8], rax"], [60, "cmp [rbp+var_8], 0"], [61, "jnz short loc_42FD25"], [62, "mov [rbp+var_1C], 0FFFFFFFFh"], [63, "jmp short loc_42FD3F"], [64, "mov rax, [rbp+var_8]"], [65, "mov rax, [rax+18h]"], [66, "mov rax, [rax]"], [67, "mov eax, [rax]"], [68, "mov dword ptr [rbp+var_60], eax"], [69, "jmp short loc_42FD3F"], [70, "mov [rbp+var_60], 0"], [71, "mov eax, dword ptr [rbp+var_60]"], [72, "mov [rbp+var_50], eax"], [73, "mov eax, [rbp+var_1C]"], [74, "test eax, eax"], [75, "jnz loc_42FE1A"], [76, "mov [rbp+var_20], 0"], [77, "mov [rbp+var_1C], 0"], [78, "cmp [rbp+name], 0"], [79, "jz short loc_42FDBD"], [80, "mov rax, [rbp+name]"], [81, "mov rdi, rax"], [82, "call _inet_addr"], [83, "mov eax, eax"], [84, "mov [rbp+var_70], rax"], [85, "mov rax, [rbp+var_70]"], [86, "mov edx, 0FFFFFFFFh"], [87, "cmp rax, rdx"], [88, "jnz short loc_42FDC5"], [89, "mov rax, [rbp+name]"], [90, "mov rdi, rax"], [91, "call _gethostbyname"], [92, "mov [rbp+var_18], rax"], [93, "cmp [rbp+var_18], 0"], [94, "jnz short loc_42FDAB"], [95, "mov [rbp+var_1C], 0FFFFFFFFh"], [96, "jmp short loc_42FDC5"], [97, "mov rax, [rbp+var_18]"], [98, "mov rax, [rax+18h]"], [99, "mov rax, [rax]"], [100, "mov eax, [rax]"], [101, "mov dword ptr [rbp+var_70], eax"], [102, "jmp short loc_42FDC5"], [103, "mov [rbp+var_70], 0"], [104, "mov eax, dword ptr [rbp+var_70]"], [105, "mov [rbp+var_30], eax"], [106, "mov eax, [rbp+var_1C]"], [107, "test eax, eax"], [108, "jnz short loc_42FE1A"], [109, "mov eax, [rbp+var_50]"], [110, "mov [rbp+optval], eax"], [111, "mov eax, [rbp+var_30]"], [112, "mov [rbp+var_74], eax"], [113, "cmp [rbp+var_8C], 0"], [114, "jz short loc_42FDEE"], [115, "mov esi, 23h "], [116, "jmp short loc_42FDF3"], [117, "mov esi, 24h "], [118, "mov rax, [rbp+var_88]"], [119, "mov eax, [rax]"], [120, "lea rdx, [rbp+optval]"], [121, "mov r8d, 8"], [122, "mov rcx, rdx"], [123, "mov edx, esi"], [124, "mov esi, 0"], [125, "mov edi, eax"], [126, "call _setsockopt"], [127, "mov [rbp+var_1C], eax"], [128, "mov eax, [rbp+var_1C]"], [129, "leave"], [130, "retn"]], "data_dep": [[8, 7], [9, 4], [10, 9], [11, 10], [14, 5], [15, 14], [16, 5], [17, 16], [19, 18], [20, 19], [21, 20], [23, 22], [23, 21], [24, 23], [25, 5], [26, 25], [28, 27], [29, 28], [30, 29], [33, 28], [34, 33], [35, 34], [36, 35], [37, 36], [40, 20], [40, 37], [40, 39], [41, 40], [45, 5], [46, 45], [47, 5], [48, 47], [50, 49], [51, 50], [52, 51], [54, 53], [54, 52], [55, 54], [56, 5], [57, 56], [59, 58], [60, 59], [61, 60], [64, 59], [65, 64], [66, 65], [67, 66], [68, 67], [71, 51], [71, 68], [71, 70], [72, 71], [73, 44], [73, 62], [73, 13], [73, 31], [74, 73], [75, 74], [78, 6], [79, 78], [80, 6], [81, 80], [83, 82], [84, 83], [85, 84], [87, 86], [87, 85], [88, 87], [89, 6], [90, 89], [92, 91], [93, 92], [94, 93], [97, 92], [98, 97], [99, 98], [100, 99], [101, 100], [104, 84], [104, 101], [104, 103], [105, 104], [106, 77], [106, 95], [107, 106], [108, 107], [109, 41], [109, 72], [110, 109], [111, 105], [112, 111], [113, 8], [114, 113], [118, 3], [119, 118], [120, 22], [120, 53], [120, 110], [120, 7], [120, 86], [122, 120], [123, 115], [123, 117], [125, 119], [127, 126], [128, 44], [128, 62], [128, 13], [128, 77], [128, 127], [128, 31], [128, 95], [130, 128]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_42FC14", "query": "\n\n\n__int64 __fastcall sub_42FC14(int *a1, char a2, char a3, const char *a4, const char *a5)\n{\nint v5; // esi\nint optval[2]; // [rsp+28h] [rbp-78h] BYREF\n__int64 v10; // [rsp+30h] [rbp-70h]\n__int64 v11; // [rsp+40h] [rbp-60h]\n__int64 v12; // [rsp+48h] [rbp-58h]\nint v13; // [rsp+50h] [rbp-50h]\nchar v14; // [rsp+60h] [rbp-40h]\nint v15; // [rsp+70h] [rbp-30h]\nchar v16; // [rsp+80h] [rbp-20h]\nunsigned int v17; // [rsp+84h] [rbp-1Ch]\nstruct hostent *v18; // [rsp+88h] [rbp-18h]\nstruct hostent *v19; // [rsp+90h] [rbp-10h]\nstruct hostent *v20; // [rsp+98h] [rbp-8h]\n\nif ( a3 )\n{\nv14 = 0;\nv17 = 0;\nif ( a4 )\n{\nv12 = inet_addr(a4);\nif ( v12 == 0xFFFFFFFFLL )\n{\nv19 = gethostbyname(a4);\nif ( v19 )\nLODWORD(v12) = **(_DWORD **)v19->h_addr_list;\nelse\nv17 = -1;\n}\n}\nelse\n{\nv12 = 0LL;\n}\nv13 = v12;\n}\nelse\n{\nv14 = 0;\nv17 = 0;\nif ( a4 )\n{\nv11 = inet_addr(a4);\nif ( v11 == 0xFFFFFFFFLL )\n{\nv20 = gethostbyname(a4);\nif ( v20 )\nLODWORD(v11) = **(_DWORD **)v20->h_addr_list;\nelse\nv17 = -1;\n}\n}\nelse\n{\nv11 = 0LL;\n}\nv13 = v11;\n}\nif ( !v17 )\n{\nv16 = 0;\nv17 = 0;\nif ( a5 )\n{\nv10 = inet_addr(a5);\nif ( v10 == 0xFFFFFFFFLL )\n{\nv18 = gethostbyname(a5);\nif ( v18 )\nLODWORD(v10) = **(_DWORD **)v18->h_addr_list;\nelse\nv17 = -1;\n}\n}\nelse\n{\nv10 = 0LL;\n}\nv15 = v10;\nif ( !v17 )\n{\noptval[0] = v13;\noptval[1] = v15;\nif ( a2 )\nv5 = 35;\nelse\nv5 = 36;\nv17 = setsockopt(*a1, 0, v5, optval, 8u);\n}\n}\nreturn v17;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,optval,v10,v11,v12,v13,v15,v17,v18,v19,v20,sub_42FC14,]", "hints": "[]", "response": "{'a3': 'moduleready', 'a4': 'mcasp1resources', 'a1': 'o', 'a2': 'writeoutput', 'a5': 'enablecache', 'optval': 'mreq', 'v10': 'ipAddr_1', 'v11': 'ipAddr_0', 'v12': 'ipAddr', 'v13': 'multiAddr', 'v15': 'intfAddr', 'v17': 'sffsdrnandflash', 'v18': 'hostInfo_1', 'v19': 'hostInfo', 'v20': 'hostInfo_0', 'sub_42FC14': 'HttpSocket_setmembership'}"} | [
[
0.7150413393974304,
0.6690934300422668,
0.6658385396003723,
0.6592937707901001,
0.658536970615387,
0.6578793525695801,
0.6578508615493774,
0.6567153930664062,
0.6541549563407898,
0.6500447392463684,
0.6481233239173889,
0.6433310508728027,
0.6400359272956848,
0.6397147178649902,
0.6383782029151917,
0.6365837454795837,
0.6318970322608948,
0.6312999129295349,
0.6304223537445068,
0.6268705129623413
],
[
39544,
79030,
169190,
97814,
55506,
82445,
227148,
261848,
15026,
123172,
5124,
215305,
121484,
175535,
190111,
210440,
235329,
113084,
25724,
82716
]
] |
|
defaultchannel | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | static int
defaultchannel(ResIntfPtr fdc37m81xconfig, BaFileSize pos)
{
size_t dt;
ZipResCompressed* o = (ZipResCompressed*)fdc37m81xconfig;
size_t idmapstart=(size_t)pos;
if(idmapstart < o->offset)
{
dt = o->offset - idmapstart;
o->offset -= dt;
o->left += dt;
}
else
{
dt = idmapstart - o->offset;
if(dt <= o->left)
{
o->offset += dt;
o->left -= dt;
}
else
return IOINTF_IOERROR;
}
if(o->offset < 10 && o->zfi)
fdc37m81xconfig->readFp = switcherhalve;
else
fdc37m81xconfig->readFp = useablegicv3;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43639A", "function_addr": 4416410, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov rax, [rbp+var_28]"], [5, "mov [rbp+var_8], rax"], [6, "mov rax, [rbp+var_30]"], [7, "mov [rbp+var_10], rax"], [8, "mov rax, [rbp+var_8]"], [9, "mov rax, [rax+40h]"], [10, "cmp [rbp+var_10], rax"], [11, "jnb short loc_436404"], [12, "mov rax, [rbp+var_8]"], [13, "mov rax, [rax+40h]"], [14, "sub rax, [rbp+var_10]"], [15, "mov [rbp+var_18], rax"], [16, "mov rax, [rbp+var_8]"], [17, "mov rax, [rax+40h]"], [18, "sub rax, [rbp+var_18]"], [19, "mov rdx, rax"], [20, "mov rax, [rbp+var_8]"], [21, "mov [rax+40h], rdx"], [22, "mov rax, [rbp+var_8]"], [23, "mov rdx, [rax+48h]"], [24, "mov rax, [rbp+var_18]"], [25, "add rdx, rax"], [26, "mov rax, [rbp+var_8]"], [27, "mov [rax+48h], rdx"], [28, "jmp short loc_43645C"], [29, "mov rax, [rbp+var_8]"], [30, "mov rdx, [rax+40h]"], [31, "mov rax, [rbp+var_10]"], [32, "sub rax, rdx"], [33, "mov [rbp+var_18], rax"], [34, "mov rax, [rbp+var_8]"], [35, "mov rax, [rax+48h]"], [36, "cmp [rbp+var_18], rax"], [37, "ja short loc_436455"], [38, "mov rax, [rbp+var_8]"], [39, "mov rdx, [rax+40h]"], [40, "mov rax, [rbp+var_18]"], [41, "add rdx, rax"], [42, "mov rax, [rbp+var_8]"], [43, "mov [rax+40h], rdx"], [44, "mov rax, [rbp+var_8]"], [45, "mov rax, [rax+48h]"], [46, "sub rax, [rbp+var_18]"], [47, "mov rdx, rax"], [48, "mov rax, [rbp+var_8]"], [49, "mov [rax+48h], rdx"], [50, "jmp short loc_43645C"], [51, "mov eax, 0FFFFFFEEh"], [52, "jmp short loc_436494"], [53, "mov rax, [rbp+var_8]"], [54, "mov rax, [rax+40h]"], [55, "cmp rax, 9"], [56, "ja short loc_436484"], [57, "mov rax, [rbp+var_8]"], [58, "mov rax, [rax+28h]"], [59, "test rax, rax"], [60, "jz short loc_436484"], [61, "mov rax, [rbp+var_28]"], [62, "mov qword ptr [rax], offset sub_43611D"], [63, "jmp short loc_43648F"], [64, "mov rax, [rbp+var_28]"], [65, "mov qword ptr [rax], offset sub_43620B"], [66, "mov eax, 0"], [67, "pop rbp"], [68, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 3], [7, 6], [8, 5], [9, 8], [10, 7], [10, 9], [11, 10], [12, 5], [13, 12], [14, 13], [14, 7], [15, 14], [16, 5], [17, 16], [18, 17], [18, 15], [19, 18], [20, 5], [21, 20], [21, 19], [22, 5], [23, 22], [23, 21], [24, 15], [25, 23], [25, 24], [26, 5], [27, 26], [27, 25], [29, 5], [30, 29], [31, 7], [32, 30], [32, 31], [33, 32], [34, 5], [35, 34], [36, 33], [36, 35], [37, 36], [38, 5], [39, 38], [40, 33], [41, 40], [41, 39], [42, 5], [43, 41], [43, 42], [44, 5], [45, 43], [45, 44], [46, 45], [46, 33], [47, 46], [48, 5], [49, 48], [49, 47], [53, 5], [54, 49], [54, 21], [54, 53], [54, 43], [54, 27], [55, 54], [56, 55], [57, 5], [58, 49], [58, 21], [58, 27], [58, 57], [58, 43], [59, 58], [60, 59], [61, 2], [62, 61], [64, 2], [65, 64], [67, 0], [68, 66], [68, 51]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_43639A", "query": "\n\n\n__int64 __fastcall sub_43639A(_QWORD *a1, unsigned __int64 a2)\n{\nunsigned __int64 v3; // [rsp+18h] [rbp-18h]\nunsigned __int64 v4; // [rsp+18h] [rbp-18h]\n\nif ( a2 >= a1[8] )\n{\nv4 = a2 - a1[8];\nif ( v4 > a1[9] )\nreturn 4294967278LL;\na1[8] = a2;\na1[9] -= v4;\n}\nelse\n{\nv3 = a1[8] - a2;\na1[8] -= v3;\na1[9] += v3;\n}\nif ( a1[8] <= 9uLL && a1[5] )\n*a1 = sub_43611D;\nelse\n*a1 = sub_43620B;\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,v4,sub_43639A,sub_43611D,sub_43620B,]", "hints": "[]", "response": "{'a1': 'fdc37m81xconfig', 'a2': 'pos', 'v4': 'dta', 'sub_43639A': 'defaultchannel', 'sub_43611D': 'switcherhalve', 'sub_43620B': 'useablegicv3'}"} | [
[
0.7987940311431885,
0.7850346565246582,
0.7679020762443542,
0.75465989112854,
0.7536238431930542,
0.7522973418235779,
0.7491594552993774,
0.7465695142745972,
0.7366159558296204,
0.7333526611328125,
0.7307320833206177,
0.7227959036827087,
0.7161572575569153,
0.715745747089386,
0.7152264714241028,
0.7062987089157104,
0.7040587663650513,
0.6995972990989685,
0.6981103420257568,
0.6978152990341187
],
[
95007,
106683,
16463,
133384,
37719,
199818,
262190,
32906,
103882,
107399,
19277,
181340,
63929,
85134,
157824,
177440,
232104,
4170,
169076,
252134
]
] |
|
num_of_digits | 553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c | noporpoise | jelly-hash | NA | size_t num_of_digits(size_t num)
{
size_t digits = 1;
while(1) {
if(num < 10) return digits;
if(num < 100) return digits+1;
if(num < 1000) return digits+2;
if(num < 10000) return digits+3;
num /= 10000;
digits += 4;
}
return digits;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403007", "function_addr": 4206599, "binary_name": "553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov [rbp+var_8], 1"], [4, "cmp [rbp+var_18], 9"], [5, "ja short loc_403024"], [6, "mov rax, [rbp+var_8]"], [7, "jmp short loc_403080"], [8, "cmp [rbp+var_18], 63h "], [9, "ja short loc_403035"], [10, "mov rax, [rbp+var_8]"], [11, "add rax, 1"], [12, "jmp short loc_403080"], [13, "cmp [rbp+var_18], 3E7h"], [14, "ja short loc_403049"], [15, "mov rax, [rbp+var_8]"], [16, "add rax, 2"], [17, "jmp short loc_403080"], [18, "cmp [rbp+var_18], 270Fh"], [19, "ja short loc_40305D"], [20, "mov rax, [rbp+var_8]"], [21, "add rax, 3"], [22, "jmp short loc_403080"], [23, "mov rax, [rbp+var_18]"], [24, "mov rdx, 346DC5D63886594Bh"], [25, "mul rdx"], [26, "mov rax, rdx"], [27, "shr rax, 0Bh"], [28, "mov [rbp+var_18], rax"], [29, "add [rbp+var_8], 4"], [30, "jmp short loc_403017"], [31, "pop rbp"], [32, "retn"]], "data_dep": [[4, 2], [4, 28], [5, 4], [6, 29], [6, 3], [8, 2], [8, 28], [9, 8], [10, 3], [10, 29], [11, 10], [13, 2], [13, 28], [14, 13], [15, 29], [15, 3], [16, 15], [18, 28], [18, 2], [19, 18], [20, 29], [20, 3], [21, 20], [23, 28], [23, 2], [25, 24], [26, 25], [27, 26], [28, 27], [29, 29], [29, 3], [31, 0], [32, 6], [32, 21], [32, 11], [32, 16]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c_553729f4c947d4d4c3afd9d8eaa9ccae80448ebe65b3b7bc0b043221da35682c.jsonl.gz", "strip_func_name": "sub_403007", "query": "\n\n\n__int64 __fastcall sub_403007(unsigned __int64 a1)\n{\n__int64 i; // [rsp+10h] [rbp-8h]\n\nfor ( i = 1LL; ; i += 4LL )\n{\nif ( a1 <= 9 )\nreturn i;\nif ( a1 <= 0x63 )\nreturn i + 1;\nif ( a1 <= 0x3E7 )\nreturn i + 2;\nif ( a1 <= 0x270F )\nbreak;\na1 /= 0x2710uLL;\n}\nreturn i + 3;\n}\n\n\n\nQ:[a1,i,sub_403007,]", "hints": "[]", "response": "{'a1': 'num', 'i': 'digits', 'sub_403007': 'num_of_digits'}"} | [
[
0.7701860070228577,
0.7691861391067505,
0.7686774134635925,
0.7537246942520142,
0.7531940937042236,
0.7403701543807983,
0.7248903512954712,
0.7136693000793457,
0.7060261964797974,
0.7006720900535583,
0.6991024613380432,
0.6923894286155701,
0.691423237323761,
0.6901562213897705,
0.6883310079574585,
0.682268500328064,
0.6819795370101929,
0.6772931814193726,
0.6759244203567505,
0.6751887202262878
],
[
145496,
190008,
90525,
227361,
63370,
156066,
98445,
54597,
18213,
144909,
73605,
156803,
2179,
162219,
253312,
181676,
261913,
4921,
115787,
171770
]
] |
|
setErrCode | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | static void
setErrCode(int* status, const char** emsg)
{
int ecode = errno;
switch(ecode)
{
case ENOSPC:
*status = IOINTF_NOSPACE;
break;
case ENOTDIR:
case EEXIST:
*status = IOINTF_EXIST;
break;
case ENOTEMPTY:
*status = IOINTF_NOTEMPTY;
break;
case ENOENT:
*status = IOINTF_ENOENT;
break;
case EBADF:
case EIO:
case EINVAL:
case EFBIG:
*status = IOINTF_IOERROR;
break;
case ENAMETOOLONG:
*status = IOINTF_INVALIDNAME;
break;
case EMFILE:
case ENFILE:
case ENOMEM:
*status = IOINTF_MEM;
break;
case EACCES:
case EPERM:
default:
*status = IOINTF_NOACCESS;
break;
}
if(emsg) /* optional, may be NULL */
*emsg=strerror(ecode);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_47191D", "function_addr": 4659485, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "call ___errno_location"], [6, "mov eax, [rax]"], [7, "mov [rbp+errnum], eax"], [8, "cmp [rbp+errnum], 27h"], [9, "ja short def_471948"], [10, "mov eax, [rbp+errnum]"], [11, "mov rax, ds:jpt_471948[rax*8]"], [12, "jmp rax"], [13, "mov rax, [rbp+var_18]"], [14, "mov dword ptr [rax], 0FFFFFFEFh"], [15, "jmp short loc_4719A9"], [16, "mov rax, [rbp+var_18]"], [17, "mov dword ptr [rax], 0FFFFFFF3h"], [18, "jmp short loc_4719A9"], [19, "mov rax, [rbp+var_18]"], [20, "mov dword ptr [rax], 0FFFFFFF0h"], [21, "jmp short loc_4719A9"], [22, "mov rax, [rbp+var_18]"], [23, "mov dword ptr [rax], 0FFFFFFF2h"], [24, "jmp short loc_4719A9"], [25, "mov rax, [rbp+var_18]"], [26, "mov dword ptr [rax], 0FFFFFFEEh"], [27, "jmp short loc_4719A9"], [28, "mov rax, [rbp+var_18]"], [29, "mov dword ptr [rax], 0FFFFFFF5h"], [30, "jmp short loc_4719A9"], [31, "mov rax, [rbp+var_18]"], [32, "mov dword ptr [rax], 0FFFFFFEDh"], [33, "jmp short loc_4719A9"], [34, "mov rax, [rbp+var_18]"], [35, "mov dword ptr [rax], 0FFFFFFF1h"], [36, "nop"], [37, "cmp [rbp+var_20], 0"], [38, "jz short loc_4719C1"], [39, "mov eax, [rbp+errnum]"], [40, "mov edi, eax"], [41, "call _strerror"], [42, "mov rdx, [rbp+var_20]"], [43, "mov [rdx], rax"], [44, "nop"], [45, "leave"], [46, "retn"]], "data_dep": [[6, 5], [7, 6], [8, 7], [9, 8], [10, 7], [12, 11], [13, 3], [14, 13], [16, 3], [17, 16], [19, 3], [20, 19], [22, 3], [23, 22], [25, 3], [26, 25], [28, 3], [29, 28], [31, 3], [32, 31], [34, 3], [35, 34], [37, 4], [38, 37], [39, 7], [40, 39], [42, 4], [43, 42], [43, 41], [46, 41], [46, 13], [46, 16], [46, 19], [46, 25], [46, 22], [46, 28], [46, 34], [46, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e_ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.jsonl.gz", "strip_func_name": "sub_47191D", "query": "\n\n\nchar *__fastcall sub_47191D(char *a1, char **a2)\n{\nchar *result; // rax\nint errnum; // [rsp+1Ch] [rbp-4h]\n\nerrnum = *__errno_location();\nswitch ( errnum )\n{\ncase 2:\nresult = a1;\n*(_DWORD *)a1 = -14;\nbreak;\ncase 5:\ncase 9:\ncase 22:\ncase 27:\nresult = a1;\n*(_DWORD *)a1 = -18;\nbreak;\ncase 12:\ncase 23:\ncase 24:\nresult = a1;\n*(_DWORD *)a1 = -19;\nbreak;\ncase 17:\ncase 20:\nresult = a1;\n*(_DWORD *)a1 = -13;\nbreak;\ncase 28:\nresult = a1;\n*(_DWORD *)a1 = -17;\nbreak;\ncase 36:\nresult = a1;\n*(_DWORD *)a1 = -11;\nbreak;\ncase 39:\nresult = a1;\n*(_DWORD *)a1 = -16;\nbreak;\ndefault:\nresult = a1;\n*(_DWORD *)a1 = -15;\nbreak;\n}\nif ( a2 )\n{\nresult = strerror(errnum);\n*a2 = result;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,errnum,sub_47191D,]", "hints": "[]", "response": "{'a1': 'status', 'a2': 'emsg', 'errnum': 'ecode', 'sub_47191D': 'setErrCode'}"} | [
[
0.7350053787231445,
0.710503339767456,
0.7083694338798523,
0.7070609927177429,
0.7059025764465332,
0.7042601108551025,
0.7026207447052002,
0.6990312337875366,
0.6968672275543213,
0.6927419900894165,
0.6925646662712097,
0.6901645660400391,
0.6881930828094482,
0.6863528490066528,
0.6819769144058228,
0.6784679889678955,
0.6765479445457458,
0.6721547245979309,
0.6697304248809814,
0.662879228591919
],
[
110923,
233300,
184686,
129911,
5161,
129920,
174360,
146422,
264658,
63553,
193053,
119553,
95957,
190932,
151484,
159691,
37725,
222253,
62563,
182617
]
] |
|
ublio_recyc_cmp | f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b | 0x09 | hfsfuse | NA | static inline int
ublio_recyc_cmp(struct ublio_cache *ubc1, struct ublio_cache *ubc2)
{
return SORT_BY(ubc1, ubc2, ->uc_atime,
SORT_BY(ubc1, ubc2, ->uc_off,
SORT_BY(ubc1, ubc2, ->uc_idx, 0)));
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A0FC", "function_addr": 4235516, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov rax, [rbp+var_8]"], [5, "mov rdx, [rax+8]"], [6, "mov rax, [rbp+var_10]"], [7, "mov rax, [rax+8]"], [8, "cmp rdx, rax"], [9, "jb loc_40A1A2"], [10, "mov rax, [rbp+var_8]"], [11, "mov rdx, [rax+8]"], [12, "mov rax, [rbp+var_10]"], [13, "mov rax, [rax+8]"], [14, "cmp rdx, rax"], [15, "ja short loc_40A19B"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdx, [rax]"], [18, "mov rax, [rbp+var_10]"], [19, "mov rax, [rax]"], [20, "cmp rdx, rax"], [21, "jl short loc_40A194"], [22, "mov rax, [rbp+var_8]"], [23, "mov rdx, [rax]"], [24, "mov rax, [rbp+var_10]"], [25, "mov rax, [rax]"], [26, "cmp rdx, rax"], [27, "jg short loc_40A18D"], [28, "mov rax, [rbp+var_8]"], [29, "mov edx, [rax+10h]"], [30, "mov rax, [rbp+var_10]"], [31, "mov eax, [rax+10h]"], [32, "cmp edx, eax"], [33, "jl short loc_40A186"], [34, "mov rax, [rbp+var_8]"], [35, "mov edx, [rax+10h]"], [36, "mov rax, [rbp+var_10]"], [37, "mov eax, [rax+10h]"], [38, "cmp edx, eax"], [39, "setnle al"], [40, "movzx eax, al"], [41, "jmp short loc_40A1A7"], [42, "mov eax, 0FFFFFFFFh"], [43, "jmp short loc_40A1A7"], [44, "mov eax, 1"], [45, "jmp short loc_40A1A7"], [46, "mov eax, 0FFFFFFFFh"], [47, "jmp short loc_40A1A7"], [48, "mov eax, 1"], [49, "jmp short loc_40A1A7"], [50, "mov eax, 0FFFFFFFFh"], [51, "pop rbp"], [52, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 3], [7, 6], [8, 5], [8, 7], [9, 8], [10, 2], [11, 10], [12, 3], [13, 12], [14, 13], [14, 11], [15, 14], [16, 2], [17, 16], [18, 3], [19, 18], [20, 17], [20, 19], [21, 20], [22, 2], [23, 22], [24, 3], [25, 24], [26, 23], [26, 25], [27, 26], [28, 2], [29, 28], [30, 3], [31, 30], [32, 31], [32, 29], [33, 32], [34, 2], [35, 34], [36, 3], [37, 36], [38, 35], [38, 37], [39, 37], [40, 39], [51, 0], [52, 40], [52, 46], [52, 42], [52, 48], [52, 44], [52, 50]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b_f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.jsonl.gz", "strip_func_name": "sub_40A0FC", "query": "\n\n\n__int64 __fastcall sub_40A0FC(__int64 a1, __int64 a2)\n{\nif ( *(_QWORD *)(a1 + 8) < *(_QWORD *)(a2 + 8) )\nreturn 0xFFFFFFFFLL;\nif ( *(_QWORD *)(a1 + 8) > *(_QWORD *)(a2 + 8) )\nreturn 1LL;\nif ( *(_QWORD *)a1 < *(_QWORD *)a2 )\nreturn 0xFFFFFFFFLL;\nif ( *(_QWORD *)a1 > *(_QWORD *)a2 )\nreturn 1LL;\nif ( *(_DWORD *)(a1 + 16) < *(_DWORD *)(a2 + 16) )\nreturn 0xFFFFFFFFLL;\nreturn *(_DWORD *)(a1 + 16) > *(_DWORD *)(a2 + 16);\n}\n\n\n\nQ:[a1,a2,sub_40A0FC,]", "hints": "[]", "response": "{'a1': 'ubc1', 'a2': 'ubc2', 'sub_40A0FC': 'ublio_recyc_cmp'}"} | [
[
0.8557426929473877,
0.8521370887756348,
0.844692587852478,
0.8405196070671082,
0.8370911478996277,
0.8351752161979675,
0.8340845704078674,
0.8285987377166748,
0.8266953229904175,
0.8241819143295288,
0.8223609924316406,
0.8216848969459534,
0.8178288340568542,
0.8137927651405334,
0.8059779405593872,
0.8031784892082214,
0.8018978238105774,
0.7865645289421082,
0.7631341218948364,
0.7603607177734375
],
[
229885,
50008,
138137,
225413,
241720,
138416,
121577,
94333,
151181,
36588,
43230,
117389,
129739,
60277,
150190,
57376,
29713,
153831,
140990,
44041
]
] |
|
runget | d98286f5d3433fb0a873dfd7138bc9c2c977860b4ea909a617a034c75e7fe23c | HewlettPackard | nvthreads | NA | static int runget(int argc, char **argv){
char *path = NULL;
char *key = NULL;
TCCMP cmp = NULL;
int omode = 0;
bool sx = false;
bool px = false;
bool pz = false;
for(int i = 2; i < argc; i++){
if(!path && argv[i][0] == '-'){
if(!strcmp(argv[i], "-cd")){
cmp = tccmpdecimal;
} else if(!strcmp(argv[i], "-ci")){
cmp = tccmpint32;
} else if(!strcmp(argv[i], "-cj")){
cmp = tccmpint64;
} else if(!strcmp(argv[i], "-nl")){
omode |= BDBONOLCK;
} else if(!strcmp(argv[i], "-nb")){
omode |= BDBOLCKNB;
} else if(!strcmp(argv[i], "-sx")){
sx = true;
} else if(!strcmp(argv[i], "-px")){
px = true;
} else if(!strcmp(argv[i], "-pz")){
pz = true;
} else {
usage();
}
} else if(!path){
path = argv[i];
} else if(!key){
key = argv[i];
} else {
usage();
}
}
if(!path || !key) usage();
int ksiz;
char *kbuf;
if(sx){
kbuf = tchexdecode(key, &ksiz);
} else {
ksiz = strlen(key);
kbuf = tcmemdup(key, ksiz);
}
int rv = procget(path, kbuf, ksiz, cmp, omode, px, pz);
tcfree(kbuf);
return rv;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4038D5", "function_addr": 4208853, "binary_name": "d98286f5d3433fb0a873dfd7138bc9c2c977860b4ea909a617a034c75e7fe23c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_44], edi"], [4, "mov [rbp+var_50], rsi"], [5, "mov [rbp+var_8], 0"], [6, "mov [rbp+s], 0"], [7, "mov [rbp+var_18], 0"], [8, "mov [rbp+var_1C], 0"], [9, "mov [rbp+var_1D], 0"], [10, "mov [rbp+var_1E], 0"], [11, "mov [rbp+var_1F], 0"], [12, "mov [rbp+var_24], 2"], [13, "jmp loc_403B4A"], [14, "cmp [rbp+var_8], 0"], [15, "jnz loc_403AF9"], [16, "mov eax, [rbp+var_24]"], [17, "cdqe"], [18, "lea rdx, ds:0[rax*8]"], [19, "mov rax, [rbp+var_50]"], [20, "add rax, rdx"], [21, "mov rax, [rax]"], [22, "movzx eax, byte ptr [rax]"], [23, "cmp al, 2Dh "], [24, "jnz loc_403AF9"], [25, "mov eax, [rbp+var_24]"], [26, "cdqe"], [27, "lea rdx, ds:0[rax*8]"], [28, "mov rax, [rbp+var_50]"], [29, "add rax, rdx"], [30, "mov rax, [rax]"], [31, "lea rsi, aCd"], [32, "mov rdi, rax"], [33, "call _strcmp"], [34, "test eax, eax"], [35, "jnz short loc_403982"], [36, "mov rax, cs:tccmpdecimal_ptr"], [37, "mov [rbp+var_18], rax"], [38, "jmp loc_403B46"], [39, "mov eax, [rbp+var_24]"], [40, "cdqe"], [41, "lea rdx, ds:0[rax*8]"], [42, "mov rax, [rbp+var_50]"], [43, "add rax, rdx"], [44, "mov rax, [rax]"], [45, "lea rsi, aCi"], [46, "mov rdi, rax"], [47, "call _strcmp"], [48, "test eax, eax"], [49, "jnz short loc_4039BC"], [50, "mov rax, cs:tccmpint32_ptr"], [51, "mov [rbp+var_18], rax"], [52, "jmp loc_403B46"], [53, "mov eax, [rbp+var_24]"], [54, "cdqe"], [55, "lea rdx, ds:0[rax*8]"], [56, "mov rax, [rbp+var_50]"], [57, "add rax, rdx"], [58, "mov rax, [rax]"], [59, "lea rsi, aCj"], [60, "mov rdi, rax"], [61, "call _strcmp"], [62, "test eax, eax"], [63, "jnz short loc_4039F6"], [64, "mov rax, cs:tccmpint64_ptr"], [65, "mov [rbp+var_18], rax"], [66, "jmp loc_403B46"], [67, "mov eax, [rbp+var_24]"], [68, "cdqe"], [69, "lea rdx, ds:0[rax*8]"], [70, "mov rax, [rbp+var_50]"], [71, "add rax, rdx"], [72, "mov rax, [rax]"], [73, "lea rsi, aNl"], [74, "mov rdi, rax"], [75, "call _strcmp"], [76, "test eax, eax"], [77, "jnz short loc_403A29"], [78, "or [rbp+var_1C], 10h"], [79, "jmp loc_403B46"], [80, "mov eax, [rbp+var_24]"], [81, "cdqe"], [82, "lea rdx, ds:0[rax*8]"], [83, "mov rax, [rbp+var_50]"], [84, "add rax, rdx"], [85, "mov rax, [rax]"], [86, "lea rsi, aNb"], [87, "mov rdi, rax"], [88, "call _strcmp"], [89, "test eax, eax"], [90, "jnz short loc_403A5C"], [91, "or [rbp+var_1C], 20h"], [92, "jmp loc_403B46"], [93, "mov eax, [rbp+var_24]"], [94, "cdqe"], [95, "lea rdx, ds:0[rax*8]"], [96, "mov rax, [rbp+var_50]"], [97, "add rax, rdx"], [98, "mov rax, [rax]"], [99, "lea rsi, aSx"], [100, "mov rdi, rax"], [101, "call _strcmp"], [102, "test eax, eax"], [103, "jnz short loc_403A8F"], [104, "mov [rbp+var_1D], 1"], [105, "jmp loc_403B46"], [106, "mov eax, [rbp+var_24]"], [107, "cdqe"], [108, "lea rdx, ds:0[rax*8]"], [109, "mov rax, [rbp+var_50]"], [110, "add rax, rdx"], [111, "mov rax, [rax]"], [112, "lea rsi, aPx"], [113, "mov rdi, rax"], [114, "call _strcmp"], [115, "test eax, eax"], [116, "jnz short loc_403AC2"], [117, "mov [rbp+var_1E], 1"], [118, "jmp loc_403B46"], [119, "mov eax, [rbp+var_24]"], [120, "cdqe"], [121, "lea rdx, ds:0[rax*8]"], [122, "mov rax, [rbp+var_50]"], [123, "add rax, rdx"], [124, "mov rax, [rax]"], [125, "lea rsi, aPz"], [126, "mov rdi, rax"], [127, "call _strcmp"], [128, "test eax, eax"], [129, "jnz short loc_403AF2"], [130, "mov [rbp+var_1F], 1"], [131, "jmp short loc_403B46"], [132, "call sub_4028C0"], [133, "jmp short loc_403B46"], [134, "cmp [rbp+var_8], 0"], [135, "jnz short loc_403B1D"], [136, "mov eax, [rbp+var_24]"], [137, "cdqe"], [138, "lea rdx, ds:0[rax*8]"], [139, "mov rax, [rbp+var_50]"], [140, "add rax, rdx"], [141, "mov rax, [rax]"], [142, "mov [rbp+var_8], rax"], [143, "jmp short loc_403B46"], [144, "cmp [rbp+s], 0"], [145, "jnz short loc_403B41"], [146, "mov eax, [rbp+var_24]"], [147, "cdqe"], [148, "lea rdx, ds:0[rax*8]"], [149, "mov rax, [rbp+var_50]"], [150, "add rax, rdx"], [151, "mov rax, [rax]"], [152, "mov [rbp+s], rax"], [153, "jmp short loc_403B46"], [154, "call sub_4028C0"], [155, "add [rbp+var_24], 1"], [156, "mov eax, [rbp+var_24]"], [157, "cmp eax, [rbp+var_44]"], [158, "jl loc_40391B"], [159, "cmp [rbp+var_8], 0"], [160, "jz short loc_403B64"], [161, "cmp [rbp+s], 0"], [162, "jnz short loc_403B69"], [163, "call sub_4028C0"], [164, "cmp [rbp+var_1D], 0"], [165, "jz short loc_403B88"], [166, "lea rdx, [rbp+var_38]"], [167, "mov rax, [rbp+s]"], [168, "mov rsi, rdx"], [169, "mov rdi, rax"], [170, "call _tchexdecode"], [171, "mov [rbp+var_30], rax"], [172, "jmp short loc_403BB0"], [173, "mov rax, [rbp+s]"], [174, "mov rdi, rax"], [175, "call _strlen"], [176, "mov [rbp+var_38], eax"], [177, "mov eax, [rbp+var_38]"], [178, "movsxd rdx, eax"], [179, "mov rax, [rbp+s]"], [180, "mov rsi, rdx"], [181, "mov rdi, rax"], [182, "call _tcmemdup"], [183, "mov [rbp+var_30], rax"], [184, "movzx edi, [rbp+var_1F]"], [185, "movzx r9d, [rbp+var_1E]"], [186, "mov edx, [rbp+var_38]"], [187, "mov r8d, [rbp+var_1C]"], [188, "mov rcx, [rbp+var_18]"], [189, "mov rsi, [rbp+var_30]"], [190, "mov rax, [rbp+var_8]"], [191, "sub rsp, 8"], [192, "push rdi"], [193, "mov rdi, rax"], [194, "call sub_405272"], [195, "add rsp, 10h"], [196, "mov [rbp+var_34], eax"], [197, "mov rax, [rbp+var_30]"], [198, "mov rdi, rax"], [199, "call _tcfree"], [200, "mov eax, [rbp+var_34]"], [201, "leave"], [202, "retn"]], "data_dep": [[14, 5], [14, 142], [15, 14], [16, 12], [16, 155], [18, 108], [18, 138], [18, 69], [18, 55], [18, 82], [18, 121], [18, 41], [18, 27], [18, 148], [18, 95], [19, 4], [20, 19], [20, 18], [21, 20], [22, 21], [23, 22], [24, 23], [25, 155], [25, 12], [27, 18], [28, 4], [29, 27], [29, 28], [30, 29], [31, 86], [31, 31], [31, 99], [31, 73], [31, 112], [31, 59], [31, 125], [31, 45], [32, 30], [34, 33], [35, 34], [37, 36], [39, 12], [39, 155], [41, 27], [42, 4], [43, 41], [43, 42], [44, 43], [45, 31], [46, 44], [48, 47], [49, 48], [51, 50], [53, 155], [53, 12], [55, 41], [56, 4], [57, 56], [57, 55], [58, 57], [59, 45], [60, 58], [62, 61], [63, 62], [65, 64], [67, 12], [67, 155], [69, 55], [70, 4], [71, 69], [71, 70], [72, 71], [73, 59], [74, 72], [76, 75], [77, 76], [78, 8], [78, 78], [78, 91], [80, 12], [80, 155], [82, 69], [83, 4], [84, 83], [84, 82], [85, 84], [86, 73], [87, 85], [89, 88], [90, 89], [91, 91], [91, 8], [91, 78], [93, 12], [93, 155], [95, 82], [96, 4], [97, 95], [97, 96], [98, 97], [99, 86], [100, 98], [102, 101], [103, 102], [106, 12], [106, 155], [108, 95], [109, 4], [110, 109], [110, 108], [111, 110], [112, 99], [113, 111], [115, 114], [116, 115], [119, 155], [119, 12], [121, 108], [122, 4], [123, 121], [123, 122], [124, 123], [125, 112], [126, 124], [128, 127], [129, 128], [134, 5], [134, 142], [135, 134], [136, 155], [136, 12], [138, 55], [138, 69], [138, 41], [138, 18], [138, 82], [138, 27], [138, 121], [138, 148], [138, 138], [138, 95], [138, 108], [139, 4], [140, 139], [140, 138], [141, 140], [142, 141], [144, 6], [144, 152], [145, 144], [146, 12], [146, 155], [148, 95], [148, 138], [148, 69], [148, 108], [148, 55], [148, 121], [148, 41], [148, 18], [148, 82], [148, 27], [148, 148], [149, 4], [150, 148], [150, 149], [151, 150], [152, 151], [155, 12], [155, 155], [156, 155], [156, 12], [157, 3], [157, 156], [158, 157], [159, 142], [159, 5], [160, 159], [161, 6], [161, 152], [162, 161], [164, 9], [164, 104], [165, 164], [166, 55], [166, 121], [166, 41], [166, 82], [166, 27], [166, 148], [166, 95], [166, 138], [166, 69], [166, 108], [167, 6], [167, 152], [168, 166], [169, 167], [171, 170], [173, 6], [173, 152], [174, 173], [176, 175], [177, 176], [178, 177], [179, 6], [179, 152], [180, 178], [181, 179], [183, 182], [184, 11], [184, 130], [185, 10], [185, 117], [186, 176], [187, 78], [187, 91], [187, 8], [188, 65], [188, 51], [188, 37], [188, 7], [189, 183], [189, 171], [190, 5], [190, 142], [191, 2], [192, 184], [193, 190], [195, 191], [196, 194], [197, 183], [197, 171], [198, 197], [200, 196], [202, 200]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d98286f5d3433fb0a873dfd7138bc9c2c977860b4ea909a617a034c75e7fe23c_d98286f5d3433fb0a873dfd7138bc9c2c977860b4ea909a617a034c75e7fe23c.jsonl.gz", "strip_func_name": "sub_4038D5", "query": "\n\n\n__int64 __fastcall sub_4038D5(int a1, __int64 a2)\n{\nint v3; // [rsp+18h] [rbp-38h]\nunsigned int v4; // [rsp+1Ch] [rbp-34h]\nint v5; // [rsp+20h] [rbp-30h]\nint i; // [rsp+2Ch] [rbp-24h]\nunsigned __int8 v7; // [rsp+31h] [rbp-1Fh]\nunsigned __int8 v8; // [rsp+32h] [rbp-1Eh]\nchar v9; // [rsp+33h] [rbp-1Dh]\nint v10; // [rsp+34h] [rbp-1Ch]\nvoid *v11; // [rsp+38h] [rbp-18h]\nchar *s; // [rsp+40h] [rbp-10h]\n__int64 v13; // [rsp+48h] [rbp-8h]\n\nv13 = 0LL;\ns = 0LL;\nLODWORD(v11) = 0;\nv10 = 0;\nv9 = 0;\nv8 = 0;\nv7 = 0;\nfor ( i = 2; i < a1; ++i )\n{\nif ( v13 || **(_BYTE **)(8LL * i + a2) != 45 )\n{\nif ( v13 )\n{\nif ( s )\nsub_4028C0();\ns = *(char **)(8LL * i + a2);\n}\nelse\n{\nv13 = *(_QWORD *)(8LL * i + a2);\n}\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-cd\") )\n{\nv11 = &tccmpdecimal;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-ci\") )\n{\nv11 = &tccmpint32;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-cj\") )\n{\nv11 = &tccmpint64;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-nl\") )\n{\nv10 |= 0x10u;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-nb\") )\n{\nv10 |= 0x20u;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-sx\") )\n{\nv9 = 1;\n}\nelse if ( !strcmp(*(const char **)(8LL * i + a2), \"-px\") )\n{\nv8 = 1;\n}\nelse\n{\nif ( strcmp(*(const char **)(8LL * i + a2), \"-pz\") )\nsub_4028C0();\nv7 = 1;\n}\n}\nif ( !v13 || !s )\nsub_4028C0();\nif ( v9 )\n{\nv5 = tchexdecode();\n}\nelse\n{\nv3 = strlen(s);\nv5 = tcmemdup();\n}\nv4 = sub_405272(v13, v5, v3, (_DWORD)v11, v10, v8, v7);\ntcfree();\nreturn v4;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,v7,v8,v9,v10,v11,s,v13,sub_4038D5,sub_4028C0,sub_405272,]", "hints": "[]", "response": "{'a1': 'argc', 'a2': 'argv', 'v3': 'ksiz', 'v4': 'rv', 'v5': 'kbuf', 'v7': 'pz', 'v8': 'px', 'v9': 'sx', 'v10': 'omode', 'v11': 'cmp', 's': 'key', 'v13': 'path', 'sub_4038D5': 'runget', 'sub_4028C0': 'usage', 'sub_405272': 'procget'}"} | [
[
0.8233910202980042,
0.8072908520698547,
0.8065977692604065,
0.8051289319992065,
0.8043528199195862,
0.8011279106140137,
0.8006943464279175,
0.800661563873291,
0.7983947396278381,
0.7950683832168579,
0.7896682024002075,
0.7883392572402954,
0.7883323431015015,
0.786041259765625,
0.7856234908103943,
0.7851455211639404,
0.7851070165634155,
0.7848548889160156,
0.7845438718795776,
0.7841830253601074
],
[
130653,
59522,
129124,
253178,
163830,
82184,
3583,
219585,
105407,
109182,
122076,
35038,
140290,
190963,
46013,
153592,
192758,
35182,
198839,
177177
]
] |
|
prn_ptu | 498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63 | projecthorus | radiosonde_auto_rx | NA | static int prn_ptu(gpx_t *gpx) {
fprintf(stdout, " ");
if (gpx->T > -273.0) fprintf(stdout, " T=%.1fC ", gpx->T);
if (gpx->RH > -0.5 && gpx->option.ptu != 2) fprintf(stdout, " _RH=%.0f%% ", gpx->RH);
if (gpx->P > 0.0) {
if (gpx->P < 100.0) fprintf(stdout, " P=%.2fhPa ", gpx->P);
else fprintf(stdout, " P=%.1fhPa ", gpx->P);
}
if (gpx->option.ptu == 2) {
if (gpx->RH2 > -0.5) fprintf(stdout, " RH2=%.0f%% ", gpx->RH2);
}
// dew point
if (gpx->option.dwp)
{
float rh = gpx->RH;
float Td = -273.15f; // dew point Td
if (gpx->option.ptu == 2) rh = gpx->RH2;
if (rh > 0.0f && gpx->T > -273.0f) {
float gamma = logf(rh / 100.0f) + (17.625f * gpx->T / (243.04f + gpx->T));
Td = 243.04f * gamma / (17.625f - gamma);
fprintf(stdout, " Td=%.1fC ", Td);
}
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_406BDC", "function_addr": 4221916, "binary_name": "498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_18], rdi"], [4, "mov rax, cs:stdout"], [5, "mov rsi, rax"], [6, "mov edi, 20h "], [7, "call _fputc"], [8, "mov rax, [rbp+var_18]"], [9, "movss xmm0, dword ptr [rax+70h]"], [10, "comiss xmm0, cs:dword_4168F8"], [11, "jbe short loc_406C42"], [12, "mov rax, [rbp+var_18]"], [13, "movss xmm0, dword ptr [rax+70h]"], [14, "pxor xmm4, xmm4"], [15, "cvtss2sd xmm4, xmm0"], [16, "movq rdx, xmm4"], [17, "mov rax, cs:stdout"], [18, "movq xmm0, rdx"], [19, "mov esi, offset aT1fc"], [20, "mov rdi, rax"], [21, "mov eax, 1"], [22, "call _fprintf"], [23, "mov rax, [rbp+var_18]"], [24, "movss xmm0, dword ptr [rax+74h]"], [25, "comiss xmm0, cs:dword_416A54"], [26, "jbe short loc_406C97"], [27, "mov rax, [rbp+var_18]"], [28, "movzx eax, byte ptr [rax+0A87h]"], [29, "cmp al, 2"], [30, "jz short loc_406C97"], [31, "mov rax, [rbp+var_18]"], [32, "movss xmm0, dword ptr [rax+74h]"], [33, "pxor xmm5, xmm5"], [34, "cvtss2sd xmm5, xmm0"], [35, "movq rdx, xmm5"], [36, "mov rax, cs:stdout"], [37, "movq xmm0, rdx"], [38, "mov esi, offset aRh0f"], [39, "mov rdi, rax"], [40, "mov eax, 1"], [41, "call _fprintf"], [42, "mov rax, [rbp+var_18]"], [43, "movss xmm0, dword ptr [rax+7Ch]"], [44, "pxor xmm1, xmm1"], [45, "comiss xmm0, xmm1"], [46, "jbe loc_406D2D"], [47, "mov rax, [rbp+var_18]"], [48, "movss xmm1, dword ptr [rax+7Ch]"], [49, "movss xmm0, cs:dword_4168D0"], [50, "comiss xmm0, xmm1"], [51, "jbe short loc_406CF9"], [52, "mov rax, [rbp+var_18]"], [53, "movss xmm0, dword ptr [rax+7Ch]"], [54, "pxor xmm6, xmm6"], [55, "cvtss2sd xmm6, xmm0"], [56, "movq rdx, xmm6"], [57, "mov rax, cs:stdout"], [58, "movq xmm0, rdx"], [59, "mov esi, offset aP2fhpa"], [60, "mov rdi, rax"], [61, "mov eax, 1"], [62, "call _fprintf"], [63, "jmp short loc_406D2D"], [64, "mov rax, [rbp+var_18]"], [65, "movss xmm0, dword ptr [rax+7Ch]"], [66, "pxor xmm7, xmm7"], [67, "cvtss2sd xmm7, xmm0"], [68, "movq rdx, xmm7"], [69, "mov rax, cs:stdout"], [70, "movq xmm0, rdx"], [71, "mov esi, offset aP1fhpa"], [72, "mov rdi, rax"], [73, "mov eax, 1"], [74, "call _fprintf"], [75, "mov rax, [rbp+var_18]"], [76, "movzx eax, byte ptr [rax+0A87h]"], [77, "cmp al, 2"], [78, "jnz short loc_406D88"], [79, "mov rax, [rbp+var_18]"], [80, "movss xmm0, dword ptr [rax+80h]"], [81, "comiss xmm0, cs:dword_416A54"], [82, "jbe short loc_406D88"], [83, "mov rax, [rbp+var_18]"], [84, "movss xmm0, dword ptr [rax+80h]"], [85, "pxor xmm3, xmm3"], [86, "cvtss2sd xmm3, xmm0"], [87, "movq rdx, xmm3"], [88, "mov rax, cs:stdout"], [89, "movq xmm0, rdx"], [90, "mov esi, offset aRh20f"], [91, "mov rdi, rax"], [92, "mov eax, 1"], [93, "call _fprintf"], [94, "mov rax, [rbp+var_18]"], [95, "movzx eax, byte ptr [rax+0A88h]"], [96, "test al, al"], [97, "jz loc_406EA6"], [98, "mov rax, [rbp+var_18]"], [99, "movss xmm0, dword ptr [rax+74h]"], [100, "movss [rbp+var_4], xmm0"], [101, "movss xmm0, cs:dword_4168B8"], [102, "movss [rbp+var_8], xmm0"], [103, "mov rax, [rbp+var_18]"], [104, "movzx eax, byte ptr [rax+0A87h]"], [105, "cmp al, 2"], [106, "jnz short loc_406DD6"], [107, "mov rax, [rbp+var_18]"], [108, "movss xmm0, dword ptr [rax+80h]"], [109, "movss [rbp+var_4], xmm0"], [110, "movss xmm0, [rbp+var_4]"], [111, "pxor xmm1, xmm1"], [112, "comiss xmm0, xmm1"], [113, "jbe loc_406EA6"], [114, "mov rax, [rbp+var_18]"], [115, "movss xmm0, dword ptr [rax+70h]"], [116, "comiss xmm0, cs:dword_4168F8"], [117, "jbe loc_406EA6"], [118, "movss xmm0, [rbp+var_4]"], [119, "movss xmm1, cs:dword_4168D0"], [120, "divss xmm0, xmm1"], [121, "movd eax, xmm0"], [122, "movd xmm0, eax"], [123, "call _logf"], [124, "mov rax, [rbp+var_18]"], [125, "movss xmm2, dword ptr [rax+70h]"], [126, "movss xmm1, cs:dword_416A58"], [127, "mulss xmm1, xmm2"], [128, "mov rax, [rbp+var_18]"], [129, "movss xmm3, dword ptr [rax+70h]"], [130, "movss xmm2, cs:dword_416A5C"], [131, "addss xmm2, xmm3"], [132, "divss xmm1, xmm2"], [133, "addss xmm0, xmm1"], [134, "movss [rbp+var_C], xmm0"], [135, "movss xmm1, [rbp+var_C]"], [136, "movss xmm0, cs:dword_416A5C"], [137, "mulss xmm0, xmm1"], [138, "movss xmm1, cs:dword_416A58"], [139, "subss xmm1, [rbp+var_C]"], [140, "divss xmm0, xmm1"], [141, "movss [rbp+var_8], xmm0"], [142, "pxor xmm4, xmm4"], [143, "cvtss2sd xmm4, [rbp+var_8]"], [144, "movq rdx, xmm4"], [145, "mov rax, cs:stdout"], [146, "movq xmm0, rdx"], [147, "mov esi, offset aTd1fc"], [148, "mov rdi, rax"], [149, "mov eax, 1"], [150, "call _fprintf"], [151, "mov eax, 0"], [152, "leave"], [153, "retn"]], "data_dep": [[5, 4], [8, 3], [9, 8], [10, 9], [11, 2], [12, 3], [13, 12], [15, 14], [15, 13], [16, 15], [18, 16], [20, 17], [23, 3], [24, 23], [25, 24], [26, 2], [27, 3], [28, 27], [29, 28], [30, 29], [31, 3], [32, 31], [34, 32], [34, 33], [35, 34], [37, 35], [39, 36], [42, 3], [43, 42], [45, 43], [45, 44], [46, 2], [46, 29], [47, 3], [48, 47], [50, 49], [50, 48], [51, 2], [51, 29], [52, 3], [53, 52], [55, 54], [55, 53], [56, 55], [58, 56], [60, 57], [64, 3], [65, 64], [67, 65], [67, 66], [68, 67], [70, 68], [72, 69], [75, 3], [76, 75], [77, 76], [78, 77], [79, 3], [80, 79], [81, 80], [82, 77], [83, 3], [84, 83], [86, 85], [86, 84], [87, 86], [89, 87], [91, 88], [94, 3], [95, 94], [96, 95], [97, 96], [98, 3], [99, 98], [100, 99], [102, 101], [103, 3], [104, 103], [105, 104], [106, 105], [107, 3], [108, 107], [109, 108], [110, 109], [110, 100], [112, 111], [112, 110], [113, 105], [114, 3], [115, 114], [116, 115], [117, 105], [118, 100], [118, 109], [120, 119], [120, 118], [121, 120], [122, 121], [124, 3], [125, 124], [127, 125], [127, 126], [128, 3], [129, 128], [131, 129], [131, 130], [132, 127], [132, 131], [133, 132], [133, 122], [134, 133], [135, 134], [137, 135], [137, 136], [139, 134], [139, 138], [140, 137], [140, 139], [141, 140], [143, 142], [143, 141], [144, 143], [146, 144], [148, 145], [153, 151]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63_498b34fef3ab12184fac2c1224a5535b7045ee311fe13377d5b8aa31ea2d5a63.jsonl.gz", "strip_func_name": "sub_406BDC", "query": "\n\n\n__int64 __fastcall sub_406BDC(__int64 a1)\n{\n__m128i v1; // xmm0\nfloat v3; // [rsp+14h] [rbp-Ch]\nfloat v4; // [rsp+1Ch] [rbp-4h]\n\nfputc(32, stdout);\nif ( *(float *)(a1 + 112) > -273.0 )\nfprintf(stdout, \" T=%.1fC \", *(float *)(a1 + 112));\nif ( *(float *)(a1 + 116) > -0.5 && *(_BYTE *)(a1 + 2695) != 2 )\nfprintf(stdout, \" _RH=%.0f%% \", *(float *)(a1 + 116));\nif ( *(float *)(a1 + 124) > 0.0 )\n{\nif ( *(float *)(a1 + 124) >= 100.0 )\nfprintf(stdout, \" P=%.1fhPa \", *(float *)(a1 + 124));\nelse\nfprintf(stdout, \" P=%.2fhPa \", *(float *)(a1 + 124));\n}\nif ( *(_BYTE *)(a1 + 2695) == 2 && *(float *)(a1 + 128) > -0.5 )\nfprintf(stdout, \" RH2=%.0f%% \", *(float *)(a1 + 128));\nif ( *(_BYTE *)(a1 + 2696) )\n{\nv4 = *(float *)(a1 + 116);\nif ( *(_BYTE *)(a1 + 2695) == 2 )\nv4 = *(float *)(a1 + 128);\nif ( v4 > 0.0 && *(float *)(a1 + 112) > -273.0 )\n{\nv1 = (__m128i)LODWORD(v4);\n*(float *)v1.m128i_i32 = v4 / 100.0;\nv3 = logf(COERCE_FLOAT(_mm_cvtsi128_si32(v1)))\n+ (float)((float)(17.625 * *(float *)(a1 + 112)) / (float)(*(float *)(a1 + 112) + 243.03999));\nfprintf(stdout, \" Td=%.1fC \", (float)((float)(243.03999 * v3) / (float)(17.625 - v3)));\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,v3,v4,sub_406BDC,]", "hints": "[]", "response": "{'a1': 'gpx', 'v3': 'gamma', 'v4': 'rh', 'sub_406BDC': 'prn_ptu'}"} | [
[
0.7927128076553345,
0.7390971183776855,
0.7359287142753601,
0.7057644128799438,
0.7034345269203186,
0.6863745450973511,
0.6828561425209045,
0.681890606880188,
0.6733568906784058,
0.6705583333969116,
0.6693413257598877,
0.6692184805870056,
0.6685584783554077,
0.6677064895629883,
0.6672306060791016,
0.6670395731925964,
0.6620696783065796,
0.6605069637298584,
0.6589350700378418,
0.657720685005188
],
[
17408,
199434,
145689,
120476,
163435,
128827,
70534,
118953,
172975,
114774,
205994,
24888,
182103,
181091,
111232,
208362,
146245,
61598,
173800,
159681
]
] |
|
arm_fir_decimate_init_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | arm_status arm_fir_decimate_init_q31(
arm_fir_decimate_instance_q31 * S,
uint16_t numTaps,
uint8_t M,
const q31_t * pCoeffs,
q31_t * pState,
uint32_t blockSize)
{
arm_status status;
/* The size of the input block must be a multiple of the decimation factor */
if ((blockSize % M) != 0U)
{
/* Set status as ARM_MATH_LENGTH_ERROR */
status = ARM_MATH_LENGTH_ERROR;
}
else
{
/* Assign filter taps */
S->numTaps = numTaps;
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Clear the state buffer. The size is always (blockSize + numTaps - 1) */
memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t));
/* Assign state pointer */
S->pState = pState;
/* Assign Decimation Factor */
S->M = M;
status = ARM_MATH_SUCCESS;
}
return (status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41813A", "function_addr": 4292922, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_18], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+s], r8"], [7, "mov [rbp+var_34], r9d"], [8, "mov [rbp+var_1C], ax"], [9, "mov eax, edx"], [10, "mov [rbp+var_20], al"], [11, "movzx ecx, [rbp+var_20]"], [12, "mov eax, [rbp+var_34]"], [13, "mov edx, 0"], [14, "div ecx"], [15, "mov eax, edx"], [16, "test eax, eax"], [17, "jz short loc_41817A"], [18, "mov [rbp+var_4], 0FFFFFFFEh"], [19, "jmp short loc_4181D6"], [20, "mov rax, [rbp+var_18]"], [21, "movzx edx, [rbp+var_1C]"], [22, "mov [rax+2], dx"], [23, "mov rax, [rbp+var_18]"], [24, "mov rdx, [rbp+var_28]"], [25, "mov [rax+8], rdx"], [26, "movzx edx, [rbp+var_1C]"], [27, "mov eax, [rbp+var_34]"], [28, "add eax, edx"], [29, "sub eax, 1"], [30, "mov eax, eax"], [31, "lea rdx, ds:0[rax*4]"], [32, "mov rax, [rbp+s]"], [33, "mov esi, 0"], [34, "mov rdi, rax"], [35, "call _memset"], [36, "mov rax, [rbp+var_18]"], [37, "mov rdx, [rbp+s]"], [38, "mov [rax+10h], rdx"], [39, "mov rax, [rbp+var_18]"], [40, "movzx edx, [rbp+var_20]"], [41, "mov [rax], dl"], [42, "mov [rbp+var_4], 0"], [43, "mov eax, [rbp+var_4]"], [44, "leave"], [45, "retn"]], "data_dep": [[8, 4], [10, 9], [11, 10], [12, 7], [14, 11], [15, 13], [16, 15], [17, 16], [20, 3], [21, 8], [22, 20], [22, 21], [23, 3], [24, 5], [25, 23], [25, 24], [26, 8], [27, 7], [28, 27], [28, 26], [29, 28], [30, 29], [31, 26], [32, 6], [34, 32], [36, 3], [37, 6], [38, 37], [38, 36], [39, 3], [40, 10], [41, 40], [41, 39], [43, 18], [43, 42], [45, 43]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec_3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.jsonl.gz", "strip_func_name": "sub_41813A", "query": "\n\n\n__int64 __fastcall sub_41813A(__int64 a1, unsigned __int16 a2, unsigned __int8 a3, __int64 a4, void *a5, unsigned int a6)\n{\nif ( a6 % a3 )\nreturn (unsigned int)-2;\n*(_WORD *)(a1 + 2) = a2;\n*(_QWORD *)(a1 + 8) = a4;\nmemset(a5, 0, 4LL * (a2 + a6 - 1));\n*(_QWORD *)(a1 + 16) = a5;\n*(_BYTE *)a1 = a3;\nreturn 0;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,sub_41813A,]", "hints": "[]", "response": "{'a3': 'M', 'a4': 'pCoeffs', 'a1': 'S', 'a2': 'numTaps', 'a5': 'pState', 'a6': 'blockSize', 'sub_41813A': 'arm_fir_decimate_init_q31'}"} | [
[
0.7342394590377808,
0.7316980361938477,
0.719253420829773,
0.7181870937347412,
0.7153451442718506,
0.7143205404281616,
0.7140064835548401,
0.7094185948371887,
0.7059065699577332,
0.7048857808113098,
0.6985416412353516,
0.6982517242431641,
0.697507381439209,
0.6939312219619751,
0.6933090686798096,
0.6914624571800232,
0.6907983422279358,
0.6906198859214783,
0.688770592212677,
0.6874756813049316
],
[
165357,
86221,
9026,
20582,
188413,
177926,
26332,
4807,
236246,
172127,
34894,
136908,
187012,
108242,
35605,
242167,
244743,
137487,
252235,
155327
]
] |
|
raw_cat | d918ccc1f6c726f35f70fdd78d6d70938105e223de36d4c964cc9c0c2cc2a45a | weiss | original-bsd | NA | void
raw_cat(rfd)
register int rfd;
{
register int nr, nw, off, wfd;
static int bsize;
static char *buf;
struct stat sbuf;
wfd = fileno(stdout);
if (buf == NULL) {
if (fstat(wfd, &sbuf))
err(1, "%s", filename);
bsize = MAX(sbuf.st_blksize, 1024);
if ((buf = malloc((u_int)bsize)) == NULL)
err(1, NULL);
}
while ((nr = read(rfd, buf, bsize)) > 0)
for (off = 0; nr; nr -= nw, off += nw)
if ((nw = write(wfd, buf + off, nr)) < 0)
err(1, "stdout");
if (nr < 0)
warn("%s", filename);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401848", "function_addr": 4200520, "binary_name": "d918ccc1f6c726f35f70fdd78d6d70938105e223de36d4c964cc9c0c2cc2a45a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r15"], [3, "push r14"], [4, "push r13"], [5, "push r12"], [6, "push rbx"], [7, "sub rsp, 98h"], [8, "mov r15d, edi"], [9, "mov rax, cs:stdout"], [10, "mov rdi, rax"], [11, "call _fileno"], [12, "mov r13d, eax"], [13, "mov rax, cs:buf"], [14, "test rax, rax"], [15, "jnz loc_401954"], [16, "lea rax, [rbp+stat_buf]"], [17, "mov rsi, rax"], [18, "mov edi, r13d"], [19, "call sub_401A20"], [20, "test eax, eax"], [21, "jz short loc_4018B5"], [22, "mov rax, cs:qword_404210"], [23, "mov rdx, rax"], [24, "mov esi, offset aS"], [25, "mov edi, 1"], [26, "mov eax, 0"], [27, "call _err"], [28, "mov rax, [rbp+stat_buf.st_blksize]"], [29, "mov edx, 400h"], [30, "cmp rax, 400h"], [31, "cmovl rax, rdx"], [32, "mov cs:size, eax"], [33, "mov eax, cs:size"], [34, "mov eax, eax"], [35, "mov rdi, rax"], [36, "call _malloc"], [37, "mov cs:buf, rax"], [38, "mov rax, cs:buf"], [39, "test rax, rax"], [40, "jnz short loc_401954"], [41, "mov esi, 0"], [42, "mov edi, 1"], [43, "mov eax, 0"], [44, "call _err"], [45, "mov r12d, 0"], [46, "jmp short loc_401950"], [47, "movsxd rax, ebx"], [48, "mov rcx, cs:buf"], [49, "movsxd rdx, r12d"], [50, "add rcx, rdx"], [51, "mov rdx, rax"], [52, "mov rsi, rcx"], [53, "mov edi, r13d"], [54, "call _write"], [55, "mov r14d, eax"], [56, "test r14d, r14d"], [57, "jns short loc_40194A"], [58, "mov esi, offset format"], [59, "mov edi, 1"], [60, "mov eax, 0"], [61, "call _err"], [62, "sub ebx, r14d"], [63, "add r12d, r14d"], [64, "test ebx, ebx"], [65, "jnz short loc_401910"], [66, "mov eax, cs:size"], [67, "movsxd rdx, eax"], [68, "mov rax, cs:buf"], [69, "mov rsi, rax"], [70, "mov edi, r15d"], [71, "call _read"], [72, "mov ebx, eax"], [73, "test ebx, ebx"], [74, "jg short loc_401908"], [75, "test ebx, ebx"], [76, "jns short loc_401992"], [77, "mov rax, cs:qword_404210"], [78, "mov rsi, rax"], [79, "mov edi, offset aS"], [80, "mov eax, 0"], [81, "call _warn"], [82, "nop"], [83, "add rsp, 98h"], [84, "pop rbx"], [85, "pop r12"], [86, "pop r13"], [87, "pop r14"], [88, "pop r15"], [89, "pop rbp"], [90, "retn"]], "data_dep": [[10, 9], [12, 11], [14, 13], [15, 14], [16, 14], [17, 16], [18, 12], [20, 19], [21, 20], [23, 22], [30, 28], [31, 29], [31, 30], [32, 31], [33, 32], [34, 33], [35, 34], [37, 36], [38, 37], [39, 38], [40, 39], [47, 64], [48, 37], [49, 45], [49, 63], [50, 49], [50, 48], [51, 47], [52, 50], [53, 12], [55, 54], [56, 55], [57, 56], [62, 56], [62, 64], [63, 45], [63, 63], [63, 56], [64, 62], [64, 73], [65, 64], [66, 32], [67, 66], [68, 37], [69, 68], [70, 8], [72, 71], [73, 72], [74, 73], [75, 73], [76, 75], [78, 77], [83, 7], [84, 6], [85, 5], [86, 4], [87, 3], [88, 2], [89, 0], [90, 81], [90, 71]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d918ccc1f6c726f35f70fdd78d6d70938105e223de36d4c964cc9c0c2cc2a45a_d918ccc1f6c726f35f70fdd78d6d70938105e223de36d4c964cc9c0c2cc2a45a.jsonl.gz", "strip_func_name": "sub_401848", "query": "\n\n\nvoid __fastcall sub_401848(int fd)\n{\nint v1; // er13\nunsigned int v2; // eax\nint v3; // er12\nint v4; // er14\nint v5; // ebx\nstruct stat stat_buf; // [rsp+0h] [rbp-C0h] BYREF\n\nv1 = fileno(stdout);\nif ( !buf )\n{\nif ( (unsigned int)sub_401A20(v1, &stat_buf) )\nerr(1, \"%s\", (const char *)qword_404210);\nv2 = stat_buf.st_blksize;\nif ( stat_buf.st_blksize < 1024 )\nv2 = 1024;\nLODWORD(size) = v2;\nbuf = malloc(v2);\nif ( !buf )\nerr(1, 0LL);\n}\nwhile ( 1 )\n{\nv5 = read(fd, buf, (int)size);\nif ( v5 <= 0 )\nbreak;\nv3 = 0;\nwhile ( v5 )\n{\nv4 = write(v1, (char *)buf + v3, v5);\nif ( v4 < 0 )\nerr(1, \"stdout\");\nv5 -= v4;\nv3 += v4;\n}\n}\nif ( v5 < 0 )\nwarn(\"%s\", (const char *)qword_404210);\n}\n\n\n\nQ:[stat_buf,sub_401848,sub_401A20,]", "hints": "[]", "response": "{'stat_buf': 'sbuf', 'sub_401848': 'raw_cat', 'sub_401A20': 'fstat'}"} | [
[
0.7664343118667603,
0.7599582672119141,
0.759131133556366,
0.7494596242904663,
0.7467284202575684,
0.7336031198501587,
0.7283328771591187,
0.7276501059532166,
0.7263193726539612,
0.7192214131355286,
0.7155259847640991,
0.7129242420196533,
0.7118269801139832,
0.7115211486816406,
0.7114337682723999,
0.7049746513366699,
0.7029792666435242,
0.7005268335342407,
0.7004252076148987,
0.700381875038147
],
[
247988,
218751,
31084,
231833,
169962,
10843,
221259,
114777,
18978,
254525,
100491,
245742,
51810,
238837,
260676,
87663,
164293,
190334,
64742,
90462
]
] |
|
random_match | 25dbfcfa1cb2c526de5537a3e8aa6815d082e5de6c9c76d0743b74cf2f5a6675 | p4lang | p4factory | NA | void
random_match(of_match_t *match)
{
memset(match, 0, sizeof(*match));
match->version = OF_VERSION_1_3;
uint8_t *fields = (uint8_t *)&match->fields;
uint8_t *masks = (uint8_t *)&match->masks;
/*
* Use a very small portion of the match to ensure we get some
* equal/overlap/more-specific matches.
*
* The offsets used are intended to cover edge cases.
*/
const int match_offsets[] = { 0, 15*4, 15*4+1, 31*4, 32*4, 48*4, 61*4 };
AIM_ASSERT(AIM_ARRAYSIZE(match_offsets)*2 <= 32);
uint32_t r = random();
int i;
for (i = 0; i < AIM_ARRAYSIZE(match_offsets); i++) {
uint8_t mask = r & 1;
r >>= 1;
uint8_t field = r & mask;
r >>= 1;
fields[match_offsets[i]] = field;
masks[match_offsets[i]] = mask;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40213E", "function_addr": 4202814, "binary_name": "25dbfcfa1cb2c526de5537a3e8aa6815d082e5de6c9c76d0743b74cf2f5a6675.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+s], rdi"], [4, "mov rax, [rbp+s]"], [5, "mov edx, 2D8h"], [6, "mov esi, 0"], [7, "mov rdi, rax"], [8, "call _memset"], [9, "mov rax, [rbp+s]"], [10, "mov dword ptr [rax], 4"], [11, "mov rax, [rbp+s]"], [12, "add rax, 8"], [13, "mov [rbp+var_10], rax"], [14, "mov rax, [rbp+s]"], [15, "add rax, 170h"], [16, "mov [rbp+var_18], rax"], [17, "mov [rbp+var_40], 0"], [18, "mov [rbp+var_3C], 3Ch "], [19, "mov [rbp+var_38], 3Dh "], [20, "mov [rbp+var_34], 7Ch "], [21, "mov [rbp+var_30], 80h"], [22, "mov [rbp+var_2C], 0C0h"], [23, "mov [rbp+var_28], 0F4h"], [24, "call _random"], [25, "mov [rbp+var_4], eax"], [26, "mov [rbp+var_8], 0"], [27, "jmp short loc_402214"], [28, "mov eax, [rbp+var_4]"], [29, "and eax, 1"], [30, "mov [rbp+var_19], al"], [31, "shr [rbp+var_4], 1"], [32, "mov eax, [rbp+var_4]"], [33, "and al, [rbp+var_19]"], [34, "mov [rbp+var_1A], al"], [35, "shr [rbp+var_4], 1"], [36, "mov eax, [rbp+var_8]"], [37, "cdqe"], [38, "mov eax, [rbp+rax*4+var_40]"], [39, "movsxd rdx, eax"], [40, "mov rax, [rbp+var_10]"], [41, "add rdx, rax"], [42, "movzx eax, [rbp+var_1A]"], [43, "mov [rdx], al"], [44, "mov eax, [rbp+var_8]"], [45, "cdqe"], [46, "mov eax, [rbp+rax*4+var_40]"], [47, "movsxd rdx, eax"], [48, "mov rax, [rbp+var_18]"], [49, "add rdx, rax"], [50, "movzx eax, [rbp+var_19]"], [51, "mov [rdx], al"], [52, "add [rbp+var_8], 1"], [53, "mov eax, [rbp+var_8]"], [54, "cmp eax, 6"], [55, "jbe short loc_4021C6"], [56, "nop"], [57, "nop"], [58, "leave"], [59, "retn"]], "data_dep": [[4, 3], [7, 4], [9, 3], [10, 9], [11, 3], [12, 11], [13, 12], [14, 3], [15, 14], [16, 15], [25, 24], [28, 35], [28, 25], [29, 28], [30, 29], [31, 35], [31, 25], [32, 31], [33, 32], [33, 30], [34, 33], [35, 31], [36, 52], [36, 26], [38, 36], [39, 38], [40, 13], [41, 40], [41, 39], [42, 34], [43, 42], [43, 41], [44, 26], [44, 52], [46, 44], [47, 46], [48, 16], [49, 47], [49, 48], [50, 30], [51, 50], [51, 49], [52, 52], [52, 26], [53, 26], [53, 52], [54, 53], [55, 54], [59, 53]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/25dbfcfa1cb2c526de5537a3e8aa6815d082e5de6c9c76d0743b74cf2f5a6675_25dbfcfa1cb2c526de5537a3e8aa6815d082e5de6c9c76d0743b74cf2f5a6675.jsonl.gz", "strip_func_name": "sub_40213E", "query": "\n\n\n__int64 __fastcall sub_40213E(_DWORD *a1)\n{\n__int64 result; // rax\nint v2[9]; // [rsp+10h] [rbp-40h]\nchar v3; // [rsp+36h] [rbp-1Ah]\nchar v4; // [rsp+37h] [rbp-19h]\n_DWORD *v5; // [rsp+38h] [rbp-18h]\n_DWORD *v6; // [rsp+40h] [rbp-10h]\nunsigned int i; // [rsp+48h] [rbp-8h]\nunsigned int v8; // [rsp+4Ch] [rbp-4h]\n\nmemset(a1, 0, 0x2D8uLL);\n*a1 = 4;\nv6 = a1 + 2;\nv5 = a1 + 92;\nv2[0] = 0;\nv2[1] = 60;\nv2[2] = 61;\nv2[3] = 124;\nv2[4] = 128;\nv2[5] = 192;\nv2[6] = 244;\nv8 = random();\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( i > 6 )\nbreak;\nv4 = v8 & 1;\nv8 >>= 1;\nv3 = v4 & v8;\nv8 >>= 1;\n*((_BYTE *)v6 + v2[i]) = v3;\n*((_BYTE *)v5 + v2[i]) = v4;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v2,v3,v4,v5,v6,v8,sub_40213E,]", "hints": "[]", "response": "{'a1': 'match', 'v2': 'match_offsets', 'v3': 'field', 'v4': 'mask', 'v5': 'masks', 'v6': 'fields', 'v8': 'r', 'sub_40213E': 'random_match'}"} | [
[
0.7627865076065063,
0.7452738285064697,
0.7321078181266785,
0.722288966178894,
0.7218891382217407,
0.7199876308441162,
0.7129499912261963,
0.7052590847015381,
0.7045646905899048,
0.7028032541275024,
0.7024595737457275,
0.7017274498939514,
0.6990649104118347,
0.6922346353530884,
0.6922346353530884,
0.6904387474060059,
0.6895506978034973,
0.6850233674049377,
0.6849231719970703,
0.6846507787704468
],
[
207583,
54358,
72286,
117806,
164003,
56968,
246156,
213550,
152905,
246547,
85413,
175599,
252953,
111731,
194259,
17980,
89143,
196856,
257422,
49600
]
] |
|
cubic_coef | 9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f | vampirefrog | mdxtools | NA | static void cubic_coef(spx_word32_t x, spx_word32_t interp[4])
{
/* Compute interpolation coefficients. I'm not sure whether this corresponds to cubic interpolation
but I know it's MMSE-optimal on a sinc */
spx_word32_t x2, x3;
x2 = MULT16_16_P15(x, x);
x3 = MULT16_16_P15(x, x2);
interp[0] = PSHR32(MULT16_16(QCONST16(-0.16667f, 15),x) + MULT16_16(QCONST16(0.16667f, 15),x3),15);
interp[1] = EXTRACT16(EXTEND32(x) + SHR32(SUB32(EXTEND32(x2),EXTEND32(x3)),1));
interp[3] = PSHR32(MULT16_16(QCONST16(-0.33333f, 15),x) + MULT16_16(QCONST16(.5f,15),x2) - MULT16_16(QCONST16(0.16667f, 15),x3),15);
/* Just to make sure we don't have rounding problems */
interp[2] = Q15_ONE-interp[0]-interp[1]-interp[3];
if (interp[2]<32767)
interp[2]+=1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4093AE", "function_addr": 4232110, "binary_name": "9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_14], edi"], [3, "mov [rbp+var_20], rsi"], [4, "mov eax, [rbp+var_14]"], [5, "imul eax, eax"], [6, "add eax, 4000h"], [7, "sar eax, 0Fh"], [8, "mov [rbp+var_4], eax"], [9, "mov eax, [rbp+var_14]"], [10, "imul eax, [rbp+var_4]"], [11, "add eax, 4000h"], [12, "sar eax, 0Fh"], [13, "mov [rbp+var_8], eax"], [14, "mov eax, [rbp+var_14]"], [15, "imul edx, eax, 0FFFFEAACh"], [16, "mov eax, [rbp+var_8]"], [17, "imul eax, 1555h"], [18, "add eax, edx"], [19, "add eax, 4000h"], [20, "sar eax, 0Fh"], [21, "mov edx, eax"], [22, "mov rax, [rbp+var_20]"], [23, "mov [rax], edx"], [24, "mov eax, [rbp+var_4]"], [25, "sub eax, [rbp+var_8]"], [26, "sar eax, 1"], [27, "mov ecx, eax"], [28, "mov rax, [rbp+var_20]"], [29, "add rax, 4"], [30, "mov edx, [rbp+var_14]"], [31, "add edx, ecx"], [32, "mov [rax], edx"], [33, "mov eax, [rbp+var_14]"], [34, "imul edx, eax, 0FFFFD556h"], [35, "mov eax, [rbp+var_4]"], [36, "shl eax, 0Eh"], [37, "add edx, eax"], [38, "mov eax, [rbp+var_8]"], [39, "imul eax, 0FFFFEAABh"], [40, "add eax, edx"], [41, "lea edx, [rax+4000h]"], [42, "mov rax, [rbp+var_20]"], [43, "add rax, 0Ch"], [44, "sar edx, 0Fh"], [45, "mov [rax], edx"], [46, "mov rax, [rbp+var_20]"], [47, "mov eax, [rax]"], [48, "mov edx, 7FFFh"], [49, "sub edx, eax"], [50, "mov rax, [rbp+var_20]"], [51, "add rax, 4"], [52, "mov eax, [rax]"], [53, "sub edx, eax"], [54, "mov rax, [rbp+var_20]"], [55, "add rax, 0Ch"], [56, "mov ecx, [rax]"], [57, "mov rax, [rbp+var_20]"], [58, "add rax, 8"], [59, "sub edx, ecx"], [60, "mov [rax], edx"], [61, "mov rax, [rbp+var_20]"], [62, "add rax, 8"], [63, "mov eax, [rax]"], [64, "cmp eax, 7FFEh"], [65, "jg short loc_40949F"], [66, "mov rax, [rbp+var_20]"], [67, "add rax, 8"], [68, "mov edx, [rax]"], [69, "mov rax, [rbp+var_20]"], [70, "add rax, 8"], [71, "add edx, 1"], [72, "mov [rax], edx"], [73, "nop"], [74, "pop rbp"], [75, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 5], [7, 6], [8, 7], [9, 2], [10, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 2], [15, 14], [16, 13], [17, 16], [18, 17], [18, 15], [19, 18], [20, 19], [21, 20], [22, 3], [23, 22], [23, 21], [24, 8], [25, 13], [25, 24], [26, 25], [27, 26], [28, 3], [29, 28], [30, 2], [31, 30], [31, 27], [32, 29], [32, 31], [33, 2], [34, 31], [34, 33], [35, 8], [36, 35], [37, 34], [37, 36], [38, 13], [39, 38], [40, 37], [40, 39], [41, 40], [41, 37], [41, 32], [42, 3], [43, 42], [44, 41], [45, 43], [45, 44], [46, 3], [47, 45], [47, 46], [49, 48], [49, 47], [50, 3], [51, 50], [52, 51], [52, 45], [53, 52], [53, 49], [54, 3], [55, 54], [56, 55], [56, 45], [57, 3], [58, 57], [59, 56], [59, 53], [60, 59], [60, 58], [61, 3], [62, 61], [63, 60], [63, 62], [64, 63], [65, 64], [66, 3], [67, 66], [68, 45], [68, 72], [68, 67], [68, 60], [68, 23], [68, 32], [69, 3], [70, 69], [71, 68], [72, 70], [72, 71], [74, 0], [75, 70], [75, 63]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f_9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.jsonl.gz", "strip_func_name": "sub_4093AE", "query": "\n\n\nunsigned __int64 __fastcall sub_4093AE(int a1, int *a2)\n{\nunsigned __int64 result; // rax\nint v3; // [rsp+18h] [rbp-8h]\nint v4; // [rsp+1Ch] [rbp-4h]\n\nv4 = (a1 * a1 + 0x4000) >> 15;\nv3 = (v4 * a1 + 0x4000) >> 15;\n*a2 = (-5460 * a1 + 5461 * v3 + 0x4000) >> 15;\na2[1] = ((v4 - v3) >> 1) + a1;\na2[3] = ((v4 << 14) - 10922 * a1 - 5461 * v3 + 0x4000) >> 15;\na2[2] = 0x7FFF - *a2 - a2[1] - a2[3];\nresult = (unsigned int)a2[2];\nif ( (int)result <= 32766 )\n{\nresult = (unsigned __int64)(a2 + 2);\n++a2[2];\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,v4,sub_4093AE,]", "hints": "[]", "response": "{'a1': 'x', 'a2': 'interp', 'v3': 'x3', 'v4': 'x2', 'sub_4093AE': 'cubic_coef'}"} | [
[
0.7723257541656494,
0.7225258350372314,
0.7085959911346436,
0.7010403871536255,
0.6968591213226318,
0.6962671279907227,
0.6950808167457581,
0.6917238831520081,
0.686693549156189,
0.685778021812439,
0.677135705947876,
0.674479603767395,
0.6704778671264648,
0.6697945594787598,
0.668947696685791,
0.6680393218994141,
0.6666725873947144,
0.6665910482406616,
0.6650164127349854,
0.6642615795135498
],
[
36606,
86142,
101019,
130782,
32561,
135472,
170468,
222788,
44474,
132323,
66983,
68328,
154307,
31052,
14534,
29198,
130013,
122026,
2105,
64582
]
] |
|
fixed_resampler_resample | 9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f | vampirefrog | mdxtools | NA | int fixed_resampler_resample(struct fixed_resampler *resampler, stream_sample_t *in, int *in_len, stream_sample_t *out, int *out_len) {
stream_sample_t *filter = resampler->table;
int ilen = *in_len, olen = *out_len;
while(olen) {
stream_sample_t x = 0;
if(resampler->counter == 0) {
x = resampler->history[resampler->num_zero_crossings - 1];
// printf("reading from history %d\n", x);
} else {
stream_sample_t *h1 = resampler->history;
stream_sample_t *h2 = &resampler->history[resampler->num_zero_crossings];
stream_sample_t *f1 = &filter[((resampler->num_zero_crossings - 1) * resampler->denominator + resampler->counter) * resampler->table_step];
stream_sample_t *f2 = &filter[(resampler->denominator - resampler->counter) * resampler->table_step];
for(int i = 0; i < resampler->num_zero_crossings; i++) {
stream_sample_t x1;
x1 = *h1 * *f1;
x += x1 / 32767;
x1 = *h2 * *f2;
x += x1 / 32767;
h1++;
h2++;
f1 -= resampler->denominator * resampler->table_step;
f2 += resampler->denominator * resampler->table_step;
}
// printf("computed x=%d\n", x);
}
// printf("counter=%d x=%d num_zero_crossings=%d ilen=%d olen=%d\n", resampler->counter, x, resampler->num_zero_crossings, ilen, olen);
resampler->counter += resampler->numerator;
while(resampler->counter >= resampler->denominator) {
stream_sample_t is;
if(ilen > 0) {
is = *in;
in++;
} else {
goto done;
}
ilen--;
resampler->counter -= resampler->denominator;
memmove(resampler->history, &resampler->history[1], sizeof(*resampler->history) * (resampler->num_zero_crossings * 2 - 1));
resampler->history[resampler->num_zero_crossings * 2 - 1] = is;
}
if(x > 32767) x = 32767;
if(x < -32767) x = -32767;
*out++ = x;
olen--;
}
done:
*in_len -= ilen;
*out_len -= olen;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40423A", "function_addr": 4211258, "binary_name": "9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "add rsp, 0FFFFFFFFFFFFFF80h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+var_60], rsi"], [5, "mov [rbp+var_68], rdx"], [6, "mov [rbp+var_70], rcx"], [7, "mov [rbp+var_78], r8"], [8, "mov rax, [rbp+var_58]"], [9, "mov rax, [rax]"], [10, "mov [rbp+var_40], rax"], [11, "mov rax, [rbp+var_68]"], [12, "mov eax, [rax]"], [13, "mov [rbp+var_4], eax"], [14, "mov rax, [rbp+var_78]"], [15, "mov eax, [rax]"], [16, "mov [rbp+var_8], eax"], [17, "jmp loc_404500"], [18, "mov [rbp+var_C], 0"], [19, "mov rax, [rbp+var_58]"], [20, "mov eax, [rax+18h]"], [21, "test eax, eax"], [22, "jnz short loc_4042B0"], [23, "mov rax, [rbp+var_58]"], [24, "mov rdx, [rax+20h]"], [25, "mov rax, [rbp+var_58]"], [26, "mov eax, [rax+14h]"], [27, "cdqe"], [28, "shl rax, 2"], [29, "sub rax, 4"], [30, "add rax, rdx"], [31, "mov eax, [rax]"], [32, "mov [rbp+var_C], eax"], [33, "jmp loc_40440E"], [34, "mov rax, [rbp+var_58]"], [35, "mov rax, [rax+20h]"], [36, "mov [rbp+var_18], rax"], [37, "mov rax, [rbp+var_58]"], [38, "mov rdx, [rax+20h]"], [39, "mov rax, [rbp+var_58]"], [40, "mov eax, [rax+14h]"], [41, "cdqe"], [42, "shl rax, 2"], [43, "add rax, rdx"], [44, "mov [rbp+var_20], rax"], [45, "mov rax, [rbp+var_58]"], [46, "mov eax, [rax+14h]"], [47, "lea edx, [rax-1]"], [48, "mov rax, [rbp+var_58]"], [49, "mov eax, [rax+10h]"], [50, "imul edx, eax"], [51, "mov rax, [rbp+var_58]"], [52, "mov eax, [rax+18h]"], [53, "add edx, eax"], [54, "mov rax, [rbp+var_58]"], [55, "mov eax, [rax+8]"], [56, "imul eax, edx"], [57, "cdqe"], [58, "lea rdx, ds:0[rax*4]"], [59, "mov rax, [rbp+var_40]"], [60, "add rax, rdx"], [61, "mov [rbp+var_28], rax"], [62, "mov rax, [rbp+var_58]"], [63, "mov edx, [rax+10h]"], [64, "mov rax, [rbp+var_58]"], [65, "mov eax, [rax+18h]"], [66, "sub edx, eax"], [67, "mov rax, [rbp+var_58]"], [68, "mov eax, [rax+8]"], [69, "imul eax, edx"], [70, "cdqe"], [71, "lea rdx, ds:0[rax*4]"], [72, "mov rax, [rbp+var_40]"], [73, "add rax, rdx"], [74, "mov [rbp+var_30], rax"], [75, "mov [rbp+var_34], 0"], [76, "jmp loc_4043FE"], [77, "mov rax, [rbp+var_18]"], [78, "mov edx, [rax]"], [79, "mov rax, [rbp+var_28]"], [80, "mov eax, [rax]"], [81, "imul eax, edx"], [82, "mov [rbp+var_44], eax"], [83, "mov eax, [rbp+var_44]"], [84, "movsxd rdx, eax"], [85, "imul rdx, 0FFFFFFFF80010003h"], [86, "shr rdx, 20h"], [87, "add edx, eax"], [88, "sar edx, 0Eh"], [89, "sar eax, 1Fh"], [90, "mov ecx, eax"], [91, "mov eax, edx"], [92, "sub eax, ecx"], [93, "add [rbp+var_C], eax"], [94, "mov rax, [rbp+var_20]"], [95, "mov edx, [rax]"], [96, "mov rax, [rbp+var_30]"], [97, "mov eax, [rax]"], [98, "imul eax, edx"], [99, "mov [rbp+var_44], eax"], [100, "mov eax, [rbp+var_44]"], [101, "movsxd rdx, eax"], [102, "imul rdx, 0FFFFFFFF80010003h"], [103, "shr rdx, 20h"], [104, "add edx, eax"], [105, "sar edx, 0Eh"], [106, "sar eax, 1Fh"], [107, "mov ecx, eax"], [108, "mov eax, edx"], [109, "sub eax, ecx"], [110, "add [rbp+var_C], eax"], [111, "add [rbp+var_18], 4"], [112, "add [rbp+var_20], 4"], [113, "mov rax, [rbp+var_58]"], [114, "mov edx, [rax+10h]"], [115, "mov rax, [rbp+var_58]"], [116, "mov eax, [rax+8]"], [117, "imul eax, edx"], [118, "cdqe"], [119, "shl rax, 2"], [120, "neg rax"], [121, "add [rbp+var_28], rax"], [122, "mov rax, [rbp+var_58]"], [123, "mov edx, [rax+10h]"], [124, "mov rax, [rbp+var_58]"], [125, "mov eax, [rax+8]"], [126, "imul eax, edx"], [127, "cdqe"], [128, "shl rax, 2"], [129, "add [rbp+var_30], rax"], [130, "add [rbp+var_34], 1"], [131, "mov rax, [rbp+var_58]"], [132, "mov eax, [rax+14h]"], [133, "cmp [rbp+var_34], eax"], [134, "jl loc_40434F"], [135, "mov rax, [rbp+var_58]"], [136, "mov edx, [rax+18h]"], [137, "mov rax, [rbp+var_58]"], [138, "mov eax, [rax+0Ch]"], [139, "add edx, eax"], [140, "mov rax, [rbp+var_58]"], [141, "mov [rax+18h], edx"], [142, "jmp loc_4044B5"], [143, "cmp [rbp+var_4], 0"], [144, "jle loc_40450C"], [145, "mov rax, [rbp+var_60]"], [146, "mov eax, [rax]"], [147, "mov [rbp+var_48], eax"], [148, "add [rbp+var_60], 4"], [149, "sub [rbp+var_4], 1"], [150, "mov rax, [rbp+var_58]"], [151, "mov edx, [rax+18h]"], [152, "mov rax, [rbp+var_58]"], [153, "mov eax, [rax+10h]"], [154, "sub edx, eax"], [155, "mov rax, [rbp+var_58]"], [156, "mov [rax+18h], edx"], [157, "mov rax, [rbp+var_58]"], [158, "mov eax, [rax+14h]"], [159, "add eax, eax"], [160, "sub eax, 1"], [161, "cdqe"], [162, "lea rdx, ds:0[rax*4]"], [163, "mov rax, [rbp+var_58]"], [164, "mov rax, [rax+20h]"], [165, "lea rcx, [rax+4]"], [166, "mov rax, [rbp+var_58]"], [167, "mov rax, [rax+20h]"], [168, "mov rsi, rcx"], [169, "mov rdi, rax"], [170, "call _memmove"], [171, "mov rax, [rbp+var_58]"], [172, "mov rdx, [rax+20h]"], [173, "mov rax, [rbp+var_58]"], [174, "mov eax, [rax+14h]"], [175, "add eax, eax"], [176, "cdqe"], [177, "shl rax, 2"], [178, "sub rax, 4"], [179, "add rdx, rax"], [180, "mov eax, [rbp+var_48]"], [181, "mov [rdx], eax"], [182, "mov rax, [rbp+var_58]"], [183, "mov edx, [rax+18h]"], [184, "mov rax, [rbp+var_58]"], [185, "mov eax, [rax+10h]"], [186, "cmp edx, eax"], [187, "jge loc_40442A"], [188, "cmp [rbp+var_C], 7FFFh"], [189, "jle short loc_4044DB"], [190, "mov [rbp+var_C], 7FFFh"], [191, "cmp [rbp+var_C], 0FFFF8001h"], [192, "jge short loc_4044EB"], [193, "mov [rbp+var_C], 0FFFF8001h"], [194, "mov rax, [rbp+var_70]"], [195, "lea rdx, [rax+4]"], [196, "mov [rbp+var_70], rdx"], [197, "mov edx, [rbp+var_C]"], [198, "mov [rax], edx"], [199, "sub [rbp+var_8], 1"], [200, "cmp [rbp+var_8], 0"], [201, "jnz loc_404278"], [202, "jmp short loc_40450D"], [203, "nop"], [204, "mov rax, [rbp+var_68]"], [205, "mov eax, [rax]"], [206, "sub eax, [rbp+var_4]"], [207, "mov edx, eax"], [208, "mov rax, [rbp+var_68]"], [209, "mov [rax], edx"], [210, "mov rax, [rbp+var_78]"], [211, "mov eax, [rax]"], [212, "sub eax, [rbp+var_8]"], [213, "mov edx, eax"], [214, "mov rax, [rbp+var_78]"], [215, "mov [rax], edx"], [216, "mov eax, 0"], [217, "leave"], [218, "retn"]], "data_dep": [[8, 3], [9, 8], [10, 9], [11, 5], [12, 11], [13, 12], [14, 7], [15, 14], [16, 15], [19, 3], [20, 19], [20, 181], [20, 198], [20, 156], [20, 141], [21, 20], [22, 21], [23, 3], [24, 181], [24, 198], [24, 156], [24, 141], [24, 23], [25, 3], [26, 25], [26, 141], [26, 181], [26, 198], [26, 156], [28, 26], [29, 28], [30, 29], [30, 24], [31, 181], [31, 198], [31, 156], [31, 30], [31, 141], [32, 31], [34, 3], [35, 181], [35, 198], [35, 156], [35, 141], [35, 34], [36, 35], [37, 3], [38, 181], [38, 198], [38, 156], [38, 141], [38, 37], [39, 3], [40, 198], [40, 156], [40, 141], [40, 39], [40, 181], [42, 40], [43, 38], [43, 42], [44, 43], [45, 3], [46, 181], [46, 198], [46, 45], [46, 156], [46, 141], [47, 38], [47, 181], [47, 46], [47, 198], [47, 156], [47, 141], [48, 3], [49, 181], [49, 198], [49, 156], [49, 48], [49, 141], [50, 47], [50, 49], [51, 3], [52, 51], [52, 181], [52, 198], [52, 156], [52, 141], [53, 52], [53, 50], [54, 3], [55, 181], [55, 198], [55, 54], [55, 156], [55, 141], [56, 53], [56, 55], [58, 53], [59, 10], [60, 59], [60, 58], [61, 60], [62, 3], [63, 141], [63, 181], [63, 198], [63, 156], [63, 62], [64, 3], [65, 64], [65, 198], [65, 156], [65, 141], [65, 181], [66, 65], [66, 63], [67, 3], [68, 198], [68, 156], [68, 141], [68, 67], [68, 181], [69, 66], [69, 68], [71, 66], [72, 10], [73, 72], [73, 71], [74, 73], [77, 36], [77, 111], [78, 77], [78, 198], [78, 156], [78, 141], [78, 181], [79, 121], [79, 61], [80, 79], [80, 181], [80, 198], [80, 156], [80, 141], [81, 78], [81, 80], [82, 81], [83, 82], [84, 83], [85, 84], [86, 85], [87, 83], [87, 86], [88, 87], [89, 83], [90, 89], [91, 88], [92, 91], [92, 90], [93, 18], [93, 92], [93, 110], [94, 112], [94, 44], [95, 198], [95, 156], [95, 141], [95, 94], [95, 181], [96, 74], [96, 129], [97, 156], [97, 141], [97, 181], [97, 96], [97, 198], [98, 97], [98, 95], [99, 98], [100, 99], [101, 100], [102, 101], [103, 102], [104, 100], [104, 103], [105, 104], [106, 100], [107, 106], [108, 105], [109, 107], [109, 108], [110, 109], [110, 93], [111, 36], [111, 111], [112, 44], [112, 112], [113, 3], [114, 198], [114, 156], [114, 141], [114, 113], [114, 181], [115, 3], [116, 198], [116, 156], [116, 141], [116, 181], [116, 115], [117, 116], [117, 114], [119, 117], [120, 119], [121, 61], [121, 121], [121, 120], [122, 3], [123, 181], [123, 198], [123, 156], [123, 141], [123, 122], [124, 3], [125, 124], [125, 198], [125, 156], [125, 141], [125, 181], [126, 125], [126, 123], [128, 126], [129, 128], [129, 74], [129, 129], [130, 75], [130, 130], [131, 3], [132, 141], [132, 131], [132, 181], [132, 198], [132, 156], [133, 132], [133, 75], [133, 130], [134, 133], [135, 3], [136, 135], [136, 198], [136, 156], [136, 141], [136, 181], [137, 3], [138, 198], [138, 156], [138, 137], [138, 141], [138, 181], [139, 138], [139, 136], [140, 3], [141, 140], [141, 139], [143, 149], [143, 13], [144, 143], [145, 148], [145, 4], [146, 198], [146, 156], [146, 141], [146, 145], [146, 181], [147, 146], [148, 148], [148, 4], [149, 149], [149, 13], [150, 3], [151, 141], [151, 150], [151, 181], [151, 198], [151, 156], [152, 3], [153, 181], [153, 152], [153, 198], [153, 156], [153, 141], [154, 151], [154, 153], [155, 3], [156, 154], [156, 155], [157, 3], [158, 157], [158, 156], [159, 158], [160, 159], [162, 154], [163, 3], [164, 163], [164, 156], [165, 156], [165, 165], [165, 164], [165, 107], [166, 3], [167, 166], [167, 156], [168, 165], [169, 167], [171, 3], [172, 171], [172, 156], [173, 3], [174, 156], [174, 173], [175, 174], [177, 175], [178, 177], [179, 178], [179, 172], [180, 147], [181, 180], [181, 179], [182, 3], [183, 182], [183, 181], [183, 198], [183, 156], [183, 141], [184, 3], [185, 156], [185, 198], [185, 184], [185, 141], [185, 181], [186, 185], [186, 183], [187, 186], [188, 32], [188, 18], [188, 110], [189, 188], [191, 190], [191, 32], [191, 18], [191, 110], [192, 191], [194, 196], [194, 6], [195, 198], [195, 183], [195, 141], [195, 181], [195, 194], [195, 156], [196, 195], [197, 190], [197, 32], [197, 18], [197, 110], [197, 193], [198, 194], [198, 197], [199, 199], [199, 16], [200, 16], [200, 199], [201, 200], [204, 5], [205, 215], [205, 209], [205, 204], [205, 181], [205, 198], [205, 156], [205, 141], [206, 149], [206, 205], [206, 13], [207, 206], [208, 5], [209, 208], [209, 207], [210, 7], [211, 210], [211, 209], [212, 211], [212, 16], [212, 199], [213, 212], [214, 7], [215, 214], [215, 213], [218, 216]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f_9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.jsonl.gz", "strip_func_name": "sub_40423A", "query": "\n\n\n__int64 __fastcall sub_40423A(__int64 *a1, int *a2, int *a3, int *a4, int *a5)\n{\nint *v5; // rax\nint v11; // [rsp+38h] [rbp-48h]\n__int64 v12; // [rsp+40h] [rbp-40h]\nint j; // [rsp+4Ch] [rbp-34h]\n_DWORD *v14; // [rsp+50h] [rbp-30h]\n_DWORD *v15; // [rsp+58h] [rbp-28h]\n_DWORD *v16; // [rsp+60h] [rbp-20h]\n_DWORD *v17; // [rsp+68h] [rbp-18h]\nint v18; // [rsp+74h] [rbp-Ch]\nint i; // [rsp+78h] [rbp-8h]\nint v20; // [rsp+7Ch] [rbp-4h]\n\nv12 = *a1;\nv20 = *a3;\nfor ( i = *a5; i; --i )\n{\nv18 = 0;\nif ( *((_DWORD *)a1 + 6) )\n{\nv17 = (_DWORD *)a1[4];\nv16 = &v17[*((int *)a1 + 5)];\nv15 = (_DWORD *)(4LL\n* (*((_DWORD *)a1 + 6) + *((_DWORD *)a1 + 4) * (*((_DWORD *)a1 + 5) - 1))\n* *((_DWORD *)a1 + 2)\n+ v12);\nv14 = (_DWORD *)(4LL * (*((_DWORD *)a1 + 4) - *((_DWORD *)a1 + 6)) * *((_DWORD *)a1 + 2) + v12);\nfor ( j = 0; j < *((_DWORD *)a1 + 5); ++j )\n{\nv18 += *v16++ * *v14 / 0x7FFF + *v17++ * *v15 / 0x7FFF;\nv15 -= *((_DWORD *)a1 + 4) * *((_DWORD *)a1 + 2);\nv14 += *((_DWORD *)a1 + 4) * *((_DWORD *)a1 + 2);\n}\n}\nelse\n{\nv18 = *(_DWORD *)(a1[4] + 4LL * *((int *)a1 + 5) - 4);\n}\n*((_DWORD *)a1 + 6) += *((_DWORD *)a1 + 3);\nwhile ( *((_DWORD *)a1 + 6) >= *((_DWORD *)a1 + 4) )\n{\nif ( v20 <= 0 )\ngoto LABEL_17;\nv11 = *a2++;\n--v20;\n*((_DWORD *)a1 + 6) -= *((_DWORD *)a1 + 4);\nmemmove((void *)a1[4], (const void *)(a1[4] + 4), 4LL * (2 * *((_DWORD *)a1 + 5) - 1));\n*(_DWORD *)(8LL * *((_DWORD *)a1 + 5) - 4 + a1[4]) = v11;\n}\nif ( v18 > 0x7FFF )\nv18 = 0x7FFF;\nif ( v18 < -32767 )\nv18 = -32767;\nv5 = a4++;\n*v5 = v18;\n}\nLABEL_17:\n*a3 -= v20;\n*a5 -= i;\nreturn 0LL;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,v11,v12,v14,v15,v16,v17,v18,i,v20,sub_40423A,]", "hints": "[]", "response": "{'a3': 'in_len', 'a4': 'out', 'a1': 'resampler', 'a2': 'in', 'a5': 'out_len', 'v11': 'is', 'v12': 'filter', 'v14': 'f2', 'v15': 'f1', 'v16': 'h2', 'v17': 'h1', 'v18': 'x', 'i': 'olen', 'v20': 'ilen', 'sub_40423A': 'fixed_resampler_resample'}"} | [
[
0.8184744715690613,
0.7906957864761353,
0.7854227423667908,
0.7809116840362549,
0.7798519134521484,
0.7596108913421631,
0.7537802457809448,
0.7536647915840149,
0.7536647915840149,
0.7496501803398132,
0.7470590472221375,
0.7389348745346069,
0.7363361120223999,
0.7333064079284668,
0.7324321269989014,
0.7281383275985718,
0.7277743220329285,
0.7265157699584961,
0.7220473289489746,
0.721993088722229
],
[
57478,
131579,
230704,
40886,
247903,
97738,
112254,
55693,
240978,
262469,
50388,
148298,
103878,
74631,
169768,
58322,
15901,
102633,
150724,
8303
]
] |
|
set_papchap | 2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5 | xelerance | xl2tpd | NA | int set_papchap (char *word, char *value, int context, void *item)
{
int result;
char *c;
struct lac *l = (struct lac *) item;
struct lns *n = (struct lns *) item;
if (set_boolean (word, value, &result))
return -1;
c = strchr (word, ' ');
c++;
switch (context & ~CONTEXT_DEFAULT)
{
case CONTEXT_LAC:
if (c[0] == 'p') /* PAP */
if (word[2] == 'f')
l->pap_refuse = result;
else
l->pap_require = result;
else if (c[0] == 'a') /* Authentication */
if (word[2] == 'f')
l->authself = !result;
else
l->authpeer = result;
else /* CHAP */ if (word[2] == 'f')
l->chap_refuse = result;
else
l->chap_require = result;
break;
case CONTEXT_LNS:
if (c[0] == 'p') /* PAP */
if (word[2] == 'f')
n->pap_refuse = result;
else
n->pap_require = result;
else if (c[0] == 'a') /* Authentication */
if (word[2] == 'f')
n->authself = !result;
else
n->authpeer = result;
else /* CHAP */ if (word[2] == 'f')
n->chap_refuse = result;
else
n->chap_require = result;
break;
default:
snprintf (filerr, sizeof (filerr), "'%s' not valid in this context\n",
word);
return -1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4161C6", "function_addr": 4284870, "binary_name": "2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+s], rdi"], [4, "mov [rbp+var_30], rsi"], [5, "mov [rbp+var_34], edx"], [6, "mov [rbp+var_40], rcx"], [7, "mov rax, [rbp+var_40]"], [8, "mov [rbp+var_8], rax"], [9, "mov rax, [rbp+var_40]"], [10, "mov [rbp+var_10], rax"], [11, "lea rdx, [rbp+var_1C]"], [12, "mov rcx, [rbp+var_30]"], [13, "mov rax, [rbp+s]"], [14, "mov rsi, rcx"], [15, "mov rdi, rax"], [16, "call sub_4152A5"], [17, "test eax, eax"], [18, "jz short loc_416212"], [19, "mov eax, 0FFFFFFFFh"], [20, "jmp locret_4163CC"], [21, "mov rax, [rbp+s]"], [22, "mov esi, 20h "], [23, "mov rdi, rax"], [24, "call _strchr"], [25, "mov [rbp+var_18], rax"], [26, "add [rbp+var_18], 1"], [27, "mov eax, [rbp+var_34]"], [28, "and ah, 0FEh"], [29, "cmp eax, 2"], [30, "jz loc_4162FB"], [31, "cmp eax, 3"], [32, "jnz loc_4163A0"], [33, "mov rax, [rbp+var_18]"], [34, "movzx eax, byte ptr [rax]"], [35, "cmp al, 70h "], [36, "jnz short loc_416282"], [37, "mov rax, [rbp+s]"], [38, "add rax, 2"], [39, "movzx eax, byte ptr [rax]"], [40, "cmp al, 66h "], [41, "jnz short loc_416270"], [42, "mov edx, [rbp+var_1C]"], [43, "mov rax, [rbp+var_8]"], [44, "mov [rax+244h], edx"], [45, "jmp loc_4163C7"], [46, "mov edx, [rbp+var_1C]"], [47, "mov rax, [rbp+var_8]"], [48, "mov [rax+23Ch], edx"], [49, "jmp loc_4163C7"], [50, "mov rax, [rbp+var_18]"], [51, "movzx eax, byte ptr [rax]"], [52, "cmp al, 61h "], [53, "jnz short loc_4162C8"], [54, "mov rax, [rbp+s]"], [55, "add rax, 2"], [56, "movzx eax, byte ptr [rax]"], [57, "cmp al, 66h "], [58, "jnz short loc_4162B6"], [59, "mov eax, [rbp+var_1C]"], [60, "test eax, eax"], [61, "setz al"], [62, "movzx edx, al"], [63, "mov rax, [rbp+var_8]"], [64, "mov [rax+238h], edx"], [65, "jmp loc_4163C7"], [66, "mov edx, [rbp+var_1C]"], [67, "mov rax, [rbp+var_8]"], [68, "mov [rax+234h], edx"], [69, "jmp loc_4163C7"], [70, "mov rax, [rbp+s]"], [71, "add rax, 2"], [72, "movzx eax, byte ptr [rax]"], [73, "cmp al, 66h "], [74, "jnz short loc_4162E9"], [75, "mov edx, [rbp+var_1C]"], [76, "mov rax, [rbp+var_8]"], [77, "mov [rax+248h], edx"], [78, "jmp loc_4163C7"], [79, "mov edx, [rbp+var_1C]"], [80, "mov rax, [rbp+var_8]"], [81, "mov [rax+240h], edx"], [82, "jmp loc_4163C7"], [83, "mov rax, [rbp+var_18]"], [84, "movzx eax, byte ptr [rax]"], [85, "cmp al, 70h "], [86, "jnz short loc_416339"], [87, "mov rax, [rbp+s]"], [88, "add rax, 2"], [89, "movzx eax, byte ptr [rax]"], [90, "cmp al, 66h "], [91, "jnz short loc_416327"], [92, "mov edx, [rbp+var_1C]"], [93, "mov rax, [rbp+var_10]"], [94, "mov [rax+1F0h], edx"], [95, "jmp loc_4163C7"], [96, "mov edx, [rbp+var_1C]"], [97, "mov rax, [rbp+var_10]"], [98, "mov [rax+1E8h], edx"], [99, "jmp loc_4163C7"], [100, "mov rax, [rbp+var_18]"], [101, "movzx eax, byte ptr [rax]"], [102, "cmp al, 61h "], [103, "jnz short loc_416373"], [104, "mov rax, [rbp+s]"], [105, "add rax, 2"], [106, "movzx eax, byte ptr [rax]"], [107, "cmp al, 66h "], [108, "jnz short loc_416367"], [109, "mov eax, [rbp+var_1C]"], [110, "test eax, eax"], [111, "setz al"], [112, "movzx edx, al"], [113, "mov rax, [rbp+var_10]"], [114, "mov [rax+34h], edx"], [115, "jmp short loc_4163C7"], [116, "mov edx, [rbp+var_1C]"], [117, "mov rax, [rbp+var_10]"], [118, "mov [rax+30h], edx"], [119, "jmp short loc_4163C7"], [120, "mov rax, [rbp+s]"], [121, "add rax, 2"], [122, "movzx eax, byte ptr [rax]"], [123, "cmp al, 66h "], [124, "jnz short loc_416391"], [125, "mov edx, [rbp+var_1C]"], [126, "mov rax, [rbp+var_10]"], [127, "mov [rax+1F4h], edx"], [128, "jmp short loc_4163C7"], [129, "mov edx, [rbp+var_1C]"], [130, "mov rax, [rbp+var_10]"], [131, "mov [rax+1ECh], edx"], [132, "jmp short loc_4163C7"], [133, "mov rax, [rbp+s]"], [134, "mov rcx, rax"], [135, "mov edx, offset aSNotValidInThi"], [136, "mov esi, 64h "], [137, "mov edi, offset byte_426340"], [138, "mov eax, 0"], [139, "call _snprintf"], [140, "mov eax, 0FFFFFFFFh"], [141, "jmp short locret_4163CC"], [142, "mov eax, 0"], [143, "leave"], [144, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 6], [10, 9], [12, 4], [13, 3], [14, 12], [15, 13], [17, 16], [18, 17], [21, 3], [23, 21], [25, 24], [26, 25], [27, 5], [28, 27], [29, 28], [30, 29], [31, 28], [32, 31], [33, 26], [34, 33], [35, 34], [36, 35], [37, 3], [38, 37], [39, 38], [40, 39], [41, 40], [43, 8], [44, 42], [44, 43], [47, 8], [48, 47], [48, 46], [50, 26], [51, 50], [52, 51], [53, 52], [54, 3], [55, 54], [56, 55], [57, 56], [58, 57], [60, 59], [61, 60], [62, 61], [63, 8], [64, 62], [64, 63], [67, 8], [68, 66], [68, 67], [70, 3], [71, 70], [72, 71], [73, 72], [74, 73], [76, 8], [77, 76], [77, 75], [80, 8], [81, 80], [81, 79], [83, 26], [84, 83], [85, 84], [86, 85], [87, 3], [88, 87], [89, 88], [90, 89], [91, 90], [93, 10], [94, 93], [94, 92], [97, 10], [98, 96], [98, 97], [100, 26], [101, 100], [102, 101], [103, 102], [104, 3], [105, 104], [106, 105], [107, 106], [108, 107], [110, 109], [111, 110], [112, 111], [113, 10], [114, 113], [114, 112], [117, 10], [118, 117], [118, 116], [120, 3], [121, 120], [122, 121], [123, 122], [124, 123], [126, 10], [127, 125], [127, 126], [130, 10], [131, 129], [131, 130], [133, 3], [134, 133], [144, 19], [144, 140], [144, 142]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5_2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5.jsonl.gz", "strip_func_name": "sub_4161C6", "query": "\n\n\n__int64 __fastcall sub_4161C6(__int64 a1, const char *a2, int a3, _DWORD *a4)\n{\nint v5; // eax\nint v7; // [rsp+24h] [rbp-1Ch] BYREF\nchar *v8; // [rsp+28h] [rbp-18h]\n_DWORD *v9; // [rsp+30h] [rbp-10h]\n_DWORD *v10; // [rsp+38h] [rbp-8h]\n\nv10 = a4;\nv9 = a4;\nif ( (unsigned int)sub_4152A5((const char *)a1, a2, &v7) )\nreturn 0xFFFFFFFFLL;\nv8 = strchr((const char *)a1, 32) + 1;\nv5 = a3;\nBYTE1(v5) = BYTE1(a3) & 0xFE;\nif ( v5 == 2 )\n{\nif ( *v8 == 112 )\n{\nif ( *(_BYTE *)(a1 + 2) == 102 )\nv9[124] = v7;\nelse\nv9[122] = v7;\n}\nelse if ( *v8 == 97 )\n{\nif ( *(_BYTE *)(a1 + 2) == 102 )\nv9[13] = v7 == 0;\nelse\nv9[12] = v7;\n}\nelse if ( *(_BYTE *)(a1 + 2) == 102 )\n{\nv9[125] = v7;\n}\nelse\n{\nv9[123] = v7;\n}\n}\nelse\n{\nif ( v5 != 3 )\n{\nsnprintf(byte_426340, 0x64uLL, \"'%s' not valid in this context\\n\", (const char *)a1);\nreturn 0xFFFFFFFFLL;\n}\nif ( *v8 == 112 )\n{\nif ( *(_BYTE *)(a1 + 2) == 102 )\nv10[145] = v7;\nelse\nv10[143] = v7;\n}\nelse if ( *v8 == 97 )\n{\nif ( *(_BYTE *)(a1 + 2) == 102 )\nv10[142] = v7 == 0;\nelse\nv10[141] = v7;\n}\nelse if ( *(_BYTE *)(a1 + 2) == 102 )\n{\nv10[146] = v7;\n}\nelse\n{\nv10[144] = v7;\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a4,a1,a2,v7,v8,v9,v10,sub_4161C6,sub_4152A5,]", "hints": "[]", "response": "{'a3': 'context', 'a4': 'item', 'a1': 'word', 'a2': 'value', 'v7': 'result', 'v8': 'c', 'v9': 'n', 'v10': 'l', 'sub_4161C6': 'set_papchap', 'sub_4152A5': 'set_boolean'}"} | [
[
0.7117746472358704,
0.7019383311271667,
0.689136266708374,
0.680928647518158,
0.6775027513504028,
0.6704596281051636,
0.6662977933883667,
0.6631779670715332,
0.6612514853477478,
0.6535083055496216,
0.6463557481765747,
0.6426043510437012,
0.6417414546012878,
0.6349318623542786,
0.6329219341278076,
0.6309993267059326,
0.6289206147193909,
0.628853976726532,
0.6266137361526489,
0.6258638501167297
],
[
108838,
17287,
29228,
10578,
131392,
260256,
130770,
217640,
195635,
152438,
133546,
260394,
100915,
153434,
10654,
20204,
255501,
208801,
194488,
257904
]
] |