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
|
---|---|---|---|---|---|---|---|---|---|
qrpc_raw_read_timeout | f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329 | coolsnowwolf | lede | NA | int qrpc_raw_read_timeout(const int sock_fd, const int timeout)
{
struct pollfd fds;
int ret;
fds.fd = sock_fd;
fds.events = POLLIN;
do {
ret = poll(&fds, 1, timeout);
} while (ret < 0 && errno == EINTR);
if (ret <= 0) {
return -1;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43CEB0", "function_addr": 4443824, "binary_name": "f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_14], edi"], [4, "mov [rbp+timeout], esi"], [5, "mov eax, [rbp+var_14]"], [6, "mov [rbp+fds.fd], eax"], [7, "mov [rbp+fds.events], 1"], [8, "mov edx, [rbp+timeout]"], [9, "lea rax, [rbp+fds]"], [10, "mov esi, 1"], [11, "mov rdi, rax"], [12, "call _poll"], [13, "mov [rbp+var_4], eax"], [14, "cmp [rbp+var_4], 0"], [15, "jns short loc_43CEF3"], [16, "call ___errno_location"], [17, "mov eax, [rax]"], [18, "cmp eax, 4"], [19, "jz short loc_43CECA"], [20, "cmp [rbp+var_4], 0"], [21, "jg short loc_43CF00"], [22, "mov eax, 0FFFFFFFFh"], [23, "jmp short locret_43CF05"], [24, "mov eax, 0"], [25, "leave"], [26, "retn"]], "data_dep": [[5, 3], [6, 5], [8, 4], [9, 5], [9, 17], [11, 9], [13, 12], [14, 13], [15, 14], [17, 16], [18, 17], [19, 18], [20, 13], [21, 20], [26, 24], [26, 22]]}
| {"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_43CEB0", "query": "\n\n\n__int64 __fastcall sub_43CEB0(int a1, int a2)\n{\n__int64 result; // rax\nstruct pollfd fds; // [rsp+14h] [rbp-Ch] BYREF\nint v4; // [rsp+1Ch] [rbp-4h]\n\nfds.fd = a1;\nfds.events = 1;\ndo\nv4 = poll(&fds, 1uLL, a2);\nwhile ( v4 < 0 && *__errno_location() == 4 );\nif ( v4 > 0 )\nresult = 0LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_43CEB0,]", "hints": "[]", "response": "{'a1': 'sock_fd', 'a2': 'timeout', 'sub_43CEB0': 'qrpc_raw_read_timeout'}"} | [
[
0.8253585696220398,
0.8239955902099609,
0.7964114546775818,
0.7939530611038208,
0.7764219641685486,
0.7761425375938416,
0.776127815246582,
0.7734009027481079,
0.7733503580093384,
0.7722861170768738,
0.7718331813812256,
0.7710359692573547,
0.7661098837852478,
0.7649231553077698,
0.7643983960151672,
0.7525919079780579,
0.7466555833816528,
0.7400022745132446,
0.7369053363800049,
0.7299909591674805
],
[
180407,
180438,
33617,
110235,
137897,
184864,
108599,
174717,
130282,
7117,
95146,
37565,
64082,
39907,
148686,
125003,
239176,
78030,
76092,
49263
]
] |
|
buf_add2_le | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static size_t buf_add2_le(buf_impl* attr, const uint16_t data) // append 16 bits value
{
if (attr->len < attr->size - 1) { // do we have room for 2 bytes
attr->bufptr[attr->len++] = data;
attr->bufptr[attr->len++] = data >> 8;
}
return attr->len;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4156BE", "function_addr": 4282046, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov eax, esi"], [4, "mov [rbp+var_C], ax"], [5, "mov rax, [rbp+var_8]"], [6, "mov edx, [rax+4]"], [7, "mov rax, [rbp+var_8]"], [8, "mov eax, [rax]"], [9, "sub eax, 1"], [10, "cmp edx, eax"], [11, "jge short loc_415730"], [12, "mov rax, [rbp+var_8]"], [13, "mov rsi, [rax+8]"], [14, "mov rax, [rbp+var_8]"], [15, "mov eax, [rax+4]"], [16, "lea ecx, [rax+1]"], [17, "mov rdx, [rbp+var_8]"], [18, "mov [rdx+4], ecx"], [19, "cdqe"], [20, "add rax, rsi"], [21, "movzx edx, [rbp+var_C]"], [22, "mov [rax], dl"], [23, "movzx eax, [rbp+var_C]"], [24, "shr ax, 8"], [25, "mov edi, eax"], [26, "mov rax, [rbp+var_8]"], [27, "mov rsi, [rax+8]"], [28, "mov rax, [rbp+var_8]"], [29, "mov eax, [rax+4]"], [30, "lea ecx, [rax+1]"], [31, "mov rdx, [rbp+var_8]"], [32, "mov [rdx+4], ecx"], [33, "cdqe"], [34, "add rax, rsi"], [35, "mov edx, edi"], [36, "mov [rax], dl"], [37, "mov rax, [rbp+var_8]"], [38, "mov eax, [rax+4]"], [39, "cdqe"], [40, "pop rbp"], [41, "retn"]], "data_dep": [[4, 3], [5, 2], [6, 5], [7, 2], [8, 7], [9, 8], [10, 6], [10, 9], [11, 10], [12, 2], [13, 12], [14, 2], [15, 14], [16, 15], [17, 2], [18, 17], [18, 16], [20, 13], [20, 15], [21, 4], [22, 20], [22, 21], [23, 4], [24, 23], [25, 24], [26, 2], [27, 22], [27, 26], [28, 2], [29, 22], [29, 28], [30, 29], [30, 16], [30, 22], [31, 2], [32, 31], [32, 30], [34, 27], [34, 29], [35, 25], [36, 34], [36, 35], [37, 2], [38, 32], [38, 22], [38, 37], [38, 18], [38, 36], [40, 0], [41, 38]]}
| {"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_4156BE", "query": "\n\n\n__int64 __fastcall sub_4156BE(__int64 a1, __int16 a2)\n{\n__int64 v2; // rsi\nint v3; // eax\n__int64 v4; // rsi\nint v5; // eax\n\nif ( *(_DWORD *)(a1 + 4) < *(_DWORD *)a1 - 1 )\n{\nv2 = *(_QWORD *)(a1 + 8);\nv3 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v3 + 1;\n*(_BYTE *)(v2 + v3) = a2;\nv4 = *(_QWORD *)(a1 + 8);\nv5 = *(_DWORD *)(a1 + 4);\n*(_DWORD *)(a1 + 4) = v5 + 1;\n*(_BYTE *)(v4 + v5) = HIBYTE(a2);\n}\nreturn *(int *)(a1 + 4);\n}\n\n\n\nQ:[a1,a2,sub_4156BE,]", "hints": "[]", "response": "{'a1': 'attr', 'a2': 'data', 'sub_4156BE': 'buf_add2_le'}"} | [
[
0.7649030685424805,
0.7568740844726562,
0.7271803617477417,
0.7251555919647217,
0.7109731435775757,
0.7091824412345886,
0.7075372338294983,
0.7073217630386353,
0.7062934041023254,
0.7061496376991272,
0.6994752287864685,
0.6976078748703003,
0.6964855790138245,
0.6945569515228271,
0.6918504238128662,
0.6907875537872314,
0.689215898513794,
0.6852271556854248,
0.6833728551864624,
0.6819642186164856
],
[
66220,
91291,
111644,
26878,
236817,
59370,
74753,
85057,
84153,
28955,
11871,
221804,
112364,
179428,
116217,
256170,
196232,
168931,
199929,
80423
]
] |
|
get_fci | 3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4 | sezero | mikmod | NA | static int get_fci(const char *in, int *pos)
{
int a;
int size;
size = 1;
a = in[0] & 0x3f;
if (in[0] & 0x40) {
size++;
a |= (in[1] & 0x7f) << 6;
if (in[1] & 0x80) {
size++;
a |= (in[2] & 0x7f) << 13;
if (in[2] & 0x80) {
size++;
a |= (in[3] & 0x7f) << 20;
if (in[3] & 0x80) {
size++;
a |= (in[4] & 0x3f) << 27;
}
}
}
}
if (in[0] & 0x80)
a = -a;
*pos += size;
return a;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4012E2", "function_addr": 4199138, "binary_name": "3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.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 [rbp+var_8], 1"], [5, "mov rax, [rbp+var_18]"], [6, "movzx eax, byte ptr [rax]"], [7, "movsx eax, al"], [8, "and eax, 3Fh"], [9, "mov [rbp+var_4], eax"], [10, "mov rax, [rbp+var_18]"], [11, "movzx eax, byte ptr [rax]"], [12, "movsx eax, al"], [13, "and eax, 40h"], [14, "test eax, eax"], [15, "jz loc_4013B6"], [16, "add [rbp+var_8], 1"], [17, "mov rax, [rbp+var_18]"], [18, "add rax, 1"], [19, "movzx eax, byte ptr [rax]"], [20, "movsx eax, al"], [21, "shl eax, 6"], [22, "and eax, 1FC0h"], [23, "or [rbp+var_4], eax"], [24, "mov rax, [rbp+var_18]"], [25, "add rax, 1"], [26, "movzx eax, byte ptr [rax]"], [27, "test al, al"], [28, "jns short loc_4013B6"], [29, "add [rbp+var_8], 1"], [30, "mov rax, [rbp+var_18]"], [31, "add rax, 2"], [32, "movzx eax, byte ptr [rax]"], [33, "movsx eax, al"], [34, "shl eax, 0Dh"], [35, "and eax, 0FE000h"], [36, "or [rbp+var_4], eax"], [37, "mov rax, [rbp+var_18]"], [38, "add rax, 2"], [39, "movzx eax, byte ptr [rax]"], [40, "test al, al"], [41, "jns short loc_4013B6"], [42, "add [rbp+var_8], 1"], [43, "mov rax, [rbp+var_18]"], [44, "add rax, 3"], [45, "movzx eax, byte ptr [rax]"], [46, "movsx eax, al"], [47, "shl eax, 14h"], [48, "and eax, 7F00000h"], [49, "or [rbp+var_4], eax"], [50, "mov rax, [rbp+var_18]"], [51, "add rax, 3"], [52, "movzx eax, byte ptr [rax]"], [53, "test al, al"], [54, "jns short loc_4013B6"], [55, "add [rbp+var_8], 1"], [56, "mov rax, [rbp+var_18]"], [57, "add rax, 4"], [58, "movzx eax, byte ptr [rax]"], [59, "movsx eax, al"], [60, "shl eax, 1Bh"], [61, "or [rbp+var_4], eax"], [62, "mov rax, [rbp+var_18]"], [63, "movzx eax, byte ptr [rax]"], [64, "test al, al"], [65, "jns short loc_4013C4"], [66, "neg [rbp+var_4]"], [67, "mov rax, [rbp+var_20]"], [68, "mov edx, [rax]"], [69, "mov eax, [rbp+var_8]"], [70, "add edx, eax"], [71, "mov rax, [rbp+var_20]"], [72, "mov [rax], edx"], [73, "mov eax, [rbp+var_4]"], [74, "pop rbp"], [75, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 7], [9, 8], [10, 2], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 4], [17, 2], [18, 17], [19, 18], [20, 19], [21, 20], [22, 21], [23, 22], [23, 9], [24, 2], [25, 24], [26, 25], [27, 26], [28, 27], [29, 16], [30, 2], [31, 30], [32, 31], [33, 32], [34, 33], [35, 34], [36, 35], [36, 23], [37, 2], [38, 37], [39, 38], [40, 39], [41, 40], [42, 29], [43, 2], [44, 43], [45, 44], [46, 45], [47, 46], [48, 47], [49, 48], [49, 36], [50, 2], [51, 50], [52, 51], [53, 52], [54, 53], [55, 42], [56, 2], [57, 56], [58, 57], [59, 58], [60, 59], [61, 49], [61, 60], [62, 2], [63, 62], [64, 63], [65, 64], [66, 23], [66, 9], [66, 61], [66, 36], [66, 49], [67, 3], [68, 67], [69, 42], [69, 16], [69, 55], [69, 4], [69, 29], [70, 68], [70, 69], [71, 3], [72, 70], [72, 71], [73, 23], [73, 9], [73, 66], [73, 61], [73, 36], [73, 49], [74, 0], [75, 73]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4_3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.jsonl.gz", "strip_func_name": "sub_4012E2", "query": "\n\n\n__int64 __fastcall sub_4012E2(char *a1, _DWORD *a2)\n{\nint v3; // [rsp+18h] [rbp-8h]\nunsigned int v4; // [rsp+1Ch] [rbp-4h]\n\nv3 = 1;\nv4 = *a1 & 0x3F;\nif ( (*a1 & 0x40) != 0 )\n{\nv3 = 2;\nv4 |= (a1[1] << 6) & 0x1FC0;\nif ( a1[1] < 0 )\n{\nv3 = 3;\nv4 |= (a1[2] << 13) & 0xFE000;\nif ( a1[2] < 0 )\n{\nv3 = 4;\nv4 |= (a1[3] << 20) & 0x7F00000;\nif ( a1[3] < 0 )\n{\nv3 = 5;\nv4 |= a1[4] << 27;\n}\n}\n}\n}\nif ( *a1 < 0 )\nv4 = -v4;\n*a2 += v3;\nreturn v4;\n}\n\n\n\nQ:[a1,a2,v3,v4,sub_4012E2,]", "hints": "[]", "response": "{'a1': 'in', 'a2': 'pos', 'v3': 'size', 'v4': 'a', 'sub_4012E2': 'get_fci'}"} | [
[
0.7378769516944885,
0.7364041209220886,
0.731194257736206,
0.7295325994491577,
0.72586590051651,
0.7253755331039429,
0.7234564423561096,
0.7221043705940247,
0.71999192237854,
0.719865083694458,
0.7182508707046509,
0.7168231010437012,
0.7142738699913025,
0.7142350673675537,
0.7136484980583191,
0.7136445045471191,
0.7104608416557312,
0.7101013660430908,
0.708882212638855,
0.7083780169487
],
[
148504,
122702,
139203,
75676,
75080,
68688,
209002,
191994,
167437,
100975,
249703,
15088,
199151,
117145,
226746,
151540,
125044,
46513,
55049,
151929
]
] |
|
load_ttl_from_file | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | int load_ttl_from_file(char *filename)
{
char *line = NULL;
size_t len = 0;
ssize_t read;
FILE *fp = fopen(filename, "r");
if (fp == NULL) {
// skip if file not exist
return 0;
}
while ((read = getline(&line, &len, fp)) != -1) {
// TODO: more robust checks
if (line[0] == '#')
continue;
if (read < 9)
continue;
char *ip = line;
char *tmp;
for (tmp = line; tmp != 0; tmp++) {
if (*tmp == ',') {
*tmp = 0;
tmp++;
break;
}
}
unsigned char ttl = atoi(tmp);
if (ip && ttl > 0)
set_ttl(str2ip(ip), ttl);
}
if (line)
free(line);
fclose(fp);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_411353", "function_addr": 4264787, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 58h"], [4, "mov [rbp+filename], rdi"], [5, "mov [rbp+lineptr], 0"], [6, "mov [rbp+n], 0"], [7, "mov rax, [rbp+filename]"], [8, "mov esi, offset aR_2"], [9, "mov rdi, rax"], [10, "call _fopen"], [11, "mov [rbp+stream], rax"], [12, "cmp [rbp+stream], 0"], [13, "jnz loc_41141C"], [14, "mov eax, 0"], [15, "jmp loc_411468"], [16, "mov rax, [rbp+lineptr]"], [17, "movzx eax, byte ptr [rax]"], [18, "cmp al, 23h "], [19, "jnz short loc_4113A7"], [20, "jmp short loc_41141C"], [21, "cmp [rbp+var_28], 8"], [22, "jg short loc_4113B0"], [23, "jmp short loc_41141C"], [24, "mov rax, [rbp+lineptr]"], [25, "mov [rbp+var_30], rax"], [26, "mov rax, [rbp+lineptr]"], [27, "mov [rbp+nptr], rax"], [28, "jmp short loc_4113E0"], [29, "mov rax, [rbp+nptr]"], [30, "movzx eax, byte ptr [rax]"], [31, "cmp al, 2Ch "], [32, "jnz short loc_4113DB"], [33, "mov rax, [rbp+nptr]"], [34, "mov byte ptr [rax], 0"], [35, "add [rbp+nptr], 1"], [36, "jmp short loc_4113E7"], [37, "add [rbp+nptr], 1"], [38, "cmp [rbp+nptr], 0"], [39, "jnz short loc_4113C2"], [40, "mov rax, [rbp+nptr]"], [41, "mov rdi, rax"], [42, "call _atoi"], [43, "mov [rbp+var_31], al"], [44, "cmp [rbp+var_30], 0"], [45, "jz short loc_41141C"], [46, "cmp [rbp+var_31], 0"], [47, "jz short loc_41141C"], [48, "movzx ebx, [rbp+var_31]"], [49, "mov rax, [rbp+var_30]"], [50, "mov rdi, rax"], [51, "call sub_406CEA"], [52, "mov esi, ebx"], [53, "mov edi, eax"], [54, "call sub_40FD7B"], [55, "mov rdx, [rbp+stream]"], [56, "lea rcx, [rbp+n]"], [57, "lea rax, [rbp+lineptr]"], [58, "mov rsi, rcx"], [59, "mov rdi, rax"], [60, "call _getline"], [61, "mov [rbp+var_28], rax"], [62, "cmp [rbp+var_28], 0FFFFFFFFFFFFFFFFh"], [63, "jnz loc_41139A"], [64, "mov rax, [rbp+lineptr]"], [65, "test rax, rax"], [66, "jz short loc_411457"], [67, "mov rax, [rbp+lineptr]"], [68, "mov rdi, rax"], [69, "call _free"], [70, "mov rax, [rbp+stream]"], [71, "mov rdi, rax"], [72, "call _fclose"], [73, "mov eax, 0"], [74, "mov rbx, [rbp+var_8]"], [75, "leave"], [76, "retn"]], "data_dep": [[7, 4], [9, 7], [11, 10], [12, 11], [13, 12], [16, 5], [17, 16], [17, 34], [18, 17], [19, 18], [21, 61], [22, 21], [24, 5], [25, 24], [26, 5], [27, 26], [29, 37], [29, 27], [30, 29], [30, 34], [31, 30], [32, 31], [33, 27], [33, 37], [34, 33], [35, 27], [35, 37], [37, 27], [37, 37], [38, 37], [38, 27], [39, 38], [40, 35], [40, 37], [40, 27], [41, 40], [43, 42], [44, 25], [45, 44], [46, 43], [47, 46], [48, 43], [49, 25], [50, 49], [52, 48], [53, 51], [55, 11], [56, 6], [56, 56], [57, 42], [57, 54], [57, 5], [57, 17], [57, 10], [58, 56], [59, 57], [61, 60], [62, 61], [63, 62], [64, 5], [65, 64], [66, 65], [67, 5], [68, 67], [70, 11], [71, 70], [76, 73], [76, 14]]}
| {"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_411353", "query": "\n\n\n__int64 __fastcall sub_411353(const char *a1)\n{\nchar v2; // bl\nunsigned int v3; // eax\nsize_t n; // [rsp+18h] [rbp-48h] BYREF\nchar *lineptr; // [rsp+20h] [rbp-40h] BYREF\nchar v6; // [rsp+2Fh] [rbp-31h]\nchar *v7; // [rsp+30h] [rbp-30h]\n__ssize_t v8; // [rsp+38h] [rbp-28h]\nFILE *stream; // [rsp+40h] [rbp-20h]\nchar *nptr; // [rsp+48h] [rbp-18h]\n\nlineptr = 0LL;\nn = 0LL;\nstream = fopen(a1, \"r\");\nif ( !stream )\nreturn 0LL;\nwhile ( 1 )\n{\nv8 = getline(&lineptr, &n, stream);\nif ( v8 == -1 )\nbreak;\nif ( *lineptr != 35 && v8 > 8 )\n{\nv7 = lineptr;\nfor ( nptr = lineptr; nptr; ++nptr )\n{\nif ( *nptr == 44 )\n{\n*nptr++ = 0;\nbreak;\n}\n}\nv6 = atoi(nptr);\nif ( v7 && v6 )\n{\nv2 = v6;\nv3 = sub_406CEA(v7);\nsub_40FD7B(v3, v2);\n}\n}\n}\nif ( lineptr )\nfree(lineptr);\nfclose(stream);\nreturn 0LL;\n}\n\n\n\nQ:[a1,n,lineptr,v6,v7,v8,stream,nptr,sub_411353,sub_406CEA,sub_40FD7B,]", "hints": "[]", "response": "{'a1': 'filename', 'n': 'len', 'lineptr': 'line', 'v6': 'ttl', 'v7': 'ip_0', 'v8': 'read', 'stream': 'fp', 'nptr': 'tmp', 'sub_411353': 'load_ttl_from_file', 'sub_406CEA': 'str2ip', 'sub_40FD7B': 'set_ttl'}"} | [
[
0.8093947768211365,
0.803683876991272,
0.7916753888130188,
0.7896430492401123,
0.7854533791542053,
0.7832790613174438,
0.7824925780296326,
0.7812296152114868,
0.7810044288635254,
0.7797232270240784,
0.7759439945220947,
0.7737755179405212,
0.771834135055542,
0.7693884372711182,
0.7687238454818726,
0.7683595418930054,
0.7673896551132202,
0.7651729583740234,
0.759474515914917,
0.7592258453369141
],
[
61725,
125292,
79151,
185741,
32667,
81671,
123622,
190342,
3191,
61018,
107947,
141302,
91561,
56725,
138613,
87756,
257245,
183992,
120640,
49662
]
] |
|
bufforward | 3ac3d3bd6fdcdfe3ef5718c0313b8de8e27f1c9192ed5f66ca31aa7134ec6c43 | dhamidi | tmenu | NA | static void bufforward(BUFFER self, int n) {
const char* after = Buffer.after(self);
while (n --> 0) {
Buffer.forward(self, 1);
while ( (unsigned char)*(++after) >> 6 == 2)
Buffer.forward(self, 1);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401FD7", "function_addr": 4202455, "binary_name": "3ac3d3bd6fdcdfe3ef5718c0313b8de8e27f1c9192ed5f66ca31aa7134ec6c43.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 rdx, cs:off_407AA8"], [6, "mov rax, [rbp+var_18]"], [7, "mov rdi, rax"], [8, "call rdx "], [9, "mov [rbp+var_8], rax"], [10, "jmp short loc_40203B"], [11, "mov rdx, cs:off_407A90"], [12, "mov rax, [rbp+var_18]"], [13, "mov esi, 1"], [14, "mov rdi, rax"], [15, "call rdx "], [16, "jmp short loc_402028"], [17, "mov rdx, cs:off_407A90"], [18, "mov rax, [rbp+var_18]"], [19, "mov esi, 1"], [20, "mov rdi, rax"], [21, "call rdx "], [22, "add [rbp+var_8], 1"], [23, "mov rax, [rbp+var_8]"], [24, "movzx eax, byte ptr [rax]"], [25, "shr al, 6"], [26, "cmp al, 2"], [27, "jz short loc_402013"], [28, "mov eax, [rbp+var_1C]"], [29, "lea edx, [rax-1]"], [30, "mov [rbp+var_1C], edx"], [31, "test eax, eax"], [32, "jg short loc_401FFC"], [33, "nop"], [34, "nop"], [35, "leave"], [36, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 5], [9, 8], [12, 3], [14, 12], [15, 11], [18, 3], [20, 18], [21, 17], [22, 22], [22, 9], [23, 22], [24, 23], [25, 24], [26, 25], [27, 26], [28, 30], [28, 4], [29, 17], [29, 28], [29, 5], [29, 11], [30, 29], [31, 28], [32, 31], [36, 31]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3ac3d3bd6fdcdfe3ef5718c0313b8de8e27f1c9192ed5f66ca31aa7134ec6c43_3ac3d3bd6fdcdfe3ef5718c0313b8de8e27f1c9192ed5f66ca31aa7134ec6c43.jsonl.gz", "strip_func_name": "sub_401FD7", "query": "\n\n\n__int64 __fastcall sub_401FD7(__int64 a1, unsigned int a2)\n{\n__int64 result; // rax\n_BYTE *v4; // [rsp+18h] [rbp-8h]\n\nv4 = (_BYTE *)off_407AA8(a1);\nwhile ( 1 )\n{\nresult = a2--;\nif ( (int)result <= 0 )\nbreak;\ndo\n{\noff_407A90(a1, 1LL);\n++v4;\n}\nwhile ( *v4 >> 6 == 2 );\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,sub_401FD7,]", "hints": "[]", "response": "{'a1': 'self', 'a2': 'n', 'v4': 'after', 'sub_401FD7': 'bufforward'}"} | [
[
0.7166793346405029,
0.7119792699813843,
0.7113907933235168,
0.6926255822181702,
0.6857219338417053,
0.6790394186973572,
0.6764594912528992,
0.6733630895614624,
0.6712678074836731,
0.6681069135665894,
0.6673752069473267,
0.6655011177062988,
0.6631991863250732,
0.6577776074409485,
0.6571075916290283,
0.6567363739013672,
0.6555358171463013,
0.6548960208892822,
0.6513622999191284,
0.6510744690895081
],
[
45995,
251356,
95921,
108211,
257070,
244484,
95016,
160509,
186185,
247196,
25623,
105420,
247814,
36969,
241470,
57151,
217582,
6270,
239431,
129341
]
] |
|
binentry_address_compare | f557df811b7d56de67ef6849125fb1c812196475ef0e276244c1b86a28488f0f | wolfSSL | wolfBoot | NA | int binentry_address_compare(const void* a, const void* b)
{
const binentry_t* ba = (const binentry_t*)a;
const binentry_t* bb = (const binentry_t*)b;
if (ba->address < bb->address) {
return -1;
} else if (ba->address > bb->address) {
return 1;
} else {
return 0;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "compar", "function_addr": 4198965, "binary_name": "f557df811b7d56de67ef6849125fb1c812196475ef0e276244c1b86a28488f0f.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_20]"], [7, "mov [rbp+var_10], rax"], [8, "mov rax, [rbp+var_8]"], [9, "mov rdx, [rax+8]"], [10, "mov rax, [rbp+var_10]"], [11, "mov rax, [rax+8]"], [12, "cmp rdx, rax"], [13, "jnb short loc_40126D"], [14, "mov eax, 0FFFFFFFFh"], [15, "jmp short loc_40128E"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdx, [rax+8]"], [18, "mov rax, [rbp+var_10]"], [19, "mov rax, [rax+8]"], [20, "cmp rdx, rax"], [21, "jbe short loc_401289"], [22, "mov eax, 1"], [23, "jmp short loc_40128E"], [24, "mov eax, 0"], [25, "pop rbp"], [26, "retn"]], "data_dep": [[4, 2], [5, 4], [6, 3], [7, 6], [8, 5], [9, 8], [10, 7], [11, 10], [12, 9], [12, 11], [13, 12], [16, 5], [17, 16], [18, 7], [19, 18], [20, 17], [20, 19], [21, 20], [25, 0], [26, 24], [26, 14], [26, 22]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/f557df811b7d56de67ef6849125fb1c812196475ef0e276244c1b86a28488f0f_f557df811b7d56de67ef6849125fb1c812196475ef0e276244c1b86a28488f0f.jsonl.gz", "strip_func_name": "compar", "query": "\n\n\n__int64 __fastcall compar(const void *a1, const void *a2)\n{\n__int64 result; // rax\n\nif ( *((_QWORD *)a1 + 1) >= *((_QWORD *)a2 + 1) )\nresult = *((_QWORD *)a1 + 1) > *((_QWORD *)a2 + 1);\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,]", "hints": "[]", "response": "{'a1': 'a', 'a2': 'b'}"} | [
[
0.8934482336044312,
0.8914295434951782,
0.8912822008132935,
0.8906304836273193,
0.8904354572296143,
0.8895858526229858,
0.886074423789978,
0.8858516216278076,
0.881981372833252,
0.8816659450531006,
0.8782083988189697,
0.8769330978393555,
0.875923216342926,
0.8757131099700928,
0.8755930066108704,
0.8752322196960449,
0.8740056157112122,
0.8727030754089355,
0.8726416826248169,
0.8713511228561401
],
[
46666,
215769,
262700,
196380,
22776,
82005,
20184,
222723,
145727,
69593,
179975,
17297,
174574,
22604,
59332,
159843,
98758,
175422,
53149,
135260
]
] |
|
a_htu21d_crc | 1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0 | hepingood | htu21d | NA | static uint8_t a_htu21d_crc(uint16_t value, uint32_t crc)
{
uint32_t polynom = 0x988000U;
uint32_t msb = 0x800000U;
uint32_t mask = 0xFF8000U;
uint32_t result = (uint32_t)value << 8;
while (msb != 0x80) /* check the msb */
{
if ((result & msb) != 0) /* check the result */
{
result = ((result ^ polynom) & mask) | (result & (~mask)); /* get the new result */
}
msb >>= 1; /* right shift 1 */
mask >>= 1; /* right shift 1 */
polynom >>= 1; /* right shift 1 */
}
if (result == crc) /* check the result */
{
return 0; /* success return 0 */
}
else
{
return 1; /* return error */
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401356", "function_addr": 4199254, "binary_name": "1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov eax, edi"], [3, "mov [rbp+var_18], esi"], [4, "mov [rbp+var_14], ax"], [5, "mov [rbp+var_4], 988000h"], [6, "mov [rbp+var_8], 800000h"], [7, "mov [rbp+var_C], 0FF8000h"], [8, "movzx eax, [rbp+var_14]"], [9, "shl eax, 8"], [10, "mov [rbp+var_10], eax"], [11, "jmp short loc_4013AF"], [12, "mov eax, [rbp+var_10]"], [13, "and eax, [rbp+var_8]"], [14, "test eax, eax"], [15, "jz short loc_4013A6"], [16, "mov eax, [rbp+var_10]"], [17, "xor eax, [rbp+var_4]"], [18, "and eax, [rbp+var_C]"], [19, "mov edx, eax"], [20, "mov eax, [rbp+var_C]"], [21, "not eax"], [22, "and eax, [rbp+var_10]"], [23, "or eax, edx"], [24, "mov [rbp+var_10], eax"], [25, "shr [rbp+var_8], 1"], [26, "shr [rbp+var_C], 1"], [27, "shr [rbp+var_4], 1"], [28, "cmp [rbp+var_8], 80h"], [29, "jnz short loc_401384"], [30, "mov eax, [rbp+var_10]"], [31, "cmp eax, [rbp+var_18]"], [32, "jnz short loc_4013C7"], [33, "mov eax, 0"], [34, "jmp short loc_4013CC"], [35, "mov eax, 1"], [36, "pop rbp"], [37, "retn"]], "data_dep": [[4, 2], [8, 4], [9, 8], [10, 9], [12, 10], [12, 24], [13, 25], [13, 6], [13, 12], [14, 13], [15, 14], [16, 10], [16, 24], [17, 27], [17, 5], [17, 16], [18, 17], [18, 26], [18, 7], [19, 18], [20, 26], [20, 7], [21, 20], [22, 10], [22, 21], [22, 24], [23, 19], [23, 22], [24, 23], [25, 25], [25, 6], [26, 26], [26, 7], [27, 27], [27, 5], [28, 6], [28, 25], [29, 28], [30, 24], [30, 10], [31, 3], [31, 30], [32, 31], [36, 0], [37, 33], [37, 35]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0_1a06f9077a2966c5357b2b2d2a32724643173e01b1d4a4bf2abf78fde9f7cea0.jsonl.gz", "strip_func_name": "sub_401356", "query": "\n\n\n_BOOL8 __fastcall sub_401356(unsigned __int16 a1, int a2)\n{\nint v3; // [rsp+8h] [rbp-10h]\nunsigned int v4; // [rsp+Ch] [rbp-Ch]\nunsigned int v5; // [rsp+10h] [rbp-8h]\nunsigned int v6; // [rsp+14h] [rbp-4h]\n\nv6 = 9994240;\nv5 = 0x800000;\nv4 = 16744448;\nv3 = a1 << 8;\nwhile ( v5 != 128 )\n{\nif ( (v5 & v3) != 0 )\nv3 = v4 & (v6 ^ v3) | v3 & ~v4;\nv5 >>= 1;\nv4 >>= 1;\nv6 >>= 1;\n}\nreturn v3 != a2;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,v6,sub_401356,]", "hints": "[]", "response": "{'a1': 'value', 'a2': 'crc', 'v3': 'result', 'v4': 'mask', 'v5': 'msb', 'v6': 'polynom', 'sub_401356': 'a_htu21d_crc'}"} | [
[
0.7721930742263794,
0.7699915170669556,
0.7643609642982483,
0.7585594654083252,
0.7410352230072021,
0.7397059798240662,
0.7393753528594971,
0.7365193367004395,
0.7270501255989075,
0.7204142808914185,
0.7187525033950806,
0.7144187688827515,
0.7043684124946594,
0.7032709121704102,
0.7025723457336426,
0.6973472833633423,
0.6887867450714111,
0.6839276552200317,
0.6833317279815674,
0.6832252144813538
],
[
238041,
121013,
151752,
170261,
172865,
256627,
186352,
199991,
25669,
216911,
255055,
186783,
195051,
254482,
4426,
233524,
246591,
41122,
49853,
189559
]
] |
|
m_pow | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_pow(bvm *vm)
{
if (be_top(vm) >= 2 && be_isnumber(vm, 1) && be_isnumber(vm, 2)) {
breal x = be_toreal(vm, 1);
breal y = be_toreal(vm, 2);
be_pushreal(vm, mathfunc(pow)(x, y));
} else {
be_pushreal(vm, (breal)0.0);
}
be_return(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42805D", "function_addr": 4358237, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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 rdi, rax"], [6, "call be_top"], [7, "cmp eax, 1"], [8, "jle loc_428102"], [9, "mov rax, [rbp+var_18]"], [10, "mov esi, 1"], [11, "mov rdi, rax"], [12, "call be_isnumber"], [13, "test al, al"], [14, "jz short loc_428102"], [15, "mov rax, [rbp+var_18]"], [16, "mov esi, 2"], [17, "mov rdi, rax"], [18, "call be_isnumber"], [19, "test al, al"], [20, "jz short loc_428102"], [21, "mov rax, [rbp+var_18]"], [22, "mov esi, 1"], [23, "mov rdi, rax"], [24, "call be_toreal"], [25, "movd eax, xmm0"], [26, "mov [rbp+x], eax"], [27, "mov rax, [rbp+var_18]"], [28, "mov esi, 2"], [29, "mov rdi, rax"], [30, "call be_toreal"], [31, "movd eax, xmm0"], [32, "mov [rbp+y], eax"], [33, "movss xmm0, [rbp+y]"], [34, "mov eax, [rbp+x]"], [35, "movaps xmm1, xmm0"], [36, "movd xmm0, eax"], [37, "call _powf"], [38, "movd eax, xmm0"], [39, "mov rdx, [rbp+var_18]"], [40, "movd xmm0, eax"], [41, "mov rdi, rdx"], [42, "call be_pushreal"], [43, "jmp short loc_428112"], [44, "mov rax, [rbp+var_18]"], [45, "pxor xmm0, xmm0"], [46, "mov rdi, rax"], [47, "call be_pushreal"], [48, "mov rax, [rbp+var_18]"], [49, "mov rdi, rax"], [50, "call be_returnvalue"], [51, "leave"], [52, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 3], [11, 9], [13, 12], [14, 13], [15, 3], [17, 15], [19, 18], [20, 19], [21, 3], [23, 21], [26, 25], [27, 3], [29, 27], [32, 31], [33, 32], [34, 26], [35, 33], [36, 34], [38, 36], [39, 3], [40, 38], [41, 39], [44, 3], [46, 44], [48, 3], [49, 48], [52, 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_42805D", "query": "\n\n\n__int64 __fastcall sub_42805D(__int64 a1, __m128i a2)\n{\n__m128i v2; // xmm0\nfloat y; // [rsp+18h] [rbp-8h]\nunsigned int x; // [rsp+1Ch] [rbp-4h]\n\nif ( (int)be_top(a1) > 1 && be_isnumber(a1, 1u) && be_isnumber(a1, 2u) )\n{\na2.m128i_u64[0] = (unsigned __int64)be_toreal(a1, 1u);\nx = _mm_cvtsi128_si32(a2);\na2.m128i_u64[0] = (unsigned __int64)be_toreal(a1, 2u);\ny = COERCE_FLOAT(_mm_cvtsi128_si32(a2));\nv2 = _mm_cvtsi32_si128(x);\n*(float *)v2.m128i_i32 = powf(*(float *)v2.m128i_i32, y);\nbe_pushreal(a1, COERCE_FLOAT(_mm_cvtsi128_si32(v2)));\n}\nelse\n{\nbe_pushreal(a1, 0.0);\n}\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,sub_42805D,]", "hints": "[]", "response": "{'a1': 'vm', 'sub_42805D': 'm_pow'}"} | [
[
0.7564858198165894,
0.7411937713623047,
0.7375754714012146,
0.7168118953704834,
0.7118692994117737,
0.7061492204666138,
0.7057414650917053,
0.7056423425674438,
0.7026073932647705,
0.7009199857711792,
0.6984582543373108,
0.6947646141052246,
0.6918764114379883,
0.6894320845603943,
0.6870884895324707,
0.6868974566459656,
0.6856350302696228,
0.6829833388328552,
0.6788566708564758,
0.678020715713501
],
[
243776,
153721,
259240,
86189,
171576,
193958,
146305,
169289,
104606,
173234,
125617,
175253,
22258,
23122,
122914,
180729,
33805,
47277,
119522,
253163
]
] |
|
get_seqs | 1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c | dfguan | purge_dups | NA | int get_seqs(opt_t *opts, dup_v dups, uint64_t *idx, sdict_t *sn)
{
char *fafn = opts->fafn;
uint32_t ml = opts->ml;
char *outpref = opts->pref;
int ahp = opts->add_hap_pref;
float mlp = opts->mlp;
int kh = opts->kh;
uint32_t gs4dup = opts->gs4dup;
int skipm = opts->skipm;
int split = opts->split;
gzFile fp;
kseq_t *seq;
/*fp = gzdopen(fileno(stdin), "r");*/
fp = fafn && strcmp(fafn, "-")? gzopen(fafn, "r") : gzdopen(fileno(stdin), "r");
seq = kseq_init(fp);
uint32_t sid;
dup_t *dp = dups.a;
char *hap_fn = malloc(sizeof(char) * (outpref?strlen(outpref) + 16 : 16)); //hap.fa
char *pur_fn = malloc(sizeof(char) * (outpref? strlen(outpref) + 16: 16)); //purged.fa
if (outpref) {
sprintf(hap_fn, "%s%s", outpref, ".hap.fa");
sprintf(pur_fn, "%s%s", outpref, ".purged.fa");
} else {
sprintf(hap_fn, "%s","hap.fa");
sprintf(pur_fn, "%s","purged.fa");
}
FILE *hap_fp = fopen(hap_fn, "w");
FILE *purged_fp = fopen(pur_fn, "w");
while (kseq_read(seq) >= 0) {
if (~(sid = sd_get(sn, seq->name.s))) {
get_seqs_core(seq->name.s, seq->seq.s, seq->seq.l, &dp[(idx[sid] >> 32)], (uint32_t)idx[sid], ml, hap_fp, purged_fp, ahp, mlp, kh, gs4dup, skipm, split);
} else
get_seqs_core(seq->name.s, seq->seq.s, seq->seq.l, 0, 0, ml, hap_fp, purged_fp, ahp, mlp, kh, gs4dup, skipm, split);
}
//add some basic statistics maybe
kseq_destroy(seq);
gzclose(fp);
free(hap_fn); free(pur_fn);
fclose(hap_fp);
fclose(purged_fp);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4031F0", "function_addr": 4207088, "binary_name": "1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_78], rdi"], [4, "mov [rbp+var_80], rsi"], [5, "mov [rbp+var_88], rdx"], [6, "mov rax, [rbp+var_78]"], [7, "mov rax, [rax+8]"], [8, "mov [rbp+s1], rax"], [9, "mov rax, [rbp+var_78]"], [10, "mov eax, [rax+18h]"], [11, "mov [rbp+var_C], eax"], [12, "mov rax, [rbp+var_78]"], [13, "mov rax, [rax+10h]"], [14, "mov [rbp+s], rax"], [15, "mov rax, [rbp+var_78]"], [16, "mov eax, [rax+1Ch]"], [17, "mov [rbp+var_1C], eax"], [18, "mov rax, [rbp+var_78]"], [19, "movss xmm0, dword ptr [rax+20h]"], [20, "movss [rbp+var_20], xmm0"], [21, "mov rax, [rbp+var_78]"], [22, "mov eax, [rax+28h]"], [23, "mov [rbp+var_24], eax"], [24, "mov rax, [rbp+var_78]"], [25, "mov eax, [rax+24h]"], [26, "mov [rbp+var_28], eax"], [27, "mov rax, [rbp+var_78]"], [28, "mov eax, [rax+2Ch]"], [29, "mov [rbp+var_2C], eax"], [30, "mov rax, [rbp+var_78]"], [31, "mov eax, [rax+30h]"], [32, "mov [rbp+var_30], eax"], [33, "cmp [rbp+s1], 0"], [34, "jz short loc_40329B"], [35, "mov rax, [rbp+s1]"], [36, "mov esi, offset s2"], [37, "mov rdi, rax"], [38, "call _strcmp"], [39, "test eax, eax"], [40, "jz short loc_40329B"], [41, "mov rax, [rbp+s1]"], [42, "mov esi, offset aR"], [43, "mov rdi, rax"], [44, "call _gzopen"], [45, "jmp short loc_4032B6"], [46, "mov rax, cs:stdin"], [47, "mov rdi, rax"], [48, "call _fileno"], [49, "mov esi, offset aR"], [50, "mov edi, eax"], [51, "call _gzdopen"], [52, "mov [rbp+var_38], rax"], [53, "mov rax, [rbp+var_38]"], [54, "mov rdi, rax"], [55, "call sub_4018F2"], [56, "mov [rbp+var_40], rax"], [57, "mov rax, [rbp+arg_10]"], [58, "mov [rbp+var_48], rax"], [59, "cmp [rbp+s], 0"], [60, "jz short loc_4032EB"], [61, "mov rax, [rbp+s]"], [62, "mov rdi, rax"], [63, "call _strlen"], [64, "add rax, 10h"], [65, "jmp short loc_4032F0"], [66, "mov eax, 10h"], [67, "mov rdi, rax"], [68, "call _malloc"], [69, "mov [rbp+filename], rax"], [70, "cmp [rbp+s], 0"], [71, "jz short loc_403315"], [72, "mov rax, [rbp+s]"], [73, "mov rdi, rax"], [74, "call _strlen"], [75, "add rax, 10h"], [76, "jmp short loc_40331A"], [77, "mov eax, 10h"], [78, "mov rdi, rax"], [79, "call _malloc"], [80, "mov [rbp+var_58], rax"], [81, "cmp [rbp+s], 0"], [82, "jz short loc_40336D"], [83, "mov rdx, [rbp+s]"], [84, "mov rax, [rbp+filename]"], [85, "mov ecx, offset aHapFa"], [86, "mov esi, offset aSS_0"], [87, "mov rdi, rax"], [88, "mov eax, 0"], [89, "call _sprintf"], [90, "mov rdx, [rbp+s]"], [91, "mov rax, [rbp+var_58]"], [92, "mov ecx, offset aPurgedFa"], [93, "mov esi, offset aSS_0"], [94, "mov rdi, rax"], [95, "mov eax, 0"], [96, "call _sprintf"], [97, "jmp short loc_4033A3"], [98, "mov rax, [rbp+filename]"], [99, "mov edx, offset aHapFa_0"], [100, "mov esi, offset aS"], [101, "mov rdi, rax"], [102, "mov eax, 0"], [103, "call _sprintf"], [104, "mov rax, [rbp+var_58]"], [105, "mov edx, offset aPurgedFa_0"], [106, "mov esi, offset aS"], [107, "mov rdi, rax"], [108, "mov eax, 0"], [109, "call _sprintf"], [110, "mov rax, [rbp+filename]"], [111, "mov esi, offset modes"], [112, "mov rdi, rax"], [113, "call _fopen"], [114, "mov [rbp+stream], rax"], [115, "mov rax, [rbp+var_58]"], [116, "mov esi, offset modes"], [117, "mov rdi, rax"], [118, "call _fopen"], [119, "mov [rbp+var_68], rax"], [120, "jmp loc_4034F4"], [121, "mov rax, [rbp+var_40]"], [122, "mov rdx, [rax+10h]"], [123, "mov rax, [rbp+var_88]"], [124, "mov rsi, rdx"], [125, "mov rdi, rax"], [126, "call sub_404759"], [127, "mov [rbp+var_6C], eax"], [128, "cmp [rbp+var_6C], 0FFFFFFFFh"], [129, "jz loc_403494"], [130, "mov eax, [rbp+var_6C]"], [131, "lea rdx, ds:0[rax*8]"], [132, "mov rax, [rbp+var_80]"], [133, "add rax, rdx"], [134, "mov rax, [rax]"], [135, "mov r11d, eax"], [136, "mov eax, [rbp+var_6C]"], [137, "lea rdx, ds:0[rax*8]"], [138, "mov rax, [rbp+var_80]"], [139, "add rax, rdx"], [140, "mov rax, [rax]"], [141, "shr rax, 20h"], [142, "shl rax, 4"], [143, "mov rdx, rax"], [144, "mov rax, [rbp+var_48]"], [145, "lea rcx, [rdx+rax]"], [146, "mov rax, [rbp+var_40]"], [147, "mov rax, [rax+30h]"], [148, "mov r10d, eax"], [149, "mov rax, [rbp+var_40]"], [150, "mov rsi, [rax+40h]"], [151, "mov rax, [rbp+var_40]"], [152, "mov rax, [rax+10h]"], [153, "mov edx, [rbp+var_20]"], [154, "mov r8d, [rbp+var_C]"], [155, "sub rsp, 8"], [156, "mov edi, [rbp+var_30]"], [157, "push rdi"], [158, "mov edi, [rbp+var_2C]"], [159, "push rdi"], [160, "mov edi, [rbp+var_28]"], [161, "push rdi"], [162, "mov edi, [rbp+var_24]"], [163, "push rdi"], [164, "mov edi, [rbp+var_1C]"], [165, "push rdi"], [166, "push [rbp+var_68]"], [167, "push [rbp+stream]"], [168, "movd xmm0, edx"], [169, "mov r9d, r8d"], [170, "mov r8, r11"], [171, "mov edx, r10d"], [172, "mov rdi, rax"], [173, "call sub_402646"], [174, "add rsp, 40h"], [175, "jmp short loc_4034F4"], [176, "mov rax, [rbp+var_40]"], [177, "mov rax, [rax+30h]"], [178, "mov r10d, eax"], [179, "mov rax, [rbp+var_40]"], [180, "mov rsi, [rax+40h]"], [181, "mov rax, [rbp+var_40]"], [182, "mov rax, [rax+10h]"], [183, "mov edx, [rbp+var_20]"], [184, "mov edi, [rbp+var_C]"], [185, "sub rsp, 8"], [186, "mov ecx, [rbp+var_30]"], [187, "push rcx"], [188, "mov ecx, [rbp+var_2C]"], [189, "push rcx"], [190, "mov ecx, [rbp+var_28]"], [191, "push rcx"], [192, "mov ecx, [rbp+var_24]"], [193, "push rcx"], [194, "mov ecx, [rbp+var_1C]"], [195, "push rcx"], [196, "push [rbp+var_68]"], [197, "push [rbp+stream]"], [198, "movd xmm0, edx"], [199, "mov r9d, edi"], [200, "mov r8d, 0"], [201, "mov ecx, 0"], [202, "mov edx, r10d"], [203, "mov rdi, rax"], [204, "call sub_402646"], [205, "add rsp, 40h"], [206, "mov rax, [rbp+var_40]"], [207, "mov rdi, rax"], [208, "call sub_40199F"], [209, "test eax, eax"], [210, "jns loc_4033D2"], [211, "mov rax, [rbp+var_40]"], [212, "mov rdi, rax"], [213, "call sub_40192B"], [214, "mov rax, [rbp+var_38]"], [215, "mov rdi, rax"], [216, "call _gzclose"], [217, "mov rax, [rbp+filename]"], [218, "mov rdi, rax"], [219, "call _free"], [220, "mov rax, [rbp+var_58]"], [221, "mov rdi, rax"], [222, "call _free"], [223, "mov rax, [rbp+stream]"], [224, "mov rdi, rax"], [225, "call _fclose"], [226, "mov rax, [rbp+var_68]"], [227, "mov rdi, rax"], [228, "call _fclose"], [229, "mov eax, 0"], [230, "leave"], [231, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 3], [10, 9], [11, 10], [12, 3], [13, 12], [14, 13], [15, 3], [16, 15], [17, 16], [18, 3], [19, 18], [20, 19], [21, 3], [22, 21], [23, 22], [24, 3], [25, 24], [26, 25], [27, 3], [28, 27], [29, 28], [30, 3], [31, 30], [32, 31], [33, 8], [34, 33], [35, 8], [37, 35], [39, 38], [40, 39], [41, 8], [43, 41], [47, 46], [50, 48], [52, 51], [52, 44], [53, 52], [54, 53], [56, 55], [58, 57], [59, 14], [60, 59], [61, 14], [62, 61], [64, 63], [67, 64], [67, 66], [69, 68], [70, 14], [71, 70], [72, 14], [73, 72], [75, 74], [78, 77], [78, 75], [80, 79], [81, 14], [82, 81], [83, 14], [84, 69], [87, 84], [90, 14], [91, 80], [94, 91], [98, 69], [101, 98], [104, 80], [107, 104], [110, 69], [112, 110], [114, 113], [115, 80], [117, 115], [119, 118], [121, 56], [122, 121], [123, 5], [124, 122], [125, 123], [127, 126], [128, 127], [129, 128], [130, 127], [131, 122], [132, 4], [133, 132], [133, 131], [134, 133], [135, 134], [136, 127], [137, 131], [138, 4], [139, 137], [139, 138], [140, 139], [141, 140], [142, 141], [143, 142], [144, 58], [145, 92], [145, 144], [145, 201], [145, 145], [146, 56], [147, 146], [148, 147], [149, 56], [150, 149], [151, 56], [152, 151], [153, 20], [154, 11], [155, 174], [155, 2], [155, 205], [156, 32], [157, 156], [158, 29], [159, 158], [160, 26], [161, 160], [162, 23], [163, 162], [164, 17], [165, 164], [166, 119], [167, 114], [168, 153], [169, 154], [170, 135], [171, 148], [172, 152], [174, 155], [176, 56], [177, 176], [178, 177], [179, 56], [180, 179], [181, 56], [182, 181], [183, 20], [184, 11], [185, 2], [185, 205], [185, 174], [186, 32], [187, 186], [188, 29], [189, 188], [190, 26], [191, 190], [192, 23], [193, 192], [194, 17], [195, 194], [196, 119], [197, 114], [198, 183], [199, 184], [202, 178], [203, 182], [205, 185], [206, 56], [207, 206], [209, 208], [210, 209], [211, 56], [212, 211], [214, 52], [215, 214], [217, 69], [218, 217], [220, 80], [221, 220], [223, 114], [224, 223], [226, 119], [227, 226], [231, 229]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c_1b3727773521b3d5f80b410a9ed75ab5842d1aa6051a19891e16fd33a22e864c.jsonl.gz", "strip_func_name": "sub_4031F0", "query": "\n\n\n__int64 __fastcall sub_4031F0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, int a7, int a8, __int64 a9)\n{\n__int64 v9; // rax\nsize_t v10; // rax\nsize_t v11; // rax\nunsigned int v14; // [rsp+24h] [rbp-6Ch]\nFILE *v15; // [rsp+28h] [rbp-68h]\nFILE *stream; // [rsp+30h] [rbp-60h]\nchar *v17; // [rsp+38h] [rbp-58h]\nchar *filename; // [rsp+40h] [rbp-50h]\n_QWORD *v19; // [rsp+50h] [rbp-40h]\nint v20; // [rsp+60h] [rbp-30h]\nint v21; // [rsp+64h] [rbp-2Ch]\nint v22; // [rsp+68h] [rbp-28h]\nint v23; // [rsp+6Ch] [rbp-24h]\nfloat v24; // [rsp+70h] [rbp-20h]\nint v25; // [rsp+74h] [rbp-1Ch]\nchar *s; // [rsp+78h] [rbp-18h]\nint v27; // [rsp+84h] [rbp-Ch]\nchar *s1; // [rsp+88h] [rbp-8h]\n\ns1 = *(char **)(a1 + 8);\nv27 = *(_DWORD *)(a1 + 24);\ns = *(char **)(a1 + 16);\nv25 = *(_DWORD *)(a1 + 28);\nv24 = *(float *)(a1 + 32);\nv23 = *(_DWORD *)(a1 + 40);\nv22 = *(_DWORD *)(a1 + 36);\nv21 = *(_DWORD *)(a1 + 44);\nv20 = *(_DWORD *)(a1 + 48);\nif ( !s1 || !strcmp(s1, \"-\") )\n{\nfileno(stdin);\nv9 = gzdopen();\n}\nelse\n{\nv9 = gzopen();\n}\nv19 = sub_4018F2(v9);\nif ( s )\nv10 = strlen(s) + 16;\nelse\nv10 = 16LL;\nfilename = (char *)malloc(v10);\nif ( s )\nv11 = strlen(s) + 16;\nelse\nv11 = 16LL;\nv17 = (char *)malloc(v11);\nif ( s )\n{\nsprintf(filename, \"%s%s\", s, \".hap.fa\");\nsprintf(v17, \"%s%s\", s, \".purged.fa\");\n}\nelse\n{\nsprintf(filename, \"%s\", \"hap.fa\");\nsprintf(v17, \"%s\", \"purged.fa\");\n}\nstream = fopen(filename, \"w\");\nv15 = fopen(v17, \"w\");\nwhile ( (int)sub_40199F((__int64)v19) >= 0 )\n{\nv14 = sub_404759(a3, v19[2]);\nif ( v14 == -1 )\nsub_402646(\n(const char *)v19[2],\n(const char *)v19[8],\nv19[6],\n0LL,\n0LL,\nv27,\nv24,\nstream,\nv15,\nv25,\nv23,\nv22,\nv21,\nv20);\nelse\nsub_402646(\n(const char *)v19[2],\n(const char *)v19[8],\nv19[6],\n16LL * HIDWORD(*(_QWORD *)(8LL * v14 + a2)) + a9,\n(unsigned int)*(_QWORD *)(8LL * v14 + a2),\nv27,\nv24,\nstream,\nv15,\nv25,\nv23,\nv22,\nv21,\nv20);\n}\nsub_40192B((__int64)v19);\ngzclose();\nfree(filename);\nfree(v17);\nfclose(stream);\nfclose(v15);\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,a7,v14,v15,stream,v17,filename,v19,v20,v21,v22,v23,v24,v25,s,v27,s1,sub_4031F0,sub_4018F2,sub_40199F,sub_404759,sub_402646,sub_40192B,]", "hints": "[]", "response": "{'a3': 'sn', 'a1': 'opts', 'a2': 'idx', 'a7': 'dups', 'v14': 'sid', 'v15': 'purged_fp', 'stream': 'hap_fp', 'v17': 'pur_fn', 'filename': 'hap_fn', 'v19': 'seq', 'v20': 'split', 'v21': 'skipm', 'v22': 'gs4dup', 'v23': 'kh', 'v24': 'mlp', 'v25': 'ahp', 's': 'outpref', 'v27': 'ml', 's1': 'fafn', 'sub_4031F0': 'get_seqs', 'sub_4018F2': 'kseq_init', 'sub_40199F': 'kseq_read', 'sub_404759': 'sd_get', 'sub_402646': 'get_seqs_core', 'sub_40192B': 'kseq_destroy'}"} | [
[
0.7563098073005676,
0.7135487794876099,
0.7103807926177979,
0.6985037326812744,
0.6976968050003052,
0.6917031407356262,
0.6895480155944824,
0.6895480155944824,
0.6851495504379272,
0.6850113868713379,
0.67281174659729,
0.6726984977722168,
0.6715676188468933,
0.670691728591919,
0.667944073677063,
0.6665783524513245,
0.6660884618759155,
0.6627013087272644,
0.662437379360199,
0.6615605354309082
],
[
253736,
109256,
109749,
132856,
128949,
184410,
162315,
203497,
169768,
97361,
55557,
150724,
261004,
31356,
1072,
108153,
179569,
209451,
74696,
184694
]
] |
|
append_pcap | 0505d7b49491f282193250f773bc04140ef5aea98b1f664ef1b0fb29476730b2 | troydhanson | network | NA | int append_pcap(int cat_fd, char *file) {
char *buf=NULL,*data;
size_t sz;
struct stat s;
int fd,rc=-1;
/* concat file */
if ( (fd = open(file, O_RDONLY)) == -1) {
fprintf(stderr,"can't open %s: %s\n", file, strerror(errno));
goto done;
}
if (fstat(fd, &s) == -1) {
fprintf(stderr,"can't stat %s: %s\n", file, strerror(errno));
goto done;
}
if (s.st_size < PCAP_GLOBAL_HDR_LEN) {
fprintf(stderr,"file lacks pcap header: %s\n", file);
goto done;
}
if (!S_ISREG(s.st_mode)) {
fprintf(stderr,"not a regular file: %s\n", file);
goto done;
}
buf = mmap(0, s.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (buf == MAP_FAILED) {
fprintf(stderr, "mmap %s: %s\n", file, strerror(errno));
goto done;
}
data = buf + PCAP_GLOBAL_HDR_LEN;
sz = s.st_size - PCAP_GLOBAL_HDR_LEN;
if (verbose) fprintf(stderr,"appending %s [%lu bytes]\n", file, sz);
if (write(cat_fd, data, sz) != sz) {
fprintf(stderr, "write %s: %s\n", file, strerror(errno));
goto done;
}
rc = 0;
done:
if (buf && (buf != MAP_FAILED)) if (munmap(buf, s.st_size)) fprintf(stderr,"munmap: %s\n",strerror(errno));
if (fd != -1) close(fd);
return rc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4011D2", "function_addr": 4198866, "binary_name": "0505d7b49491f282193250f773bc04140ef5aea98b1f664ef1b0fb29476730b2.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0C0h"], [3, "mov [rbp+var_B4], edi"], [4, "mov [rbp+file], rsi"], [5, "mov [rbp+addr], 0"], [6, "mov [rbp+var_C], 0FFFFFFFFh"], [7, "mov rax, [rbp+file]"], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "mov eax, 0"], [11, "call _open"], [12, "mov [rbp+fd], eax"], [13, "cmp [rbp+fd], 0FFFFFFFFh"], [14, "jnz short loc_401251"], [15, "call ___errno_location"], [16, "mov eax, [rax]"], [17, "mov edi, eax"], [18, "call _strerror"], [19, "mov rcx, rax"], [20, "mov rax, cs:stderr"], [21, "mov rdx, [rbp+file]"], [22, "mov esi, offset format"], [23, "mov rdi, rax"], [24, "mov eax, 0"], [25, "call _fprintf"], [26, "jmp loc_40140F"], [27, "lea rdx, [rbp+stat_buf]"], [28, "mov eax, [rbp+fd]"], [29, "mov rsi, rdx"], [30, "mov edi, eax"], [31, "call sub_401730"], [32, "cmp eax, 0FFFFFFFFh"], [33, "jnz short loc_4012A0"], [34, "call ___errno_location"], [35, "mov eax, [rax]"], [36, "mov edi, eax"], [37, "call _strerror"], [38, "mov rcx, rax"], [39, "mov rax, cs:stderr"], [40, "mov rdx, [rbp+file]"], [41, "mov esi, offset aCanTStatSS"], [42, "mov rdi, rax"], [43, "mov eax, 0"], [44, "call _fprintf"], [45, "jmp loc_40140F"], [46, "mov rax, [rbp+stat_buf.st_size]"], [47, "cmp rax, 17h"], [48, "jg short loc_4012CF"], [49, "mov rax, cs:stderr"], [50, "mov rdx, [rbp+file]"], [51, "mov esi, offset aFileLacksPcapH"], [52, "mov rdi, rax"], [53, "mov eax, 0"], [54, "call _fprintf"], [55, "jmp loc_40140F"], [56, "mov eax, [rbp+stat_buf.st_mode]"], [57, "and eax, 0F000h"], [58, "cmp eax, 8000h"], [59, "jz short loc_401306"], [60, "mov rax, cs:stderr"], [61, "mov rdx, [rbp+file]"], [62, "mov esi, offset aNotARegularFil"], [63, "mov rdi, rax"], [64, "mov eax, 0"], [65, "call _fprintf"], [66, "jmp loc_40140F"], [67, "mov rax, [rbp+stat_buf.st_size]"], [68, "mov rsi, rax"], [69, "mov eax, [rbp+fd]"], [70, "mov r9d, 0"], [71, "mov r8d, eax"], [72, "mov ecx, 2"], [73, "mov edx, 1"], [74, "mov edi, 0"], [75, "call _mmap"], [76, "mov [rbp+addr], rax"], [77, "cmp [rbp+addr], 0FFFFFFFFFFFFFFFFh"], [78, "jnz short loc_40136E"], [79, "call ___errno_location"], [80, "mov eax, [rax]"], [81, "mov edi, eax"], [82, "call _strerror"], [83, "mov rcx, rax"], [84, "mov rax, cs:stderr"], [85, "mov rdx, [rbp+file]"], [86, "mov esi, offset aMmapSS"], [87, "mov rdi, rax"], [88, "mov eax, 0"], [89, "call _fprintf"], [90, "jmp loc_40140F"], [91, "mov rax, [rbp+addr]"], [92, "add rax, 18h"], [93, "mov [rbp+buf], rax"], [94, "mov rax, [rbp+stat_buf.st_size]"], [95, "sub rax, 18h"], [96, "mov [rbp+n], rax"], [97, "mov eax, cs:dword_4040CC"], [98, "test eax, eax"], [99, "jz short loc_4013B4"], [100, "mov rax, cs:stderr"], [101, "mov rcx, [rbp+n]"], [102, "mov rdx, [rbp+file]"], [103, "mov esi, offset aAppendingSLuBy"], [104, "mov rdi, rax"], [105, "mov eax, 0"], [106, "call _fprintf"], [107, "mov rdx, [rbp+n]"], [108, "mov rcx, [rbp+buf]"], [109, "mov eax, [rbp+var_B4]"], [110, "mov rsi, rcx"], [111, "mov edi, eax"], [112, "call _write"], [113, "mov rdx, [rbp+n]"], [114, "cmp rax, rdx"], [115, "jz short loc_401408"], [116, "call ___errno_location"], [117, "mov eax, [rax]"], [118, "mov edi, eax"], [119, "call _strerror"], [120, "mov rcx, rax"], [121, "mov rax, cs:stderr"], [122, "mov rdx, [rbp+file]"], [123, "mov esi, offset aWriteSS"], [124, "mov rdi, rax"], [125, "mov eax, 0"], [126, "call _fprintf"], [127, "jmp short loc_40140F"], [128, "mov [rbp+var_C], 0"], [129, "cmp [rbp+addr], 0"], [130, "jz short loc_401461"], [131, "cmp [rbp+addr], 0FFFFFFFFFFFFFFFFh"], [132, "jz short loc_401461"], [133, "mov rax, [rbp+stat_buf.st_size]"], [134, "mov rdx, rax"], [135, "mov rax, [rbp+addr]"], [136, "mov rsi, rdx"], [137, "mov rdi, rax"], [138, "call _munmap"], [139, "test eax, eax"], [140, "jz short loc_401461"], [141, "call ___errno_location"], [142, "mov eax, [rax]"], [143, "mov edi, eax"], [144, "call _strerror"], [145, "mov rdx, rax"], [146, "mov rax, cs:stderr"], [147, "mov esi, offset aMunmapS"], [148, "mov rdi, rax"], [149, "mov eax, 0"], [150, "call _fprintf"], [151, "cmp [rbp+fd], 0FFFFFFFFh"], [152, "jz short loc_401471"], [153, "mov eax, [rbp+fd]"], [154, "mov edi, eax"], [155, "call _close"], [156, "mov eax, [rbp+var_C]"], [157, "leave"], [158, "retn"]], "data_dep": [[7, 4], [9, 7], [12, 11], [13, 12], [14, 13], [16, 15], [17, 16], [19, 18], [21, 4], [23, 20], [28, 12], [29, 27], [30, 28], [32, 31], [33, 32], [35, 34], [36, 35], [38, 37], [40, 4], [42, 39], [47, 46], [48, 47], [50, 4], [52, 49], [57, 56], [58, 57], [59, 58], [61, 4], [63, 60], [68, 67], [69, 12], [71, 69], [76, 75], [77, 76], [78, 77], [80, 79], [81, 80], [83, 82], [85, 4], [87, 84], [91, 76], [92, 91], [93, 92], [95, 94], [96, 95], [98, 97], [99, 98], [101, 96], [102, 4], [104, 100], [107, 96], [108, 93], [109, 3], [110, 108], [111, 109], [113, 96], [114, 113], [114, 112], [115, 114], [117, 116], [118, 117], [120, 119], [122, 4], [124, 121], [129, 5], [129, 76], [130, 129], [131, 76], [131, 5], [132, 131], [134, 133], [135, 76], [135, 5], [136, 134], [137, 135], [139, 138], [140, 139], [142, 141], [143, 142], [145, 144], [148, 146], [151, 12], [152, 151], [153, 12], [154, 153], [156, 128], [156, 6], [158, 156]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0505d7b49491f282193250f773bc04140ef5aea98b1f664ef1b0fb29476730b2_0505d7b49491f282193250f773bc04140ef5aea98b1f664ef1b0fb29476730b2.jsonl.gz", "strip_func_name": "sub_4011D2", "query": "\n\n\n__int64 __fastcall sub_4011D2(int a1, const char *a2)\n{\nint *v2; // rax\nchar *v3; // rax\nint *v4; // rax\nchar *v5; // rax\nint *v6; // rax\nchar *v7; // rax\nssize_t v8; // rax\nint *v9; // rax\nchar *v10; // rax\nint *v11; // rax\nchar *v12; // rax\nstruct stat stat_buf; // [rsp+10h] [rbp-B0h] BYREF\nsize_t n; // [rsp+A0h] [rbp-20h]\nvoid *buf; // [rsp+A8h] [rbp-18h]\nint fd; // [rsp+B0h] [rbp-10h]\nunsigned int v18; // [rsp+B4h] [rbp-Ch]\nvoid *addr; // [rsp+B8h] [rbp-8h]\n\naddr = 0LL;\nv18 = -1;\nfd = open(a2, 0);\nif ( fd == -1 )\n{\nv2 = __errno_location();\nv3 = strerror(*v2);\nfprintf(stderr, \"can't open %s: %s\\n\", a2, v3);\n}\nelse if ( (unsigned int)sub_401730(fd, &stat_buf) == -1 )\n{\nv4 = __errno_location();\nv5 = strerror(*v4);\nfprintf(stderr, \"can't stat %s: %s\\n\", a2, v5);\n}\nelse if ( stat_buf.st_size > 23 )\n{\nif ( (stat_buf.st_mode & 0xF000) == 0x8000 )\n{\naddr = mmap(0LL, stat_buf.st_size, 1, 2, fd, 0LL);\nif ( addr == (void *)-1LL )\n{\nv6 = __errno_location();\nv7 = strerror(*v6);\nfprintf(stderr, \"mmap %s: %s\\n\", a2, v7);\n}\nelse\n{\nbuf = (char *)addr + 24;\nn = stat_buf.st_size - 24;\nif ( dword_4040CC )\nfprintf(stderr, \"appending %s [%lu bytes]\\n\", a2, n);\nv8 = write(a1, buf, n);\nif ( v8 == n )\n{\nv18 = 0;\n}\nelse\n{\nv9 = __errno_location();\nv10 = strerror(*v9);\nfprintf(stderr, \"write %s: %s\\n\", a2, v10);\n}\n}\n}\nelse\n{\nfprintf(stderr, \"not a regular file: %s\\n\", a2);\n}\n}\nelse\n{\nfprintf(stderr, \"file lacks pcap header: %s\\n\", a2);\n}\nif ( addr && addr != (void *)-1LL && munmap(addr, stat_buf.st_size) )\n{\nv11 = __errno_location();\nv12 = strerror(*v11);\nfprintf(stderr, \"munmap: %s\\n\", v12);\n}\nif ( fd != -1 )\nclose(fd);\nreturn v18;\n}\n\n\n\nQ:[a1,a2,stat_buf,n,buf,v18,addr,sub_4011D2,sub_401730,]", "hints": "[]", "response": "{'a1': 'cat_fd', 'a2': 'file', 'stat_buf': 's', 'n': 'sz', 'buf': 'data', 'v18': 'rc', 'addr': 'buf', 'sub_4011D2': 'append_pcap', 'sub_401730': 'fstat'}"} | [
[
0.8009010553359985,
0.7726355791091919,
0.7412680387496948,
0.7298532128334045,
0.7275332808494568,
0.7236392498016357,
0.7217763066291809,
0.7042517066001892,
0.7042517066001892,
0.7012895345687866,
0.6971901059150696,
0.693413257598877,
0.6918646097183228,
0.6877460479736328,
0.6827061176300049,
0.6805084347724915,
0.6790554523468018,
0.6780731081962585,
0.677654504776001,
0.6752076148986816
],
[
19333,
33393,
164981,
130990,
67100,
182034,
34434,
33972,
41374,
245942,
124883,
230123,
157964,
88678,
231644,
211889,
148654,
188574,
263773,
71841
]
] |
|
bmp_load | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | int bmp_load(BMP *pb, char *file)
{
BMPFILEHEADER header = {0};
FILE *fp = NULL;
BYTE *pdata = NULL;
int i;
fp = fopen(file, "rb");
if (!fp) return -1;
fread(&header, sizeof(header), 1, fp);
pb->width = (int)header.biWidth > 0 ? (int)header.biWidth : 0;
pb->height = (int)header.biHeight > 0 ? (int)header.biHeight : 0;
pb->stride = ALIGN(pb->width * 3, 4);
if ((long long)pb->stride * pb->height >= 0x80000000) {
printf("bmp's width * height is out of range !\n");
goto done;
}
pb->pdata = malloc((size_t)pb->stride * pb->height);
if (pb->pdata) {
pdata = (BYTE*)pb->pdata + pb->stride * pb->height;
for (i=0; i<pb->height; i++) {
pdata -= pb->stride;
fread(pdata, pb->stride, 1, fp);
}
}
done:
if (fp) fclose(fp);
return pb->pdata ? 0 : -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40138E", "function_addr": 4199310, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+filename], rsi"], [5, "mov [rbp+ptr], 0"], [6, "mov [rbp+var_48], 0"], [7, "mov [rbp+var_40], 0"], [8, "mov [rbp+var_38], 0"], [9, "mov [rbp+var_30], 0"], [10, "mov [rbp+var_28], 0"], [11, "mov [rbp+var_20], 0"], [12, "mov [rbp+var_1C], 0"], [13, "mov [rbp+stream], 0"], [14, "mov [rbp+var_8], 0"], [15, "mov rax, [rbp+filename]"], [16, "mov esi, offset modes"], [17, "mov rdi, rax"], [18, "call _fopen"], [19, "mov [rbp+stream], rax"], [20, "cmp [rbp+stream], 0"], [21, "jnz short loc_401411"], [22, "mov eax, 0FFFFFFFFh"], [23, "jmp locret_40157E"], [24, "mov rdx, [rbp+stream]"], [25, "lea rax, [rbp+ptr]"], [26, "mov rcx, rdx"], [27, "mov edx, 1"], [28, "mov esi, 36h "], [29, "mov rdi, rax"], [30, "call _fread"], [31, "mov eax, dword ptr [rbp+var_40+2]"], [32, "mov edx, 0"], [33, "test eax, eax"], [34, "cmovns edx, eax"], [35, "mov rax, [rbp+var_58]"], [36, "mov [rax], edx"], [37, "mov eax, dword ptr [rbp+var_40+6]"], [38, "mov edx, 0"], [39, "test eax, eax"], [40, "cmovns edx, eax"], [41, "mov rax, [rbp+var_58]"], [42, "mov [rax+4], edx"], [43, "mov rax, [rbp+var_58]"], [44, "mov eax, [rax]"], [45, "lea edx, [rax+1]"], [46, "mov eax, edx"], [47, "add eax, eax"], [48, "add eax, edx"], [49, "lea edx, [rax+3]"], [50, "test eax, eax"], [51, "cmovs eax, edx"], [52, "sar eax, 2"], [53, "lea edx, ds:0[rax*4]"], [54, "mov rax, [rbp+var_58]"], [55, "mov [rax+8], edx"], [56, "mov rax, [rbp+var_58]"], [57, "mov eax, [rax+8]"], [58, "movsxd rdx, eax"], [59, "mov rax, [rbp+var_58]"], [60, "mov eax, [rax+4]"], [61, "cdqe"], [62, "imul rax, rdx"], [63, "mov edx, 80000000h"], [64, "cmp rax, rdx"], [65, "jl short loc_4014AD"], [66, "mov edi, offset aBmpSWidthHeigh"], [67, "call _puts"], [68, "jmp loc_401552"], [69, "mov rax, [rbp+var_58]"], [70, "mov eax, [rax+8]"], [71, "movsxd rdx, eax"], [72, "mov rax, [rbp+var_58]"], [73, "mov eax, [rax+4]"], [74, "cdqe"], [75, "imul rax, rdx"], [76, "mov rdi, rax"], [77, "call _malloc"], [78, "mov rdx, rax"], [79, "mov rax, [rbp+var_58]"], [80, "mov [rax+10h], rdx"], [81, "mov rax, [rbp+var_58]"], [82, "mov rax, [rax+10h]"], [83, "test rax, rax"], [84, "jz short loc_401551"], [85, "mov rax, [rbp+var_58]"], [86, "mov rcx, [rax+10h]"], [87, "mov rax, [rbp+var_58]"], [88, "mov edx, [rax+8]"], [89, "mov rax, [rbp+var_58]"], [90, "mov eax, [rax+4]"], [91, "imul eax, edx"], [92, "cdqe"], [93, "add rax, rcx"], [94, "mov [rbp+var_8], rax"], [95, "mov [rbp+var_C], 0"], [96, "jmp short loc_401545"], [97, "mov rax, [rbp+var_58]"], [98, "mov eax, [rax+8]"], [99, "cdqe"], [100, "neg rax"], [101, "add [rbp+var_8], rax"], [102, "mov rax, [rbp+var_58]"], [103, "mov eax, [rax+8]"], [104, "movsxd rsi, eax"], [105, "mov rdx, [rbp+stream]"], [106, "mov rax, [rbp+var_8]"], [107, "mov rcx, rdx"], [108, "mov edx, 1"], [109, "mov rdi, rax"], [110, "call _fread"], [111, "add [rbp+var_C], 1"], [112, "mov rax, [rbp+var_58]"], [113, "mov eax, [rax+4]"], [114, "cmp [rbp+var_C], eax"], [115, "jl short loc_40150F"], [116, "nop"], [117, "cmp [rbp+stream], 0"], [118, "jz short loc_401565"], [119, "mov rax, [rbp+stream]"], [120, "mov rdi, rax"], [121, "call _fclose"], [122, "mov rax, [rbp+var_58]"], [123, "mov rax, [rax+10h]"], [124, "test rax, rax"], [125, "jz short loc_401579"], [126, "mov eax, 0"], [127, "jmp short locret_40157E"], [128, "mov eax, 0FFFFFFFFh"], [129, "leave"], [130, "retn"]], "data_dep": [[15, 4], [17, 15], [19, 18], [20, 19], [21, 20], [24, 19], [25, 18], [25, 5], [26, 24], [29, 25], [33, 31], [34, 33], [35, 3], [36, 34], [36, 35], [39, 37], [40, 39], [41, 3], [42, 41], [42, 40], [43, 3], [44, 36], [44, 42], [44, 43], [45, 40], [45, 42], [45, 44], [46, 45], [47, 46], [48, 45], [48, 47], [49, 48], [49, 45], [49, 42], [50, 48], [51, 50], [51, 49], [52, 51], [53, 49], [54, 3], [55, 54], [55, 53], [56, 3], [57, 56], [57, 55], [58, 57], [59, 3], [60, 55], [60, 59], [60, 42], [62, 60], [62, 58], [64, 62], [64, 63], [65, 64], [69, 3], [70, 55], [70, 36], [70, 42], [70, 69], [70, 80], [71, 70], [72, 3], [73, 80], [73, 55], [73, 36], [73, 72], [73, 42], [75, 71], [75, 73], [76, 75], [78, 77], [79, 3], [80, 78], [80, 79], [81, 3], [82, 81], [82, 80], [83, 82], [84, 83], [85, 3], [86, 42], [86, 85], [86, 80], [86, 55], [86, 36], [87, 3], [88, 36], [88, 42], [88, 87], [88, 80], [88, 55], [89, 3], [90, 42], [90, 80], [90, 89], [90, 55], [90, 36], [91, 88], [91, 90], [93, 86], [93, 91], [94, 93], [97, 3], [98, 55], [98, 80], [98, 36], [98, 97], [98, 42], [100, 98], [101, 101], [101, 94], [101, 100], [102, 3], [103, 102], [103, 42], [103, 55], [103, 80], [103, 36], [104, 103], [105, 19], [106, 101], [107, 105], [109, 106], [111, 111], [111, 95], [112, 3], [113, 80], [113, 55], [113, 112], [113, 36], [113, 42], [114, 111], [114, 113], [114, 95], [115, 114], [117, 19], [118, 117], [119, 19], [120, 119], [122, 3], [123, 36], [123, 122], [123, 42], [123, 55], [123, 80], [124, 123], [125, 124], [130, 126], [130, 128], [130, 22]]}
| {"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_40138E", "query": "\n\n\n__int64 __fastcall sub_40138E(__int64 a1, const char *a2)\n{\n__int64 result; // rax\nint v3; // edx\nint v4; // edx\n__int64 ptr[2]; // [rsp+10h] [rbp-50h] BYREF\n__int128 v6; // [rsp+20h] [rbp-40h]\n__int64 v7; // [rsp+30h] [rbp-30h]\n__int64 v8; // [rsp+38h] [rbp-28h]\nint v9; // [rsp+40h] [rbp-20h]\n__int16 v10; // [rsp+44h] [rbp-1Ch]\nFILE *stream; // [rsp+48h] [rbp-18h]\nint i; // [rsp+54h] [rbp-Ch]\nvoid *v13; // [rsp+58h] [rbp-8h]\n\nptr[0] = 0LL;\nptr[1] = 0LL;\nv6 = 0uLL;\nv7 = 0LL;\nv8 = 0LL;\nv9 = 0;\nv10 = 0;\nv13 = 0LL;\nstream = fopen(a2, \"rb\");\nif ( !stream )\nreturn 0xFFFFFFFFLL;\nfread(ptr, 0x36uLL, 1uLL, stream);\nv3 = 0;\nif ( *(int *)((char *)&v6 + 2) >= 0 )\nv3 = *(_DWORD *)((char *)&v6 + 2);\n*(_DWORD *)a1 = v3;\nv4 = 0;\nif ( *(int *)((char *)&v6 + 6) >= 0 )\nv4 = *(_DWORD *)((char *)&v6 + 6);\n*(_DWORD *)(a1 + 4) = v4;\n*(_DWORD *)(a1 + 8) = 4 * (3 * (*(_DWORD *)a1 + 1) / 4);\nif ( *(int *)(a1 + 8) * (__int64)*(int *)(a1 + 4) < 0x80000000LL )\n{\n*(_QWORD *)(a1 + 16) = malloc(*(int *)(a1 + 8) * (__int64)*(int *)(a1 + 4));\nif ( *(_QWORD *)(a1 + 16) )\n{\nv13 = (void *)(*(_QWORD *)(a1 + 16) + *(_DWORD *)(a1 + 8) * *(_DWORD *)(a1 + 4));\nfor ( i = 0; i < *(_DWORD *)(a1 + 4); ++i )\n{\nv13 = (char *)v13 - *(int *)(a1 + 8);\nfread(v13, *(int *)(a1 + 8), 1uLL, stream);\n}\n}\n}\nelse\n{\nputs(\"bmp's width * height is out of range !\");\n}\nif ( stream )\nfclose(stream);\nif ( *(_QWORD *)(a1 + 16) )\nresult = 0LL;\nelse\nresult = 0xFFFFFFFFLL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,ptr,stream,v13,sub_40138E,]", "hints": "[]", "response": "{'a1': 'pb', 'a2': 'file', 'ptr': 'header', 'stream': 'fp', 'v13': 'pdata', 'sub_40138E': 'bmp_load'}"} | [
[
0.821161687374115,
0.794887125492096,
0.7501734495162964,
0.748021125793457,
0.729915976524353,
0.7260885238647461,
0.7239149808883667,
0.7108969688415527,
0.708415150642395,
0.7011029720306396,
0.7009491920471191,
0.6920881271362305,
0.6913244724273682,
0.6902883648872375,
0.6872479915618896,
0.6869094371795654,
0.6811124682426453,
0.6798098087310791,
0.6732544898986816,
0.6723023653030396
],
[
205062,
252213,
168619,
66164,
156720,
222597,
83481,
41772,
181005,
108195,
197017,
35164,
70896,
36713,
213074,
103170,
32326,
17510,
12637,
252675
]
] |
|
is_digit | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static inline bool is_digit (int c, gravity_number_type ntype) {
if (ntype == NUMBER_BIN) return (c == '0' || (c == '1'));
if (ntype == NUMBER_OCT) return (c >= '0' && (c <= '7'));
if ((ntype == NUMBER_HEX) && ((toupper(c) >= 'A' && toupper(c) <= 'F'))) return true;
return isdigit(c);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41EED4", "function_addr": 4320980, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+c], edi"], [4, "mov [rbp+var_8], esi"], [5, "cmp [rbp+var_8], 2"], [6, "jnz short loc_41EF05"], [7, "cmp [rbp+c], 30h "], [8, "jz short loc_41EEF4"], [9, "cmp [rbp+c], 31h "], [10, "jnz short loc_41EEFB"], [11, "mov eax, 1"], [12, "jmp short loc_41EF00"], [13, "mov eax, 0"], [14, "and eax, 1"], [15, "jmp short locret_41EF76"], [16, "cmp [rbp+var_8], 3"], [17, "jnz short loc_41EF28"], [18, "cmp [rbp+c], 2Fh "], [19, "jle short loc_41EF1E"], [20, "cmp [rbp+c], 37h "], [21, "jg short loc_41EF1E"], [22, "mov eax, 1"], [23, "jmp short loc_41EF23"], [24, "mov eax, 0"], [25, "and eax, 1"], [26, "jmp short locret_41EF76"], [27, "cmp [rbp+var_8], 1"], [28, "jnz short loc_41EF53"], [29, "mov eax, [rbp+c]"], [30, "mov edi, eax"], [31, "call _toupper"], [32, "cmp eax, 40h "], [33, "jle short loc_41EF53"], [34, "mov eax, [rbp+c]"], [35, "mov edi, eax"], [36, "call _toupper"], [37, "cmp eax, 46h "], [38, "jg short loc_41EF53"], [39, "mov eax, 1"], [40, "jmp short locret_41EF76"], [41, "call ___ctype_b_loc"], [42, "mov rdx, [rax]"], [43, "mov eax, [rbp+c]"], [44, "cdqe"], [45, "add rax, rax"], [46, "add rax, rdx"], [47, "movzx eax, word ptr [rax]"], [48, "movzx eax, ax"], [49, "and eax, 800h"], [50, "test eax, eax"], [51, "setnz al"], [52, "leave"], [53, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [8, 7], [9, 3], [10, 9], [14, 13], [14, 11], [16, 4], [17, 16], [18, 3], [19, 18], [20, 3], [21, 20], [25, 22], [25, 24], [27, 4], [28, 27], [29, 3], [30, 29], [32, 31], [33, 32], [34, 3], [35, 34], [37, 36], [38, 37], [42, 41], [43, 3], [45, 43], [46, 42], [46, 45], [47, 46], [48, 47], [49, 48], [50, 49], [51, 50], [53, 14], [53, 25], [53, 39], [53, 51]]}
| {"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_41EED4", "query": "\n\n\nchar __fastcall sub_41EED4(int a1, int a2)\n{\nbool v2; // al\nchar result; // al\nbool v4; // al\n\nif ( a2 == 2 )\n{\nv2 = a1 == 48 || a1 == 49;\nresult = v2;\n}\nelse if ( a2 == 3 )\n{\nv4 = a1 > 47 && a1 <= 55;\nresult = v4;\n}\nelse if ( a2 == 1 && toupper(a1) > 64 && toupper(a1) <= 70 )\n{\nresult = 1;\n}\nelse\n{\nresult = ((*__ctype_b_loc())[a1] & 0x800) != 0;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_41EED4,]", "hints": "[]", "response": "{'a1': 'c', 'a2': 'ntype', 'sub_41EED4': 'is_digit'}"} | [
[
0.7464488744735718,
0.7015214562416077,
0.6885815858840942,
0.6874468326568604,
0.6850781440734863,
0.6849777102470398,
0.6830630898475647,
0.6788976788520813,
0.6749799251556396,
0.6726809740066528,
0.6721901297569275,
0.6712572574615479,
0.6682096719741821,
0.6665389537811279,
0.6645320653915405,
0.6608530282974243,
0.6593064665794373,
0.6585981845855713,
0.6575405597686768,
0.6554197072982788
],
[
77974,
220638,
181779,
144136,
112813,
194603,
238582,
252299,
25304,
243843,
141777,
63728,
175041,
186159,
84545,
188180,
194886,
247152,
47796,
13374
]
] |
|
findline | 5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0 | xelerance | Openswan | NA | unsigned int findline (buf, siz)
char * buf;
unsigned int siz;
{
register char * p;
register int x;
if (! buf) /* various sanity checks... */
return (0);
if (siz > BIGSIZ)
return (0);
x = siz;
for (p = buf; x > 0; x--) {
if (*p == '\n') {
x = (int) (p - buf);
x++; /* 'sokay if it points just past the end! */
Debug (("findline returning %d", x))
return (x);
}
p++;
} /* for */
Debug (("findline returning whole thing: %d", siz))
return (siz);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4027B2", "function_addr": 4204466, "binary_name": "5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "mov [rbp+var_18], rdi"], [5, "mov [rbp+var_1C], esi"], [6, "cmp [rbp+var_18], 0"], [7, "jnz short loc_4027CE"], [8, "mov eax, 0"], [9, "jmp short loc_40280E"], [10, "cmp [rbp+var_1C], 2000h"], [11, "jbe short loc_4027DE"], [12, "mov eax, 0"], [13, "jmp short loc_40280E"], [14, "mov ebx, [rbp+var_1C]"], [15, "mov r12, [rbp+var_18]"], [16, "jmp short loc_402807"], [17, "movzx eax, byte ptr [r12]"], [18, "cmp al, 0Ah"], [19, "jnz short loc_402800"], [20, "mov rax, r12"], [21, "sub rax, [rbp+var_18]"], [22, "mov ebx, eax"], [23, "add ebx, 1"], [24, "mov eax, ebx"], [25, "jmp short loc_40280E"], [26, "add r12, 1"], [27, "sub ebx, 1"], [28, "test ebx, ebx"], [29, "jg short loc_4027E7"], [30, "mov eax, [rbp+var_1C]"], [31, "pop rbx"], [32, "pop r12"], [33, "pop rbp"], [34, "retn"]], "data_dep": [[6, 4], [7, 6], [10, 5], [11, 10], [14, 5], [15, 4], [17, 15], [17, 26], [18, 17], [19, 18], [20, 26], [20, 15], [21, 20], [21, 4], [22, 21], [23, 22], [24, 23], [26, 26], [26, 15], [27, 28], [28, 27], [28, 14], [29, 28], [30, 5], [31, 3], [32, 2], [33, 0], [34, 12], [34, 24], [34, 30], [34, 8]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0_5bccc316131b0bf67c81683bef6cd122d955dcbc50133040664b00c41897eff0.jsonl.gz", "strip_func_name": "sub_4027B2", "query": "\n\n\n__int64 __fastcall sub_4027B2(_BYTE *a1, unsigned int a2)\n{\nint v3; // ebx\n_BYTE *v4; // r12\n\nif ( !a1 )\nreturn 0LL;\nif ( a2 > 0x2000 )\nreturn 0LL;\nv3 = a2;\nv4 = a1;\nwhile ( v3 > 0 )\n{\nif ( *v4 == 10 )\nreturn (unsigned int)((_DWORD)v4 - (_DWORD)a1 + 1);\n++v4;\n--v3;\n}\nreturn a2;\n}\n\n\n\nQ:[a1,a2,sub_4027B2,]", "hints": "[]", "response": "{'a1': 'buf', 'a2': 'siz', 'sub_4027B2': 'findline'}"} | [
[
0.7736116647720337,
0.7581692337989807,
0.7430084943771362,
0.7394595146179199,
0.7265913486480713,
0.7179168462753296,
0.7115542888641357,
0.7107107639312744,
0.7047668695449829,
0.7039132118225098,
0.7001354098320007,
0.6984958052635193,
0.6963945627212524,
0.6960945129394531,
0.694133460521698,
0.6936706900596619,
0.6921999454498291,
0.6919829845428467,
0.6919471025466919,
0.689915120601654
],
[
64697,
152744,
110158,
48323,
38413,
93120,
51125,
45423,
89942,
92906,
24293,
127131,
127076,
152543,
2496,
82852,
222805,
59675,
170273,
107028
]
] |
|
ECOS_cleanup | bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2 | embotech | ecos | NA | void ECOS_cleanup(pwork* w, idxint keepvars)
{
idxint i;
#if defined EQUILIBRATE && EQUILIBRATE > 0
/* unset equilibration */
unset_equilibration(w);
#endif
/* Free KKT related memory --- below are the corresponding MALLOCs */
FREE(w->KKT->D); /* mywork->KKT->D = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->dx1); /* mywork->KKT->dx1 = (pfloat *)MALLOC(mywork->n*sizeof(pfloat)); */
FREE(w->KKT->dx2); /* mywork->KKT->dx2 = (pfloat *)MALLOC(mywork->n*sizeof(pfloat)); */
FREE(w->KKT->dy1); /* mywork->KKT->dy1 = (pfloat *)MALLOC(mywork->p*sizeof(pfloat)); */
FREE(w->KKT->dy2); /* mywork->KKT->dy2 = (pfloat *)MALLOC(mywork->p*sizeof(pfloat)); */
FREE(w->KKT->dz1); /* mywork->KKT->dz1 = (pfloat *)MALLOC(mywork->m*sizeof(pfloat)); */
FREE(w->KKT->dz2); /* mywork->KKT->dz2 = (pfloat *)MALLOC(mywork->m*sizeof(pfloat)); */
FREE(w->KKT->Flag); /* mywork->KKT->Flag = (idxint *)MALLOC(nK*sizeof(idxint)); */
freeSparseMatrix(w->KKT->L);
FREE(w->KKT->Lnz); /* mywork->KKT->Lnz = (idxint *)MALLOC(nK*sizeof(idxint)); */
FREE(w->KKT->Parent); /* mywork->KKT->Parent = (idxint *)MALLOC(nK*sizeof(idxint)); */
FREE(w->KKT->Pattern); /* mywork->KKT->Pattern = (idxint *)MALLOC(nK*sizeof(idxint)); */
FREE(w->KKT->Sign); /* mywork->KKT->Sign = (idxint *)MALLOC(nK*sizeof(idxint)); */
FREE(w->KKT->Pinv); /* mywork->KKT->Pinv = (idxint *)MALLOC(nK*sizeof(idxint)); */
FREE(w->KKT->P);
FREE(w->KKT->PK); /* mywork->KKT->PK = (idxint *)MALLOC(KU->nnz*sizeof(idxint)); */
freeSparseMatrix(w->KKT->PKPt); /* mywork->KKT->PKPt = newSparseMatrix(nK, nK, KU->nnz); */
FREE(w->KKT->RHS1); /* mywork->KKT->RHS1 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->RHS2); /* mywork->KKT->RHS2 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work1); /* mywork->KKT->work1 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work2); /* mywork->KKT->work2 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work3); /* mywork->KKT->work3 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work4); /* mywork->KKT->work4 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work5); /* mywork->KKT->work5 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT->work6); /* mywork->KKT->work6 = (pfloat *)MALLOC(nK*sizeof(pfloat)); */
FREE(w->KKT); /* mywork->KKT = (kkt *)MALLOC(sizeof(kkt)); */
if (w->A) {
FREE(w->AtoK);
}
FREE(w->GtoK);
/* Free memory for cones */
if( w->C->lpc->p > 0 ){
FREE(w->C->lpc->kkt_idx);
FREE(w->C->lpc->v);
FREE(w->C->lpc->w);
}
/* C->lpc is always allocated, so we free it here. */
FREE(w->C->lpc);
for( i=0; i < w->C->nsoc; i++ ){
FREE(w->C->soc[i].q);
FREE(w->C->soc[i].skbar);
FREE(w->C->soc[i].zkbar);
#if CONEMODE == 0
FREE(w->C->soc[i].Didx);
#endif
#if CONEMODE > 0
FREE(w->C->soc[i].colstart);
#endif
}
if( w->C->nsoc > 0 ){
FREE(w->C->soc);
}
#ifdef EXPCONE
if(w->C->nexc > 0){
FREE(w->C->expc);
}
#endif
FREE(w->C);
/* free stuff from pwork */
FREE(w->W_times_dzaff);
FREE(w->dsaff_by_W);
FREE(w->dzaff);
FREE(w->dsaff);
FREE(w->zaff);
FREE(w->saff);
FREE(w->info);
FREE(w->best_info);
FREE(w->lambda);
FREE(w->rx);
FREE(w->ry);
FREE(w->rz);
FREE(w->stgs);
FREE(w->G);
if( w->A ) FREE(w->A);
FREE(w->best_z);
FREE(w->best_s);
FREE(w->best_y);
FREE(w->best_x);
if( keepvars < 4 ) { FREE(w->z); }
if( keepvars < 3 ) { FREE(w->s); }
if( keepvars < 2 ) { FREE(w->y); }
if( keepvars < 1 ) { FREE(w->x); }
#if defined EQUILIBRATE && EQUILIBRATE > 0
FREE(w->xequil);
FREE(w->Aequil);
FREE(w->Gequil);
#endif
FREE(w);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40DFA2", "function_addr": 4251554, "binary_name": "bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+ptr], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov rax, [rbp+ptr]"], [6, "mov rdi, rax"], [7, "call sub_4119FD"], [8, "mov rax, [rbp+ptr]"], [9, "mov rax, [rax+1C0h]"], [10, "mov rax, [rax+10h]"], [11, "mov rdi, rax"], [12, "call _free"], [13, "mov rax, [rbp+ptr]"], [14, "mov rax, [rax+1C0h]"], [15, "mov rax, [rax+58h]"], [16, "mov rdi, rax"], [17, "call _free"], [18, "mov rax, [rbp+ptr]"], [19, "mov rax, [rax+1C0h]"], [20, "mov rax, [rax+60h]"], [21, "mov rdi, rax"], [22, "call _free"], [23, "mov rax, [rbp+ptr]"], [24, "mov rax, [rax+1C0h]"], [25, "mov rax, [rax+68h]"], [26, "mov rdi, rax"], [27, "call _free"], [28, "mov rax, [rbp+ptr]"], [29, "mov rax, [rax+1C0h]"], [30, "mov rax, [rax+70h]"], [31, "mov rdi, rax"], [32, "call _free"], [33, "mov rax, [rbp+ptr]"], [34, "mov rax, [rax+1C0h]"], [35, "mov rax, [rax+78h]"], [36, "mov rdi, rax"], [37, "call _free"], [38, "mov rax, [rbp+ptr]"], [39, "mov rax, [rax+1C0h]"], [40, "mov rax, [rax+80h]"], [41, "mov rdi, rax"], [42, "call _free"], [43, "mov rax, [rbp+ptr]"], [44, "mov rax, [rax+1C0h]"], [45, "mov rax, [rax+0B8h]"], [46, "mov rdi, rax"], [47, "call _free"], [48, "mov rax, [rbp+ptr]"], [49, "mov rax, [rax+1C0h]"], [50, "mov rax, [rax+8]"], [51, "mov rdi, rax"], [52, "call sub_40FE05"], [53, "mov rax, [rbp+ptr]"], [54, "mov rax, [rax+1C0h]"], [55, "mov rax, [rax+0C0h]"], [56, "mov rdi, rax"], [57, "call _free"], [58, "mov rax, [rbp+ptr]"], [59, "mov rax, [rax+1C0h]"], [60, "mov rax, [rax+0A0h]"], [61, "mov rdi, rax"], [62, "call _free"], [63, "mov rax, [rbp+ptr]"], [64, "mov rax, [rax+1C0h]"], [65, "mov rax, [rax+0B0h]"], [66, "mov rdi, rax"], [67, "call _free"], [68, "mov rax, [rbp+ptr]"], [69, "mov rax, [rax+1C0h]"], [70, "mov rax, [rax+0A8h]"], [71, "mov rdi, rax"], [72, "call _free"], [73, "mov rax, [rbp+ptr]"], [74, "mov rax, [rax+1C0h]"], [75, "mov rax, [rax+90h]"], [76, "mov rdi, rax"], [77, "call _free"], [78, "mov rax, [rbp+ptr]"], [79, "mov rax, [rax+1C0h]"], [80, "mov rax, [rax+88h]"], [81, "mov rdi, rax"], [82, "call _free"], [83, "mov rax, [rbp+ptr]"], [84, "mov rax, [rax+1C0h]"], [85, "mov rax, [rax+98h]"], [86, "mov rdi, rax"], [87, "call _free"], [88, "mov rax, [rbp+ptr]"], [89, "mov rax, [rax+1C0h]"], [90, "mov rax, [rax]"], [91, "mov rdi, rax"], [92, "call sub_40FE05"], [93, "mov rax, [rbp+ptr]"], [94, "mov rax, [rax+1C0h]"], [95, "mov rax, [rax+48h]"], [96, "mov rdi, rax"], [97, "call _free"], [98, "mov rax, [rbp+ptr]"], [99, "mov rax, [rax+1C0h]"], [100, "mov rax, [rax+50h]"], [101, "mov rdi, rax"], [102, "call _free"], [103, "mov rax, [rbp+ptr]"], [104, "mov rax, [rax+1C0h]"], [105, "mov rax, [rax+18h]"], [106, "mov rdi, rax"], [107, "call _free"], [108, "mov rax, [rbp+ptr]"], [109, "mov rax, [rax+1C0h]"], [110, "mov rax, [rax+20h]"], [111, "mov rdi, rax"], [112, "call _free"], [113, "mov rax, [rbp+ptr]"], [114, "mov rax, [rax+1C0h]"], [115, "mov rax, [rax+28h]"], [116, "mov rdi, rax"], [117, "call _free"], [118, "mov rax, [rbp+ptr]"], [119, "mov rax, [rax+1C0h]"], [120, "mov rax, [rax+30h]"], [121, "mov rdi, rax"], [122, "call _free"], [123, "mov rax, [rbp+ptr]"], [124, "mov rax, [rax+1C0h]"], [125, "mov rax, [rax+38h]"], [126, "mov rdi, rax"], [127, "call _free"], [128, "mov rax, [rbp+ptr]"], [129, "mov rax, [rax+1C0h]"], [130, "mov rax, [rax+40h]"], [131, "mov rdi, rax"], [132, "call _free"], [133, "mov rax, [rbp+ptr]"], [134, "mov rax, [rax+1C0h]"], [135, "mov rdi, rax"], [136, "call _free"], [137, "mov rax, [rbp+ptr]"], [138, "mov rax, [rax+0E0h]"], [139, "test rax, rax"], [140, "jz short loc_40E24D"], [141, "mov rax, [rbp+ptr]"], [142, "mov rax, [rax+108h]"], [143, "mov rdi, rax"], [144, "call _free"], [145, "mov rax, [rbp+ptr]"], [146, "mov rax, [rax+110h]"], [147, "mov rdi, rax"], [148, "call _free"], [149, "mov rax, [rbp+ptr]"], [150, "mov rax, [rax+0D8h]"], [151, "mov rax, [rax]"], [152, "mov rax, [rax]"], [153, "test rax, rax"], [154, "jle short loc_40E2C4"], [155, "mov rax, [rbp+ptr]"], [156, "mov rax, [rax+0D8h]"], [157, "mov rax, [rax]"], [158, "mov rax, [rax+18h]"], [159, "mov rdi, rax"], [160, "call _free"], [161, "mov rax, [rbp+ptr]"], [162, "mov rax, [rax+0D8h]"], [163, "mov rax, [rax]"], [164, "mov rax, [rax+10h]"], [165, "mov rdi, rax"], [166, "call _free"], [167, "mov rax, [rbp+ptr]"], [168, "mov rax, [rax+0D8h]"], [169, "mov rax, [rax]"], [170, "mov rax, [rax+8]"], [171, "mov rdi, rax"], [172, "call _free"], [173, "mov rax, [rbp+ptr]"], [174, "mov rax, [rax+0D8h]"], [175, "mov rax, [rax]"], [176, "mov rdi, rax"], [177, "call _free"], [178, "mov [rbp+var_8], 0"], [179, "jmp loc_40E3C4"], [180, "mov rax, [rbp+ptr]"], [181, "mov rax, [rax+0D8h]"], [182, "mov rcx, [rax+8]"], [183, "mov rdx, [rbp+var_8]"], [184, "mov rax, rdx"], [185, "add rax, rax"], [186, "add rax, rdx"], [187, "shl rax, 2"], [188, "add rax, rdx"], [189, "shl rax, 3"], [190, "add rax, rcx"], [191, "mov rax, [rax+40h]"], [192, "mov rdi, rax"], [193, "call _free"], [194, "mov rax, [rbp+ptr]"], [195, "mov rax, [rax+0D8h]"], [196, "mov rcx, [rax+8]"], [197, "mov rdx, [rbp+var_8]"], [198, "mov rax, rdx"], [199, "add rax, rax"], [200, "add rax, rdx"], [201, "shl rax, 2"], [202, "add rax, rdx"], [203, "shl rax, 3"], [204, "add rax, rcx"], [205, "mov rax, [rax+8]"], [206, "mov rdi, rax"], [207, "call _free"], [208, "mov rax, [rbp+ptr]"], [209, "mov rax, [rax+0D8h]"], [210, "mov rcx, [rax+8]"], [211, "mov rdx, [rbp+var_8]"], [212, "mov rax, rdx"], [213, "add rax, rax"], [214, "add rax, rdx"], [215, "shl rax, 2"], [216, "add rax, rdx"], [217, "shl rax, 3"], [218, "add rax, rcx"], [219, "mov rax, [rax+10h]"], [220, "mov rdi, rax"], [221, "call _free"], [222, "mov rax, [rbp+ptr]"], [223, "mov rax, [rax+0D8h]"], [224, "mov rcx, [rax+8]"], [225, "mov rdx, [rbp+var_8]"], [226, "mov rax, rdx"], [227, "add rax, rax"], [228, "add rax, rdx"], [229, "shl rax, 2"], [230, "add rax, rdx"], [231, "shl rax, 3"], [232, "add rax, rcx"], [233, "mov rax, [rax+48h]"], [234, "mov rdi, rax"], [235, "call _free"], [236, "add [rbp+var_8], 1"], [237, "mov rax, [rbp+ptr]"], [238, "mov rax, [rax+0D8h]"], [239, "mov rax, [rax+10h]"], [240, "cmp [rbp+var_8], rax"], [241, "jl loc_40E2E7"], [242, "mov rax, [rbp+ptr]"], [243, "mov rax, [rax+0D8h]"], [244, "mov rax, [rax+10h]"], [245, "test rax, rax"], [246, "jle short loc_40E408"], [247, "mov rax, [rbp+ptr]"], [248, "mov rax, [rax+0D8h]"], [249, "mov rax, [rax+8]"], [250, "mov rdi, rax"], [251, "call _free"], [252, "mov rax, [rbp+ptr]"], [253, "mov rax, [rax+0D8h]"], [254, "mov rax, [rax+20h]"], [255, "test rax, rax"], [256, "jle short loc_40E433"], [257, "mov rax, [rbp+ptr]"], [258, "mov rax, [rax+0D8h]"], [259, "mov rax, [rax+18h]"], [260, "mov rdi, rax"], [261, "call _free"], [262, "mov rax, [rbp+ptr]"], [263, "mov rax, [rax+0D8h]"], [264, "mov rdi, rax"], [265, "call _free"], [266, "mov rax, [rbp+ptr]"], [267, "mov rax, [rax+0B8h]"], [268, "mov rdi, rax"], [269, "call _free"], [270, "mov rax, [rbp+ptr]"], [271, "mov rax, [rax+0C0h]"], [272, "mov rdi, rax"], [273, "call _free"], [274, "mov rax, [rbp+ptr]"], [275, "mov rax, [rax+0B0h]"], [276, "mov rdi, rax"], [277, "call _free"], [278, "mov rax, [rbp+ptr]"], [279, "mov rax, [rax+0A8h]"], [280, "mov rdi, rax"], [281, "call _free"], [282, "mov rax, [rbp+ptr]"], [283, "mov rax, [rax+0D0h]"], [284, "mov rdi, rax"], [285, "call _free"], [286, "mov rax, [rbp+ptr]"], [287, "mov rax, [rax+0C8h]"], [288, "mov rdi, rax"], [289, "call _free"], [290, "mov rax, [rbp+ptr]"], [291, "mov rax, [rax+1C8h]"], [292, "mov rdi, rax"], [293, "call _free"], [294, "mov rax, [rbp+ptr]"], [295, "mov rax, [rax+0A0h]"], [296, "mov rdi, rax"], [297, "call _free"], [298, "mov rax, [rbp+ptr]"], [299, "mov rax, [rax+40h]"], [300, "mov rdi, rax"], [301, "call _free"], [302, "mov rax, [rbp+ptr]"], [303, "mov rax, [rax+148h]"], [304, "mov rdi, rax"], [305, "call _free"], [306, "mov rax, [rbp+ptr]"], [307, "mov rax, [rax+150h]"], [308, "mov rdi, rax"], [309, "call _free"], [310, "mov rax, [rbp+ptr]"], [311, "mov rax, [rax+158h]"], [312, "mov rdi, rax"], [313, "call _free"], [314, "mov rax, [rbp+ptr]"], [315, "mov rax, [rax+1D0h]"], [316, "mov rdi, rax"], [317, "call _free"], [318, "mov rax, [rbp+ptr]"], [319, "mov rax, [rax+0E8h]"], [320, "mov rdi, rax"], [321, "call _free"], [322, "mov rax, [rbp+ptr]"], [323, "mov rax, [rax+0E0h]"], [324, "test rax, rax"], [325, "jz short loc_40E570"], [326, "mov rax, [rbp+ptr]"], [327, "mov rax, [rax+0E0h]"], [328, "mov rdi, rax"], [329, "call _free"], [330, "mov rax, [rbp+ptr]"], [331, "mov rax, [rax+68h]"], [332, "mov rdi, rax"], [333, "call _free"], [334, "mov rax, [rbp+ptr]"], [335, "mov rax, [rax+70h]"], [336, "mov rdi, rax"], [337, "call _free"], [338, "mov rax, [rbp+ptr]"], [339, "mov rax, [rax+60h]"], [340, "mov rdi, rax"], [341, "call _free"], [342, "mov rax, [rbp+ptr]"], [343, "mov rax, [rax+58h]"], [344, "mov rdi, rax"], [345, "call _free"], [346, "cmp [rbp+var_20], 3"], [347, "jg short loc_40E5C7"], [348, "mov rax, [rbp+ptr]"], [349, "mov rax, [rax+30h]"], [350, "mov rdi, rax"], [351, "call _free"], [352, "cmp [rbp+var_20], 2"], [353, "jg short loc_40E5DE"], [354, "mov rax, [rbp+ptr]"], [355, "mov rax, [rax+38h]"], [356, "mov rdi, rax"], [357, "call _free"], [358, "cmp [rbp+var_20], 1"], [359, "jg short loc_40E5F5"], [360, "mov rax, [rbp+ptr]"], [361, "mov rax, [rax+28h]"], [362, "mov rdi, rax"], [363, "call _free"], [364, "cmp [rbp+var_20], 0"], [365, "jg short loc_40E60C"], [366, "mov rax, [rbp+ptr]"], [367, "mov rax, [rax+20h]"], [368, "mov rdi, rax"], [369, "call _free"], [370, "mov rax, [rbp+ptr]"], [371, "mov rax, [rax+118h]"], [372, "mov rdi, rax"], [373, "call _free"], [374, "mov rax, [rbp+ptr]"], [375, "mov rax, [rax+120h]"], [376, "mov rdi, rax"], [377, "call _free"], [378, "mov rax, [rbp+ptr]"], [379, "mov rax, [rax+128h]"], [380, "mov rdi, rax"], [381, "call _free"], [382, "mov rax, [rbp+ptr]"], [383, "mov rdi, rax"], [384, "call _free"], [385, "nop"], [386, "leave"], [387, "retn"]], "data_dep": [[5, 3], [6, 5], [8, 3], [9, 8], [10, 9], [11, 10], [13, 3], [14, 13], [15, 14], [16, 15], [18, 3], [19, 18], [20, 19], [21, 20], [23, 3], [24, 23], [25, 24], [26, 25], [28, 3], [29, 28], [30, 29], [31, 30], [33, 3], [34, 33], [35, 34], [36, 35], [38, 3], [39, 38], [40, 39], [41, 40], [43, 3], [44, 43], [45, 44], [46, 45], [48, 3], [49, 48], [50, 49], [51, 50], [53, 3], [54, 53], [55, 54], [56, 55], [58, 3], [59, 58], [60, 59], [61, 60], [63, 3], [64, 63], [65, 64], [66, 65], [68, 3], [69, 68], [70, 69], [71, 70], [73, 3], [74, 73], [75, 74], [76, 75], [78, 3], [79, 78], [80, 79], [81, 80], [83, 3], [84, 83], [85, 84], [86, 85], [88, 3], [89, 88], [90, 89], [91, 90], [93, 3], [94, 93], [95, 94], [96, 95], [98, 3], [99, 98], [100, 99], [101, 100], [103, 3], [104, 103], [105, 104], [106, 105], [108, 3], [109, 108], [110, 109], [111, 110], [113, 3], [114, 113], [115, 114], [116, 115], [118, 3], [119, 118], [120, 119], [121, 120], [123, 3], [124, 123], [125, 124], [126, 125], [128, 3], [129, 128], [130, 129], [131, 130], [133, 3], [134, 133], [135, 134], [137, 3], [138, 137], [139, 138], [140, 139], [141, 3], [142, 141], [143, 142], [145, 3], [146, 145], [147, 146], [149, 3], [150, 149], [151, 150], [152, 151], [153, 152], [154, 153], [155, 3], [156, 155], [157, 156], [158, 157], [159, 158], [161, 3], [162, 161], [163, 162], [164, 163], [165, 164], [167, 3], [168, 167], [169, 168], [170, 169], [171, 170], [173, 3], [174, 173], [175, 174], [176, 175], [180, 3], [181, 180], [182, 181], [183, 236], [183, 178], [184, 183], [185, 184], [186, 185], [186, 183], [187, 186], [188, 187], [188, 183], [189, 188], [190, 189], [190, 182], [191, 190], [192, 191], [194, 3], [195, 194], [196, 195], [197, 236], [197, 178], [198, 197], [199, 198], [200, 197], [200, 199], [201, 200], [202, 197], [202, 201], [203, 202], [204, 203], [204, 196], [205, 204], [206, 205], [208, 3], [209, 208], [210, 209], [211, 178], [211, 236], [212, 211], [213, 212], [214, 211], [214, 213], [215, 214], [216, 215], [216, 211], [217, 216], [218, 217], [218, 210], [219, 218], [220, 219], [222, 3], [223, 222], [224, 223], [225, 178], [225, 236], [226, 225], [227, 226], [228, 225], [228, 227], [229, 228], [230, 229], [230, 225], [231, 230], [232, 224], [232, 231], [233, 232], [234, 233], [236, 178], [236, 236], [237, 3], [238, 237], [239, 238], [240, 236], [240, 239], [240, 178], [241, 240], [242, 3], [243, 242], [244, 243], [245, 244], [246, 245], [247, 3], [248, 247], [249, 248], [250, 249], [252, 3], [253, 252], [254, 253], [255, 254], [256, 255], [257, 3], [258, 257], [259, 258], [260, 259], [262, 3], [263, 262], [264, 263], [266, 3], [267, 266], [268, 267], [270, 3], [271, 270], [272, 271], [274, 3], [275, 274], [276, 275], [278, 3], [279, 278], [280, 279], [282, 3], [283, 282], [284, 283], [286, 3], [287, 286], [288, 287], [290, 3], [291, 290], [292, 291], [294, 3], [295, 294], [296, 295], [298, 3], [299, 298], [300, 299], [302, 3], [303, 302], [304, 303], [306, 3], [307, 306], [308, 307], [310, 3], [311, 310], [312, 311], [314, 3], [315, 314], [316, 315], [318, 3], [319, 318], [320, 319], [322, 3], [323, 322], [324, 323], [325, 324], [326, 3], [327, 326], [328, 327], [330, 3], [331, 330], [332, 331], [334, 3], [335, 334], [336, 335], [338, 3], [339, 338], [340, 339], [342, 3], [343, 342], [344, 343], [346, 4], [347, 346], [348, 3], [349, 348], [350, 349], [352, 4], [353, 352], [354, 3], [355, 354], [356, 355], [358, 4], [359, 358], [360, 3], [361, 360], [362, 361], [364, 4], [365, 364], [366, 3], [367, 366], [368, 367], [370, 3], [371, 370], [372, 371], [374, 3], [375, 374], [376, 375], [378, 3], [379, 378], [380, 379], [382, 3], [383, 382], [387, 384]]}
| {"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_40DFA2", "query": "\n\n\nvoid __fastcall sub_40DFA2(__int64 a1, __int64 a2)\n{\n__int64 i; // [rsp+18h] [rbp-8h]\n\nsub_4119FD(a1);\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 16LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 88LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 96LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 104LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 112LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 120LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 128LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 184LL));\nsub_40FE05(*(_QWORD *)(*(_QWORD *)(a1 + 448) + 8LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 192LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 160LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 176LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 168LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 144LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 136LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 152LL));\nsub_40FE05(**(_QWORD **)(a1 + 448));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 72LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 80LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 24LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 32LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 40LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 48LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 56LL));\nfree(*(void **)(*(_QWORD *)(a1 + 448) + 64LL));\nfree(*(void **)(a1 + 448));\nif ( *(_QWORD *)(a1 + 224) )\nfree(*(void **)(a1 + 264));\nfree(*(void **)(a1 + 272));\nif ( ***(__int64 ***)(a1 + 216) > 0 )\n{\nfree(*(void **)(**(_QWORD **)(a1 + 216) + 24LL));\nfree(*(void **)(**(_QWORD **)(a1 + 216) + 16LL));\nfree(*(void **)(**(_QWORD **)(a1 + 216) + 8LL));\n}\nfree(**(void ***)(a1 + 216));\nfor ( i = 0LL; i < *(_QWORD *)(*(_QWORD *)(a1 + 216) + 16LL); ++i )\n{\nfree(*(void **)(*(_QWORD *)(*(_QWORD *)(a1 + 216) + 8LL) + 104 * i + 64));\nfree(*(void **)(*(_QWORD *)(*(_QWORD *)(a1 + 216) + 8LL) + 104 * i + 8));\nfree(*(void **)(*(_QWORD *)(*(_QWORD *)(a1 + 216) + 8LL) + 104 * i + 16));\nfree(*(void **)(*(_QWORD *)(*(_QWORD *)(a1 + 216) + 8LL) + 104 * i + 72));\n}\nif ( *(__int64 *)(*(_QWORD *)(a1 + 216) + 16LL) > 0 )\nfree(*(void **)(*(_QWORD *)(a1 + 216) + 8LL));\nif ( *(__int64 *)(*(_QWORD *)(a1 + 216) + 32LL) > 0 )\nfree(*(void **)(*(_QWORD *)(a1 + 216) + 24LL));\nfree(*(void **)(a1 + 216));\nfree(*(void **)(a1 + 184));\nfree(*(void **)(a1 + 192));\nfree(*(void **)(a1 + 176));\nfree(*(void **)(a1 + 168));\nfree(*(void **)(a1 + 208));\nfree(*(void **)(a1 + 200));\nfree(*(void **)(a1 + 456));\nfree(*(void **)(a1 + 160));\nfree(*(void **)(a1 + 64));\nfree(*(void **)(a1 + 328));\nfree(*(void **)(a1 + 336));\nfree(*(void **)(a1 + 344));\nfree(*(void **)(a1 + 464));\nfree(*(void **)(a1 + 232));\nif ( *(_QWORD *)(a1 + 224) )\nfree(*(void **)(a1 + 224));\nfree(*(void **)(a1 + 104));\nfree(*(void **)(a1 + 112));\nfree(*(void **)(a1 + 96));\nfree(*(void **)(a1 + 88));\nif ( a2 <= 3 )\nfree(*(void **)(a1 + 48));\nif ( a2 <= 2 )\nfree(*(void **)(a1 + 56));\nif ( a2 <= 1 )\nfree(*(void **)(a1 + 40));\nif ( a2 <= 0 )\nfree(*(void **)(a1 + 32));\nfree(*(void **)(a1 + 280));\nfree(*(void **)(a1 + 288));\nfree(*(void **)(a1 + 296));\nfree((void *)a1);\n}\n\n\n\nQ:[a1,a2,sub_40DFA2,sub_4119FD,sub_40FE05,]", "hints": "[]", "response": "{'a1': 'w', 'a2': 'keepvars', 'sub_40DFA2': 'ECOS_cleanup', 'sub_4119FD': 'unset_equilibration', 'sub_40FE05': 'freeSparseMatrix'}"} | [
[
0.7630094885826111,
0.7610355615615845,
0.7544236183166504,
0.7273223400115967,
0.7232450246810913,
0.7170058488845825,
0.7145918607711792,
0.7139701843261719,
0.7117413878440857,
0.7104436159133911,
0.7082021832466125,
0.7039430737495422,
0.703499972820282,
0.7031249403953552,
0.7004498243331909,
0.6879979968070984,
0.6870626211166382,
0.6835687160491943,
0.6803781986236572,
0.6793333888053894
],
[
16123,
155006,
209216,
256482,
132664,
168657,
178358,
168234,
81665,
234808,
223505,
95756,
9408,
195334,
176322,
207894,
12009,
102609,
79502,
187413
]
] |
|
opt_action | dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b | lavabit | pahoehoe | NA | static void opt_action(Options *options, int rc, int longindex, const char *argument)
{
Option *option;
int i = -1;
if (rc != 0 && longindex == -1) /* Short option */
{
for (; options; options = options->parent)
{
for (i = 0; options->options[i].name; ++i)
if (options->options[i].short_name == rc)
break;
if (options->options[i].short_name == rc)
break;
}
}
else if (rc == 0 && longindex != -1) /* Long option */
{
for (i = 0; options; options = options->parent)
{
for (i = 0; longindex && options->options[i].name; ++i)
--longindex;
if (!options->options[i].name)
continue;
if (longindex == 0)
break;
}
}
else
return;
if (!options || i == -1)
return;
option = options->options + i;
if (option->has_arg == required_argument && !argument)
return;
if (option->has_arg == no_argument && argument)
return;
if (argument)
{
switch (option->arg_type)
{
case OPT_NONE:
break;
case OPT_INTEGER:
{
switch (option->action)
{
case OPT_NOTHING:
break;
case OPT_VARIABLE:
*(int *)option->object = int_arg(argument);
break;
case OPT_FUNCTION:
{
int arg = int_arg(argument);
if (option->has_arg == required_argument)
((opt_action_int_t *)option->function)(arg);
else
((opt_action_optional_int_t *)option->function)(&arg);
break;
}
}
break;
}
case OPT_STRING:
{
switch (option->action)
{
case OPT_NOTHING:
break;
case OPT_VARIABLE:
*(const char **)option->object = argument;
break;
case OPT_FUNCTION:
((opt_action_string_t *)option->function)(argument);
break;
}
break;
}
}
}
else
{
switch (option->action)
{
case OPT_NOTHING:
break;
case OPT_VARIABLE:
if (option->arg_type != OPT_STRING)
++*(int *)option->object;
break;
case OPT_FUNCTION:
if (option->action == optional_argument)
((opt_action_optional_int_t *)option->function)(NULL);
else
((opt_action_none_t *)option->function)();
break;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41858E", "function_addr": 4294030, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.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_3C], esi"], [6, "mov [rbp+var_40], edx"], [7, "mov [rbp+var_48], rcx"], [8, "mov [rbp+var_14], 0FFFFFFFFh"], [9, "cmp [rbp+var_3C], 0"], [10, "jz loc_41864B"], [11, "cmp [rbp+var_40], 0FFFFFFFFh"], [12, "jnz loc_41864B"], [13, "jmp short loc_418639"], [14, "mov [rbp+var_14], 0"], [15, "jmp short loc_4185EF"], [16, "mov rax, [rbp+var_38]"], [17, "mov rdx, [rax+8]"], [18, "mov eax, [rbp+var_14]"], [19, "cdqe"], [20, "shl rax, 6"], [21, "add rax, rdx"], [22, "movzx eax, byte ptr [rax+8]"], [23, "movsx eax, al"], [24, "cmp [rbp+var_3C], eax"], [25, "jz short loc_41860D"], [26, "add [rbp+var_14], 1"], [27, "mov rax, [rbp+var_38]"], [28, "mov rdx, [rax+8]"], [29, "mov eax, [rbp+var_14]"], [30, "cdqe"], [31, "shl rax, 6"], [32, "add rax, rdx"], [33, "mov rax, [rax]"], [34, "test rax, rax"], [35, "jnz short loc_4185CB"], [36, "jmp short loc_41860E"], [37, "nop"], [38, "mov rax, [rbp+var_38]"], [39, "mov rdx, [rax+8]"], [40, "mov eax, [rbp+var_14]"], [41, "cdqe"], [42, "shl rax, 6"], [43, "add rax, rdx"], [44, "movzx eax, byte ptr [rax+8]"], [45, "movsx eax, al"], [46, "cmp [rbp+var_3C], eax"], [47, "jz short loc_418645"], [48, "mov rax, [rbp+var_38]"], [49, "mov rax, [rax]"], [50, "mov [rbp+var_38], rax"], [51, "cmp [rbp+var_38], 0"], [52, "jnz short loc_4185C2"], [53, "jmp loc_4186D6"], [54, "nop"], [55, "jmp loc_4186D6"], [56, "cmp [rbp+var_3C], 0"], [57, "jnz loc_41888D"], [58, "cmp [rbp+var_40], 0FFFFFFFFh"], [59, "jz loc_41888D"], [60, "mov [rbp+var_14], 0"], [61, "jmp short loc_4186CB"], [62, "mov [rbp+var_14], 0"], [63, "jmp short loc_418679"], [64, "sub [rbp+var_40], 1"], [65, "add [rbp+var_14], 1"], [66, "cmp [rbp+var_40], 0"], [67, "jz short loc_41869B"], [68, "mov rax, [rbp+var_38]"], [69, "mov rdx, [rax+8]"], [70, "mov eax, [rbp+var_14]"], [71, "cdqe"], [72, "shl rax, 6"], [73, "add rax, rdx"], [74, "mov rax, [rax]"], [75, "test rax, rax"], [76, "jnz short loc_418671"], [77, "mov rax, [rbp+var_38]"], [78, "mov rdx, [rax+8]"], [79, "mov eax, [rbp+var_14]"], [80, "cdqe"], [81, "shl rax, 6"], [82, "add rax, rdx"], [83, "mov rax, [rax]"], [84, "test rax, rax"], [85, "jz short loc_4186BF"], [86, "cmp [rbp+var_40], 0"], [87, "jz short loc_4186D4"], [88, "jmp short loc_4186C0"], [89, "nop"], [90, "mov rax, [rbp+var_38]"], [91, "mov rax, [rax]"], [92, "mov [rbp+var_38], rax"], [93, "cmp [rbp+var_38], 0"], [94, "jnz short loc_418668"], [95, "jmp short loc_4186D5"], [96, "nop"], [97, "nop"], [98, "cmp [rbp+var_38], 0"], [99, "jz loc_418890"], [100, "cmp [rbp+var_14], 0FFFFFFFFh"], [101, "jz loc_418890"], [102, "mov rax, [rbp+var_38]"], [103, "mov rdx, [rax+8]"], [104, "mov eax, [rbp+var_14]"], [105, "cdqe"], [106, "shl rax, 6"], [107, "add rax, rdx"], [108, "mov [rbp+var_20], rax"], [109, "mov rax, [rbp+var_20]"], [110, "mov eax, [rax+20h]"], [111, "cmp eax, 1"], [112, "jnz short loc_41871A"], [113, "cmp [rbp+var_48], 0"], [114, "jz loc_418893"], [115, "mov rax, [rbp+var_20]"], [116, "mov eax, [rax+20h]"], [117, "test eax, eax"], [118, "jnz short loc_418730"], [119, "cmp [rbp+var_48], 0"], [120, "jnz loc_418896"], [121, "cmp [rbp+var_48], 0"], [122, "jz loc_41882D"], [123, "mov rax, [rbp+var_20]"], [124, "mov eax, [rax+24h]"], [125, "cmp eax, 2"], [126, "jz loc_4187E4"], [127, "cmp eax, 2"], [128, "ja loc_4188A6"], [129, "test eax, eax"], [130, "jz loc_418899"], [131, "cmp eax, 1"], [132, "jnz loc_4188A6"], [133, "mov rax, [rbp+var_20]"], [134, "mov eax, [rax+28h]"], [135, "cmp eax, 2"], [136, "jz short loc_41879F"], [137, "cmp eax, 2"], [138, "ja loc_41889C"], [139, "test eax, eax"], [140, "jz short loc_4187DE"], [141, "cmp eax, 1"], [142, "jnz loc_41889C"], [143, "mov rax, [rbp+var_20]"], [144, "mov rbx, [rax+30h]"], [145, "mov rax, [rbp+var_48]"], [146, "mov rdi, rax"], [147, "call sub_4184F2"], [148, "mov [rbx], eax"], [149, "jmp short loc_4187DF"], [150, "mov rax, [rbp+var_48]"], [151, "mov rdi, rax"], [152, "call sub_4184F2"], [153, "mov [rbp+var_24], eax"], [154, "mov rax, [rbp+var_20]"], [155, "mov eax, [rax+20h]"], [156, "cmp eax, 1"], [157, "jnz short loc_4187CB"], [158, "mov rax, [rbp+var_20]"], [159, "mov rdx, [rax+38h]"], [160, "mov eax, [rbp+var_24]"], [161, "mov edi, eax"], [162, "call rdx"], [163, "jmp short loc_4187DF"], [164, "mov rax, [rbp+var_20]"], [165, "mov rdx, [rax+38h]"], [166, "lea rax, [rbp+var_24]"], [167, "mov rdi, rax"], [168, "call rdx"], [169, "jmp short loc_4187DF"], [170, "nop"], [171, "jmp loc_41889C"], [172, "mov rax, [rbp+var_20]"], [173, "mov eax, [rax+28h]"], [174, "cmp eax, 2"], [175, "jz short loc_418817"], [176, "cmp eax, 2"], [177, "ja loc_41889F"], [178, "test eax, eax"], [179, "jz short loc_41882A"], [180, "cmp eax, 1"], [181, "jnz loc_41889F"], [182, "mov rax, [rbp+var_20]"], [183, "mov rax, [rax+30h]"], [184, "mov rdx, [rbp+var_48]"], [185, "mov [rax], rdx"], [186, "jmp short loc_41882B"], [187, "mov rax, [rbp+var_20]"], [188, "mov rdx, [rax+38h]"], [189, "mov rax, [rbp+var_48]"], [190, "mov rdi, rax"], [191, "call rdx"], [192, "jmp short loc_41882B"], [193, "nop"], [194, "jmp short loc_41889F"], [195, "mov rax, [rbp+var_20]"], [196, "mov eax, [rax+28h]"], [197, "cmp eax, 2"], [198, "jz short loc_418864"], [199, "cmp eax, 2"], [200, "ja short loc_4188A6"], [201, "test eax, eax"], [202, "jz short loc_4188A2"], [203, "cmp eax, 1"], [204, "jnz short loc_4188A6"], [205, "mov rax, [rbp+var_20]"], [206, "mov eax, [rax+24h]"], [207, "cmp eax, 2"], [208, "jz short loc_4188A5"], [209, "mov rax, [rbp+var_20]"], [210, "mov rax, [rax+30h]"], [211, "mov edx, [rax]"], [212, "add edx, 1"], [213, "mov [rax], edx"], [214, "jmp short loc_4188A5"], [215, "mov rax, [rbp+var_20]"], [216, "mov eax, [rax+28h]"], [217, "cmp eax, 2"], [218, "jnz short loc_418881"], [219, "mov rax, [rbp+var_20]"], [220, "mov rax, [rax+38h]"], [221, "mov edi, 0"], [222, "call rax"], [223, "jmp short loc_4188A6"], [224, "mov rax, [rbp+var_20]"], [225, "mov rax, [rax+38h]"], [226, "call rax"], [227, "jmp short loc_4188A6"], [228, "nop"], [229, "jmp short loc_4188A6"], [230, "nop"], [231, "jmp short loc_4188A6"], [232, "nop"], [233, "jmp short loc_4188A6"], [234, "nop"], [235, "jmp short loc_4188A6"], [236, "nop"], [237, "jmp short loc_4188A6"], [238, "nop"], [239, "jmp short loc_4188A6"], [240, "nop"], [241, "jmp short loc_4188A6"], [242, "nop"], [243, "jmp short loc_4188A6"], [244, "nop"], [245, "mov rbx, [rbp+var_8]"], [246, "leave"], [247, "retn"]], "data_dep": [[9, 5], [10, 9], [11, 6], [12, 11], [16, 50], [16, 4], [17, 16], [18, 26], [18, 14], [20, 18], [21, 20], [21, 17], [22, 21], [23, 22], [24, 5], [24, 23], [25, 24], [26, 14], [26, 26], [27, 50], [27, 4], [28, 27], [29, 26], [29, 14], [31, 29], [32, 31], [32, 28], [33, 32], [34, 33], [35, 34], [38, 50], [38, 4], [39, 38], [40, 26], [40, 14], [42, 40], [43, 39], [43, 42], [44, 43], [45, 44], [46, 45], [46, 5], [47, 46], [48, 50], [48, 4], [49, 48], [50, 49], [51, 50], [51, 4], [52, 51], [56, 5], [57, 56], [58, 6], [59, 58], [64, 64], [64, 6], [65, 65], [65, 62], [66, 64], [66, 6], [67, 66], [68, 4], [68, 92], [69, 68], [70, 65], [70, 62], [72, 70], [73, 69], [73, 72], [74, 73], [75, 74], [76, 75], [77, 92], [77, 4], [78, 77], [79, 62], [79, 65], [81, 79], [82, 81], [82, 78], [83, 82], [84, 83], [85, 84], [86, 64], [86, 6], [87, 86], [90, 92], [90, 4], [91, 90], [92, 91], [93, 4], [93, 92], [94, 93], [98, 92], [98, 50], [98, 4], [99, 98], [100, 14], [100, 62], [100, 8], [100, 65], [100, 60], [100, 26], [101, 100], [102, 50], [102, 4], [102, 92], [103, 102], [104, 62], [104, 8], [104, 65], [104, 26], [104, 60], [104, 14], [106, 104], [107, 106], [107, 103], [108, 107], [109, 108], [110, 109], [111, 110], [112, 111], [113, 7], [114, 113], [115, 108], [116, 115], [117, 116], [118, 117], [119, 7], [120, 119], [121, 7], [122, 121], [123, 108], [124, 123], [125, 124], [126, 125], [127, 124], [128, 127], [129, 124], [130, 129], [131, 129], [132, 131], [133, 108], [134, 133], [135, 134], [136, 135], [137, 134], [138, 137], [139, 134], [140, 139], [141, 139], [142, 141], [143, 108], [144, 143], [145, 7], [146, 145], [148, 147], [148, 144], [150, 7], [151, 150], [153, 152], [154, 108], [155, 154], [156, 155], [157, 156], [158, 108], [159, 158], [160, 153], [161, 160], [162, 159], [164, 108], [165, 164], [166, 153], [166, 164], [167, 166], [168, 165], [172, 108], [173, 172], [174, 173], [175, 174], [176, 173], [177, 176], [178, 173], [179, 178], [180, 178], [181, 180], [182, 108], [183, 182], [184, 7], [185, 184], [185, 183], [187, 108], [188, 187], [189, 7], [190, 189], [191, 188], [195, 108], [196, 195], [197, 196], [198, 197], [199, 196], [200, 199], [201, 196], [202, 201], [203, 201], [204, 203], [205, 108], [206, 205], [207, 206], [208, 207], [209, 108], [210, 209], [211, 210], [212, 211], [213, 210], [213, 212], [215, 108], [216, 215], [217, 216], [218, 217], [219, 108], [220, 219], [222, 220], [224, 108], [225, 224], [226, 225], [247, 129], [247, 147], [247, 49], [247, 124], [247, 206], [247, 117], [247, 110], [247, 183], [247, 201], [247, 222], [247, 178], [247, 162], [247, 226], [247, 91], [247, 210], [247, 45], [247, 173], [247, 139], [247, 84], [247, 196], [247, 168], [247, 134], [247, 191]]}
| {"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_41858E", "query": "\n\n\nvoid __fastcall sub_41858E(_QWORD *a1, unsigned int a2, unsigned int a3, const char *a4)\n{\nunsigned int v4; // eax\nunsigned int v5; // eax\n_DWORD *v6; // rbx\nunsigned int v7; // eax\nunsigned int v8; // eax\nunsigned __int64 v9; // [rsp+10h] [rbp-40h]\nunsigned int v11; // [rsp+2Ch] [rbp-24h] BYREF\n__int64 v12; // [rsp+30h] [rbp-20h]\nint i; // [rsp+3Ch] [rbp-14h]\n\nv9 = __PAIR64__(a2, a3);\ni = -1;\nif ( a2 && a3 == -1 )\n{\nwhile ( a1 )\n{\nfor ( i = 0; *(_QWORD *)(a1[1] + ((__int64)i << 6)) && a2 != *(char *)(a1[1] + ((__int64)i << 6) + 8); ++i )\n;\nif ( a2 == *(char *)(a1[1] + ((__int64)i << 6) + 8) )\nbreak;\na1 = (_QWORD *)*a1;\n}\n}\nelse\n{\nif ( __PAIR64__(a2, a3) >= 0xFFFFFFFF )\nreturn;\ni = 0;\nwhile ( a1 )\n{\nfor ( i = 0; (_DWORD)v9 && *(_QWORD *)(a1[1] + ((__int64)i << 6)); ++i )\nLODWORD(v9) = v9 - 1;\nif ( *(_QWORD *)(a1[1] + ((__int64)i << 6)) && !(_DWORD)v9 )\nbreak;\na1 = (_QWORD *)*a1;\n}\n}\nif ( a1 )\n{\nif ( i != -1 )\n{\nv12 = a1[1] + ((__int64)i << 6);\nif ( (*(_DWORD *)(v12 + 32) != 1 || a4) && (*(_DWORD *)(v12 + 32) || !a4) )\n{\nif ( a4 )\n{\nv4 = *(_DWORD *)(v12 + 36);\nif ( v4 == 2 )\n{\nv7 = *(_DWORD *)(v12 + 40);\nif ( v7 == 2 )\n{\n(*(void (__fastcall **)(const char *))(v12 + 56))(a4);\n}\nelse if ( v7 <= 2 && v7 )\n{\n**(_QWORD **)(v12 + 48) = a4;\n}\n}\nelse if ( v4 <= 2 && v4 )\n{\nv5 = *(_DWORD *)(v12 + 40);\nif ( v5 == 2 )\n{\nv11 = sub_4184F2(a4);\nif ( *(_DWORD *)(v12 + 32) == 1 )\n(*(void (__fastcall **)(_QWORD))(v12 + 56))(v11);\nelse\n(*(void (__fastcall **)(unsigned int *))(v12 + 56))(&v11);\n}\nelse if ( v5 <= 2 )\n{\nif ( v5 )\n{\nv6 = *(_DWORD **)(v12 + 48);\n*v6 = sub_4184F2(a4);\n}\n}\n}\n}\nelse\n{\nv8 = *(_DWORD *)(v12 + 40);\nif ( v8 == 2 )\n{\n(*(void (__fastcall **)(_QWORD))(v12 + 56))(0LL);\n}\nelse if ( v8 <= 2 && v8 && *(_DWORD *)(v12 + 36) != 2 )\n{\n++**(_DWORD **)(v12 + 48);\n}\n}\n}\n}\n}\n}\n\n\n\nQ:[a3,a4,a1,a2,v9,v11,v12,sub_41858E,sub_4184F2,]", "hints": "[]", "response": "{'a3': 'longindex', 'a4': 'argument', 'a1': 'options', 'a2': 'rc', 'v9': 'longindexa', 'v11': 'arg', 'v12': 'option', 'sub_41858E': 'opt_action', 'sub_4184F2': 'int_arg'}"} | [
[
0.8082245588302612,
0.7681955099105835,
0.7377268075942993,
0.7342085838317871,
0.7326921224594116,
0.7306784391403198,
0.7298446297645569,
0.7262449264526367,
0.7146110534667969,
0.7100374698638916,
0.7092769145965576,
0.7091532945632935,
0.7091532945632935,
0.7069658041000366,
0.7053017616271973,
0.7032626867294312,
0.696439266204834,
0.6962693929672241,
0.6941096782684326,
0.6937240362167358
],
[
223179,
219908,
146461,
129986,
243017,
212523,
254200,
96380,
263166,
181986,
182463,
133505,
21569,
63471,
92966,
204838,
51068,
127716,
81557,
134362
]
] |
|
array_insert | e6d6d4dc8e5280f9708122a1d4d9f1e8953e27fedece440c468ce415d5acd9c1 | cloudwu | rudp | NA | static void
array_insert(struct array *a, int id) {
int i;
for (i=0;i<a->n;i++) {
if (a->a[i] == id)
return;
if (a->a[i] > id) {
break;
}
}
// insert before i
if (a->n >= a->cap) {
if (a->cap == 0) {
a->cap = 16;
} else {
a->cap *= 2;
}
a->a = realloc(a->a, sizeof(int) * a->cap);
}
int j;
for (j=a->n;j>i;j--) {
a->a[j] = a->a[j-1];
}
a->a[i] = id;
++a->n;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4014D5", "function_addr": 4199637, "binary_name": "e6d6d4dc8e5280f9708122a1d4d9f1e8953e27fedece440c468ce415d5acd9c1.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 [rbp+var_4], 0"], [6, "jmp short loc_40152B"], [7, "mov rax, [rbp+var_18]"], [8, "mov rdx, [rax+8]"], [9, "mov eax, [rbp+var_4]"], [10, "cdqe"], [11, "shl rax, 2"], [12, "add rax, rdx"], [13, "mov eax, [rax]"], [14, "cmp [rbp+var_1C], eax"], [15, "jz loc_401610"], [16, "mov rax, [rbp+var_18]"], [17, "mov rdx, [rax+8]"], [18, "mov eax, [rbp+var_4]"], [19, "cdqe"], [20, "shl rax, 2"], [21, "add rax, rdx"], [22, "mov eax, [rax]"], [23, "cmp [rbp+var_1C], eax"], [24, "jl short loc_401539"], [25, "add [rbp+var_4], 1"], [26, "mov rax, [rbp+var_18]"], [27, "mov eax, [rax+4]"], [28, "cmp [rbp+var_4], eax"], [29, "jl short loc_4014ED"], [30, "jmp short loc_40153A"], [31, "nop"], [32, "mov rax, [rbp+var_18]"], [33, "mov edx, [rax+4]"], [34, "mov rax, [rbp+var_18]"], [35, "mov eax, [rax]"], [36, "cmp edx, eax"], [37, "jl short loc_40159B"], [38, "mov rax, [rbp+var_18]"], [39, "mov eax, [rax]"], [40, "test eax, eax"], [41, "jnz short loc_401561"], [42, "mov rax, [rbp+var_18]"], [43, "mov dword ptr [rax], 10h"], [44, "jmp short loc_401570"], [45, "mov rax, [rbp+var_18]"], [46, "mov eax, [rax]"], [47, "lea edx, [rax+rax]"], [48, "mov rax, [rbp+var_18]"], [49, "mov [rax], edx"], [50, "mov rax, [rbp+var_18]"], [51, "mov eax, [rax]"], [52, "cdqe"], [53, "lea rdx, ds:0[rax*4]"], [54, "mov rax, [rbp+var_18]"], [55, "mov rax, [rax+8]"], [56, "mov rsi, rdx"], [57, "mov rdi, rax"], [58, "call _realloc"], [59, "mov rdx, [rbp+var_18]"], [60, "mov [rdx+8], rax"], [61, "mov rax, [rbp+var_18]"], [62, "mov eax, [rax+4]"], [63, "mov [rbp+var_8], eax"], [64, "jmp short loc_4015DC"], [65, "mov rax, [rbp+var_18]"], [66, "mov rdx, [rax+8]"], [67, "mov eax, [rbp+var_8]"], [68, "cdqe"], [69, "shl rax, 2"], [70, "sub rax, 4"], [71, "lea rcx, [rdx+rax]"], [72, "mov rax, [rbp+var_18]"], [73, "mov rdx, [rax+8]"], [74, "mov eax, [rbp+var_8]"], [75, "cdqe"], [76, "shl rax, 2"], [77, "add rdx, rax"], [78, "mov eax, [rcx]"], [79, "mov [rdx], eax"], [80, "sub [rbp+var_8], 1"], [81, "mov eax, [rbp+var_8]"], [82, "cmp eax, [rbp+var_4]"], [83, "jg short loc_4015A7"], [84, "mov rax, [rbp+var_18]"], [85, "mov rdx, [rax+8]"], [86, "mov eax, [rbp+var_4]"], [87, "cdqe"], [88, "shl rax, 2"], [89, "add rdx, rax"], [90, "mov eax, [rbp+var_1C]"], [91, "mov [rdx], eax"], [92, "mov rax, [rbp+var_18]"], [93, "mov eax, [rax+4]"], [94, "lea edx, [rax+1]"], [95, "mov rax, [rbp+var_18]"], [96, "mov [rax+4], edx"], [97, "jmp short locret_401611"], [98, "nop"], [99, "leave"], [100, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 5], [9, 25], [11, 9], [12, 8], [12, 11], [13, 12], [14, 13], [14, 4], [15, 14], [16, 3], [17, 16], [18, 5], [18, 25], [20, 18], [21, 20], [21, 17], [22, 21], [23, 4], [23, 22], [24, 23], [25, 25], [25, 5], [26, 3], [27, 26], [28, 5], [28, 25], [28, 27], [29, 28], [32, 3], [33, 32], [34, 3], [35, 34], [36, 33], [36, 35], [37, 36], [38, 3], [39, 38], [40, 39], [41, 40], [42, 3], [43, 42], [45, 3], [46, 45], [47, 33], [47, 46], [48, 3], [49, 48], [49, 47], [50, 3], [51, 50], [51, 43], [51, 49], [51, 60], [53, 47], [53, 33], [54, 3], [55, 43], [55, 54], [55, 49], [55, 60], [56, 53], [57, 55], [59, 3], [60, 59], [60, 58], [61, 3], [62, 60], [62, 43], [62, 61], [62, 49], [63, 62], [65, 3], [66, 60], [66, 43], [66, 49], [66, 79], [66, 65], [67, 63], [67, 80], [69, 67], [70, 69], [71, 49], [71, 79], [71, 60], [71, 71], [71, 43], [71, 70], [72, 3], [73, 60], [73, 43], [73, 72], [73, 49], [73, 79], [74, 63], [74, 80], [76, 74], [77, 76], [77, 73], [78, 43], [78, 49], [78, 79], [78, 60], [78, 71], [79, 78], [79, 77], [80, 80], [80, 63], [81, 80], [81, 63], [82, 81], [82, 5], [82, 25], [83, 82], [84, 3], [85, 91], [85, 84], [85, 43], [85, 79], [85, 49], [85, 60], [85, 96], [86, 5], [86, 25], [88, 86], [89, 88], [89, 85], [90, 4], [91, 89], [91, 90], [92, 3], [93, 92], [93, 91], [94, 89], [94, 91], [94, 93], [95, 3], [96, 95], [96, 94], [100, 13], [100, 95]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e6d6d4dc8e5280f9708122a1d4d9f1e8953e27fedece440c468ce415d5acd9c1_e6d6d4dc8e5280f9708122a1d4d9f1e8953e27fedece440c468ce415d5acd9c1.jsonl.gz", "strip_func_name": "sub_4014D5", "query": "\n\n\nint *__fastcall sub_4014D5(int *a1, int a2)\n{\nint *result; // rax\nint j; // [rsp+18h] [rbp-8h]\nint i; // [rsp+1Ch] [rbp-4h]\n\nfor ( i = 0; i < a1[1]; ++i )\n{\nresult = (int *)*(unsigned int *)(*((_QWORD *)a1 + 1) + 4LL * i);\nif ( a2 == (_DWORD)result )\nreturn result;\nif ( a2 < *(_DWORD *)(*((_QWORD *)a1 + 1) + 4LL * i) )\nbreak;\n}\nif ( a1[1] >= *a1 )\n{\nif ( *a1 )\n*a1 *= 2;\nelse\n*a1 = 16;\n*((_QWORD *)a1 + 1) = realloc(*((void **)a1 + 1), 4LL * *a1);\n}\nfor ( j = a1[1]; j > i; --j )\n*(_DWORD *)(4LL * j + *((_QWORD *)a1 + 1)) = *(_DWORD *)(*((_QWORD *)a1 + 1) + 4LL * j - 4);\n*(_DWORD *)(4LL * i + *((_QWORD *)a1 + 1)) = a2;\nresult = a1;\n++a1[1];\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_4014D5,]", "hints": "[]", "response": "{'a1': 'a', 'a2': 'id', 'sub_4014D5': 'array_insert'}"} | [
[
0.8112154603004456,
0.7997017502784729,
0.7968590259552002,
0.7864099144935608,
0.7824190855026245,
0.7759950757026672,
0.7719196677207947,
0.7563456892967224,
0.7555669546127319,
0.7555185556411743,
0.755327045917511,
0.7546858787536621,
0.7502391934394836,
0.7483059167861938,
0.7462043762207031,
0.7434902191162109,
0.7430883049964905,
0.7424401640892029,
0.7417305707931519,
0.7385019063949585
],
[
46286,
89073,
1448,
110095,
195448,
92739,
246064,
62373,
131016,
178903,
2382,
250318,
74120,
133325,
247089,
255174,
78236,
232577,
59592,
233867
]
] |
|
s2n_connection_set_secrets | 4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3 | aws | s2n-tls | NA | S2N_RESULT s2n_connection_set_secrets(struct s2n_connection *conn)
{
RESULT_ENSURE_REF(conn);
conn->secure->cipher_suite = &s2n_tls13_aes_256_gcm_sha384;
const struct s2n_cipher *cipher = conn->secure->cipher_suite->record_alg->cipher;
uint8_t client_key_bytes[S2N_TLS13_SECRET_MAX_LEN] = "client key";
struct s2n_blob client_key = { 0 };
RESULT_GUARD_POSIX(s2n_blob_init(&client_key, client_key_bytes, cipher->key_material_size));
RESULT_GUARD_POSIX(cipher->init(&conn->secure->client_key));
RESULT_GUARD_POSIX(cipher->set_encryption_key(&conn->secure->client_key, &client_key));
uint8_t server_key_bytes[S2N_TLS13_SECRET_MAX_LEN] = "server key";
struct s2n_blob server_key = { 0 };
RESULT_GUARD_POSIX(s2n_blob_init(&server_key, server_key_bytes, cipher->key_material_size));
RESULT_GUARD_POSIX(cipher->init(&conn->secure->server_key));
RESULT_GUARD_POSIX(cipher->set_encryption_key(&conn->secure->server_key, &server_key));
conn->client = conn->secure;
conn->server = conn->secure;
return S2N_RESULT_OK;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4342BA", "function_addr": 4407994, "binary_name": "4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0D0h"], [3, "mov [rbp+var_C8], rdi"], [4, "mov rax, fs:28h"], [5, "mov [rbp+var_8], rax"], [6, "xor eax, eax"], [7, "cmp [rbp+var_C8], 0"], [8, "jnz short loc_434324"], [9, "mov rax, fs:0"], [10, "lea rax, [rax-78h]"], [11, "lea rdx, aErrorEncounter_21"], [12, "mov [rax], rdx"], [13, "mov rax, fs:0"], [14, "lea rax, [rax-80h]"], [15, "mov dword ptr [rax], 18000009h"], [16, "call sub_48C888"], [17, "mov eax, 0FFFFFFFFh"], [18, "jmp loc_434577"], [19, "mov rax, [rbp+var_C8]"], [20, "mov rax, [rax+0E0h]"], [21, "mov rdx, offset unk_5DDDE0"], [22, "mov [rax], rdx"], [23, "mov rax, [rbp+var_C8]"], [24, "mov rax, [rax+0E0h]"], [25, "mov rax, [rax]"], [26, "mov rax, [rax+28h]"], [27, "mov rax, [rax]"], [28, "mov [rbp+var_B8], rax"], [29, "mov rax, 6B20746E65696C63h"], [30, "mov edx, 7965h"], [31, "mov [rbp+var_70], rax"], [32, "mov [rbp+var_68], rdx"], [33, "mov [rbp+var_60], 0"], [34, "mov [rbp+var_58], 0"], [35, "mov [rbp+var_50], 0"], [36, "mov [rbp+var_48], 0"], [37, "mov [rbp+var_B0], 0"], [38, "mov [rbp+var_A8], 0"], [39, "mov [rbp+var_A0], 0"], [40, "mov rax, [rbp+var_B8]"], [41, "movzx eax, byte ptr [rax+30h]"], [42, "movzx edx, al"], [43, "lea rcx, [rbp+var_70]"], [44, "lea rax, [rbp+var_B0]"], [45, "mov rsi, rcx"], [46, "mov rdi, rax"], [47, "call sub_434A68"], [48, "test eax, eax"], [49, "jns short loc_4343E5"], [50, "mov eax, 0FFFFFFFFh"], [51, "jmp loc_434577"], [52, "mov rax, [rbp+var_B8]"], [53, "mov rax, [rax+40h]"], [54, "mov rdx, [rbp+var_C8]"], [55, "mov rdx, [rdx+0E0h]"], [56, "add rdx, 8"], [57, "mov rdi, rdx"], [58, "call rax"], [59, "test eax, eax"], [60, "jns short loc_434415"], [61, "mov eax, 0FFFFFFFFh"], [62, "jmp loc_434577"], [63, "mov rax, [rbp+var_B8]"], [64, "mov rdx, [rax+50h]"], [65, "mov rax, [rbp+var_C8]"], [66, "mov rax, [rax+0E0h]"], [67, "lea rcx, [rax+8]"], [68, "lea rax, [rbp+var_B0]"], [69, "mov rsi, rax"], [70, "mov rdi, rcx"], [71, "call rdx"], [72, "test eax, eax"], [73, "jns short loc_43444F"], [74, "mov eax, 0FFFFFFFFh"], [75, "jmp loc_434577"], [76, "mov rax, 6B20726576726573h"], [77, "mov edx, 7965h"], [78, "mov [rbp+var_40], rax"], [79, "mov [rbp+var_38], rdx"], [80, "mov [rbp+var_30], 0"], [81, "mov [rbp+var_28], 0"], [82, "mov [rbp+var_20], 0"], [83, "mov [rbp+var_18], 0"], [84, "mov [rbp+var_90], 0"], [85, "mov [rbp+var_88], 0"], [86, "mov [rbp+var_80], 0"], [87, "mov rax, [rbp+var_B8]"], [88, "movzx eax, byte ptr [rax+30h]"], [89, "movzx edx, al"], [90, "lea rcx, [rbp+var_40]"], [91, "lea rax, [rbp+var_90]"], [92, "mov rsi, rcx"], [93, "mov rdi, rax"], [94, "call sub_434A68"], [95, "test eax, eax"], [96, "jns short loc_4344D6"], [97, "mov eax, 0FFFFFFFFh"], [98, "jmp loc_434577"], [99, "mov rax, [rbp+var_B8]"], [100, "mov rax, [rax+40h]"], [101, "mov rdx, [rbp+var_C8]"], [102, "mov rdx, [rdx+0E0h]"], [103, "add rdx, 10h"], [104, "mov rdi, rdx"], [105, "call rax"], [106, "test eax, eax"], [107, "jns short loc_434503"], [108, "mov eax, 0FFFFFFFFh"], [109, "jmp short loc_434577"], [110, "mov rax, [rbp+var_B8]"], [111, "mov rdx, [rax+50h]"], [112, "mov rax, [rbp+var_C8]"], [113, "mov rax, [rax+0E0h]"], [114, "lea rcx, [rax+10h]"], [115, "lea rax, [rbp+var_90]"], [116, "mov rsi, rax"], [117, "mov rdi, rcx"], [118, "call rdx"], [119, "test eax, eax"], [120, "jns short loc_43453A"], [121, "mov eax, 0FFFFFFFFh"], [122, "jmp short loc_434577"], [123, "mov rax, [rbp+var_C8]"], [124, "mov rdx, [rax+0E0h]"], [125, "mov rax, [rbp+var_C8]"], [126, "mov [rax+240h], rdx"], [127, "mov rax, [rbp+var_C8]"], [128, "mov rdx, [rax+0E0h]"], [129, "mov rax, [rbp+var_C8]"], [130, "mov [rax+248h], rdx"], [131, "mov eax, 0"], [132, "mov rsi, [rbp+var_8]"], [133, "sub rsi, fs:28h"], [134, "jz short locret_43458B"], [135, "call ___stack_chk_fail"], [136, "leave"], [137, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [10, 9], [12, 10], [12, 11], [14, 13], [14, 12], [15, 14], [19, 3], [20, 19], [22, 21], [22, 20], [23, 3], [24, 23], [24, 22], [25, 22], [25, 24], [26, 25], [26, 22], [27, 22], [27, 26], [28, 27], [31, 29], [32, 30], [40, 28], [41, 40], [41, 22], [42, 41], [43, 31], [44, 37], [44, 41], [45, 43], [46, 44], [48, 47], [49, 48], [52, 28], [53, 52], [53, 22], [54, 3], [55, 22], [55, 54], [56, 55], [57, 56], [58, 53], [59, 58], [60, 59], [63, 28], [64, 63], [64, 22], [65, 3], [66, 22], [66, 65], [67, 43], [67, 22], [67, 66], [68, 66], [68, 37], [69, 68], [70, 67], [71, 64], [72, 71], [73, 72], [78, 76], [79, 77], [87, 28], [88, 22], [88, 87], [89, 88], [90, 78], [90, 67], [91, 84], [91, 88], [92, 90], [93, 91], [95, 94], [96, 95], [99, 28], [100, 22], [100, 99], [101, 3], [102, 22], [102, 101], [103, 102], [104, 103], [105, 100], [106, 105], [107, 106], [110, 28], [111, 110], [111, 22], [112, 3], [113, 112], [113, 22], [114, 113], [114, 90], [114, 22], [115, 84], [115, 113], [116, 115], [117, 114], [118, 111], [119, 118], [120, 119], [123, 3], [124, 126], [124, 130], [124, 123], [124, 22], [125, 3], [126, 125], [126, 124], [127, 3], [128, 126], [128, 127], [129, 3], [130, 128], [130, 129], [132, 5], [133, 132], [134, 133], [137, 74], [137, 131], [137, 97], [137, 17], [137, 108], [137, 121], [137, 50], [137, 61]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3_4015aeff5ec8b05cb537648c43dec9af68026355fef5b1c62daf5fe988f161f3.jsonl.gz", "strip_func_name": "sub_4342BA", "query": "\n\n\n__int64 __fastcall sub_4342BA(__int64 a1)\n{\n__int64 result; // rax\n__int64 v2; // [rsp+18h] [rbp-B8h]\n__int64 v3[4]; // [rsp+20h] [rbp-B0h] BYREF\n__int64 v4[4]; // [rsp+40h] [rbp-90h] BYREF\n__int64 v5[6]; // [rsp+60h] [rbp-70h] BYREF\n__int64 v6[8]; // [rsp+90h] [rbp-40h] BYREF\n\nv6[7] = __readfsqword(0x28u);\nif ( a1 )\n{\n**(_QWORD **)(a1 + 224) = &unk_5DDDE0;\nv2 = **(_QWORD **)(**(_QWORD **)(a1 + 224) + 40LL);\nv5[0] = 0x6B20746E65696C63LL;\nv5[1] = 31077LL;\nv5[2] = 0LL;\nv5[3] = 0LL;\nv5[4] = 0LL;\nv5[5] = 0LL;\nv3[0] = 0LL;\nv3[1] = 0LL;\nv3[2] = 0LL;\nif ( (int)sub_434A68(v3, v5, *(unsigned __int8 *)(v2 + 48)) >= 0 )\n{\nif ( (*(int (__fastcall **)(__int64))(v2 + 64))(*(_QWORD *)(a1 + 224) + 8LL) >= 0 )\n{\nif ( (*(int (__fastcall **)(__int64, __int64 *))(v2 + 80))(*(_QWORD *)(a1 + 224) + 8LL, v3) >= 0 )\n{\nv6[0] = 0x6B20726576726573LL;\nv6[1] = 31077LL;\nv6[2] = 0LL;\nv6[3] = 0LL;\nv6[4] = 0LL;\nv6[5] = 0LL;\nv4[0] = 0LL;\nv4[1] = 0LL;\nv4[2] = 0LL;\nif ( (int)sub_434A68(v4, v6, *(unsigned __int8 *)(v2 + 48)) >= 0 )\n{\nif ( (*(int (__fastcall **)(__int64))(v2 + 64))(*(_QWORD *)(a1 + 224) + 16LL) >= 0 )\n{\nif ( (*(int (__fastcall **)(__int64, __int64 *))(v2 + 80))(*(_QWORD *)(a1 + 224) + 16LL, v4) >= 0 )\n{\n*(_QWORD *)(a1 + 576) = *(_QWORD *)(a1 + 224);\n*(_QWORD *)(a1 + 584) = *(_QWORD *)(a1 + 224);\nresult = 0LL;\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\n*(_QWORD *)(__readfsqword(0) - 120) = \"Error encountered in s2n_connection_test_utils.c:291\";\n*(_DWORD *)(__readfsqword(0) - 128) = 402653193;\nsub_48C888();\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v2,v3,v4,v5,v6,sub_4342BA,sub_434A68,sub_48C888,]", "hints": "[]", "response": "{'a1': 'conn', 'v2': 'cipher', 'v3': 'client_key', 'v4': 'server_key', 'v5': 'client_key_bytes', 'v6': 'server_key_bytes', 'sub_4342BA': 's2n_connection_set_secrets', 'sub_434A68': 's2n_blob_init', 'sub_48C888': 's2n_calculate_stacktrace'}"} | [
[
0.7514752149581909,
0.7509620189666748,
0.7505345344543457,
0.750022828578949,
0.7396645545959473,
0.7301324009895325,
0.7287304401397705,
0.7201771140098572,
0.7177609801292419,
0.7132459878921509,
0.7128740549087524,
0.7121212482452393,
0.7086560726165771,
0.7062906622886658,
0.7008878588676453,
0.699413001537323,
0.6922153830528259,
0.6906363368034363,
0.689177393913269,
0.6883494853973389
],
[
197877,
146285,
72475,
165617,
174673,
156957,
212313,
259994,
98763,
123619,
163331,
164599,
136630,
214383,
210584,
221598,
129975,
161610,
189671,
168540
]
] |
|
load_rules | af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4 | rgerganov | nfqsed | NA | void load_rules(const char *rules_file)
{
FILE *f;
char *line = NULL;
size_t len = 0;
ssize_t read;
f = fopen(rules_file, "r");
if (!f) {
fprintf(stderr, "cannot open %s", rules_file);
exit(1);
}
while ((read = getline(&line, &len, f)) != -1) {
if (line[0] == '#' || read == 1) {
// skip comments and empty lines
continue;
}
if (line[read-1] == '\n') {
line[read-1] = 0;
}
add_rule(line);
}
free(line);
fclose(f);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401858", "function_addr": 4200536, "binary_name": "af49be92a1bdab7206b2187d7806b8321f130a844037ab713dd9daa5f84e75c4.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+lineptr], 0"], [5, "mov [rbp+n], 0"], [6, "mov rax, [rbp+filename]"], [7, "mov esi, offset modes"], [8, "mov rdi, rax"], [9, "call _fopen"], [10, "mov [rbp+stream], rax"], [11, "cmp [rbp+stream], 0"], [12, "jnz short loc_4018FF"], [13, "mov rax, cs:stderr"], [14, "mov rdx, [rbp+filename]"], [15, "mov esi, offset aCannotOpenS"], [16, "mov rdi, rax"], [17, "mov eax, 0"], [18, "call _fprintf"], [19, "mov edi, 1"], [20, "call _exit"], [21, "mov rax, [rbp+lineptr]"], [22, "movzx eax, byte ptr [rax]"], [23, "cmp al, 23h "], [24, "jz short loc_4018FF"], [25, "cmp [rbp+var_10], 1"], [26, "jnz short loc_4018CB"], [27, "jmp short loc_4018FF"], [28, "mov rdx, [rbp+lineptr]"], [29, "mov rax, [rbp+var_10]"], [30, "sub rax, 1"], [31, "add rax, rdx"], [32, "movzx eax, byte ptr [rax]"], [33, "cmp al, 0Ah"], [34, "jnz short loc_4018F3"], [35, "mov rdx, [rbp+lineptr]"], [36, "mov rax, [rbp+var_10]"], [37, "sub rax, 1"], [38, "add rax, rdx"], [39, "mov byte ptr [rax], 0"], [40, "mov rax, [rbp+lineptr]"], [41, "mov rdi, rax"], [42, "call sub_4013FC"], [43, "mov rdx, [rbp+stream]"], [44, "lea rcx, [rbp+n]"], [45, "lea rax, [rbp+lineptr]"], [46, "mov rsi, rcx"], [47, "mov rdi, rax"], [48, "call _getline"], [49, "mov [rbp+var_10], rax"], [50, "cmp [rbp+var_10], 0FFFFFFFFFFFFFFFFh"], [51, "jnz short loc_4018B7"], [52, "mov rax, [rbp+lineptr]"], [53, "mov rdi, rax"], [54, "call _free"], [55, "mov rax, [rbp+stream]"], [56, "mov rdi, rax"], [57, "call _fclose"], [58, "nop"], [59, "leave"], [60, "retn"]], "data_dep": [[6, 3], [8, 6], [10, 9], [11, 10], [12, 11], [14, 3], [16, 13], [21, 4], [22, 21], [22, 39], [23, 22], [24, 23], [25, 49], [26, 25], [28, 4], [29, 49], [30, 29], [31, 28], [31, 30], [32, 31], [32, 39], [33, 32], [34, 33], [35, 4], [36, 49], [37, 36], [38, 35], [38, 37], [39, 38], [40, 4], [41, 40], [43, 10], [44, 5], [44, 44], [45, 4], [45, 22], [45, 9], [45, 42], [46, 44], [47, 45], [49, 48], [50, 49], [51, 50], [52, 4], [53, 52], [55, 10], [56, 55], [60, 57]]}
| {"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_401858", "query": "\n\n\nint __fastcall sub_401858(const char *a1)\n{\nsize_t n; // [rsp+10h] [rbp-20h] BYREF\nchar *lineptr; // [rsp+18h] [rbp-18h] BYREF\n__ssize_t v4; // [rsp+20h] [rbp-10h]\nFILE *stream; // [rsp+28h] [rbp-8h]\n\nlineptr = 0LL;\nn = 0LL;\nstream = fopen(a1, \"r\");\nif ( !stream )\n{\nfprintf(stderr, \"cannot open %s\", a1);\nexit(1);\n}\nwhile ( 1 )\n{\nv4 = getline(&lineptr, &n, stream);\nif ( v4 == -1 )\nbreak;\nif ( *lineptr != 35 && v4 != 1 )\n{\nif ( lineptr[v4 - 1] == 10 )\nlineptr[v4 - 1] = 0;\nsub_4013FC(lineptr);\n}\n}\nfree(lineptr);\nreturn fclose(stream);\n}\n\n\n\nQ:[a1,n,lineptr,v4,stream,sub_401858,sub_4013FC,]", "hints": "[]", "response": "{'a1': 'rules_file', 'n': 'len', 'lineptr': 'line', 'v4': 'read', 'stream': 'f', 'sub_401858': 'load_rules', 'sub_4013FC': 'add_rule'}"} | [
[
0.8673350811004639,
0.8388537764549255,
0.8147575855255127,
0.8133105039596558,
0.8108145594596863,
0.8017684817314148,
0.7948088049888611,
0.7813328504562378,
0.7787978649139404,
0.7740166187286377,
0.7736069560050964,
0.7644470930099487,
0.7632986307144165,
0.763027012348175,
0.7571014761924744,
0.7570326328277588,
0.7533420324325562,
0.7529851794242859,
0.7523566484451294,
0.7522149085998535
],
[
213372,
188867,
3191,
55178,
207594,
23768,
254587,
161009,
169039,
179919,
224153,
162856,
202260,
38670,
218161,
114884,
144781,
155690,
127807,
229432
]
] |
|
m_setbytes | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_setbytes(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 >=3 && be_isint(vm, 2) && (be_isbytes(vm, 3))) {
int32_t idx = be_toint(vm, 2);
size_t from_len_total;
const uint8_t* buf_ptr = (const uint8_t*) be_tobytes(vm, 3, &from_len_total);
if (idx < 0) { idx = 0; }
if (idx >= attr.len) { idx = attr.len; }
int32_t from_byte = 0;
if (argc >= 4 && be_isint(vm, 4)) {
from_byte = be_toint(vm, 4);
if (from_byte < 0) { from_byte = 0; }
if ((size_t)from_byte >= from_len_total) { from_byte = from_len_total; }
}
int32_t from_len = from_len_total - from_byte;
if (argc >= 5 && be_isint(vm, 5)) {
from_len = be_toint(vm, 5);
if (from_len < 0) { from_len = 0; }
if (from_len >= (int32_t)from_len_total) { from_len = from_len_total; }
}
if (idx + from_len >= attr.len) { from_len = attr.len - idx; }
// all parameters ok
if (from_len > 0) {
memmove(attr.bufptr + idx, buf_ptr + from_byte, from_len);
}
}
be_return_nil(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41755B", "function_addr": 4289883, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov rax, [rbp+var_58]"], [5, "mov rdi, rax"], [6, "call be_top"], [7, "mov [rbp+var_10], eax"], [8, "lea rax, [rbp+var_40]"], [9, "mov rcx, [rbp+var_58]"], [10, "mov edx, 0"], [11, "mov rsi, rcx"], [12, "mov rdi, rax"], [13, "call bytes_check_data"], [14, "lea rdx, [rbp+var_40]"], [15, "mov rax, [rbp+var_58]"], [16, "mov rsi, rdx"], [17, "mov rdi, rax"], [18, "call sub_415FEE"], [19, "cmp [rbp+var_10], 2"], [20, "jle loc_41771F"], [21, "mov rax, [rbp+var_58]"], [22, "mov esi, 2"], [23, "mov rdi, rax"], [24, "call be_isint"], [25, "test al, al"], [26, "jz loc_41771F"], [27, "mov rax, [rbp+var_58]"], [28, "mov esi, 3"], [29, "mov rdi, rax"], [30, "call be_isbytes"], [31, "test al, al"], [32, "jz loc_41771F"], [33, "mov rax, [rbp+var_58]"], [34, "mov esi, 2"], [35, "mov rdi, rax"], [36, "call be_toint"], [37, "mov [rbp+var_4], eax"], [38, "lea rdx, [rbp+var_48]"], [39, "mov rax, [rbp+var_58]"], [40, "mov esi, 3"], [41, "mov rdi, rax"], [42, "call be_tobytes"], [43, "mov [rbp+var_18], rax"], [44, "cmp [rbp+var_4], 0"], [45, "jns short loc_417617"], [46, "mov [rbp+var_4], 0"], [47, "mov eax, [rbp+var_3C]"], [48, "cmp [rbp+var_4], eax"], [49, "jl short loc_417625"], [50, "mov eax, [rbp+var_3C]"], [51, "mov [rbp+var_4], eax"], [52, "mov [rbp+var_8], 0"], [53, "cmp [rbp+var_10], 3"], [54, "jle short loc_41767E"], [55, "mov rax, [rbp+var_58]"], [56, "mov esi, 4"], [57, "mov rdi, rax"], [58, "call be_isint"], [59, "test al, al"], [60, "jz short loc_41767E"], [61, "mov rax, [rbp+var_58]"], [62, "mov esi, 4"], [63, "mov rdi, rax"], [64, "call be_toint"], [65, "mov [rbp+var_8], eax"], [66, "cmp [rbp+var_8], 0"], [67, "jns short loc_417668"], [68, "mov [rbp+var_8], 0"], [69, "mov eax, [rbp+var_8]"], [70, "movsxd rdx, eax"], [71, "mov rax, [rbp+var_48]"], [72, "cmp rdx, rax"], [73, "jb short loc_41767E"], [74, "mov rax, [rbp+var_48]"], [75, "mov [rbp+var_8], eax"], [76, "mov rax, [rbp+var_48]"], [77, "mov edx, [rbp+var_8]"], [78, "sub eax, edx"], [79, "mov [rbp+var_C], eax"], [80, "cmp [rbp+var_10], 4"], [81, "jle short loc_4176D6"], [82, "mov rax, [rbp+var_58]"], [83, "mov esi, 5"], [84, "mov rdi, rax"], [85, "call be_isint"], [86, "test al, al"], [87, "jz short loc_4176D6"], [88, "mov rax, [rbp+var_58]"], [89, "mov esi, 5"], [90, "mov rdi, rax"], [91, "call be_toint"], [92, "mov [rbp+var_C], eax"], [93, "cmp [rbp+var_C], 0"], [94, "jns short loc_4176C6"], [95, "mov [rbp+var_C], 0"], [96, "mov rax, [rbp+var_48]"], [97, "cmp [rbp+var_C], eax"], [98, "jl short loc_4176D6"], [99, "mov rax, [rbp+var_48]"], [100, "mov [rbp+var_C], eax"], [101, "mov edx, [rbp+var_4]"], [102, "mov eax, [rbp+var_C]"], [103, "add edx, eax"], [104, "mov eax, [rbp+var_3C]"], [105, "cmp edx, eax"], [106, "jl short loc_4176EE"], [107, "mov eax, [rbp+var_3C]"], [108, "sub eax, [rbp+var_4]"], [109, "mov [rbp+var_C], eax"], [110, "cmp [rbp+var_C], 0"], [111, "jle short loc_41771F"], [112, "mov eax, [rbp+var_C]"], [113, "cdqe"], [114, "mov edx, [rbp+var_8]"], [115, "movsxd rcx, edx"], [116, "mov rdx, [rbp+var_18]"], [117, "lea rsi, [rcx+rdx]"], [118, "mov rcx, [rbp+var_38]"], [119, "mov edx, [rbp+var_4]"], [120, "movsxd rdx, edx"], [121, "add rcx, rdx"], [122, "mov rdx, rax"], [123, "mov rdi, rcx"], [124, "call _memmove"], [125, "mov rax, [rbp+var_58]"], [126, "mov rdi, rax"], [127, "call be_returnnilvalue"], [128, "leave"], [129, "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, 3], [35, 33], [37, 36], [38, 14], [39, 3], [41, 39], [43, 42], [44, 37], [45, 44], [48, 47], [48, 37], [48, 46], [49, 48], [51, 50], [53, 7], [54, 53], [55, 3], [57, 55], [59, 58], [60, 59], [61, 3], [63, 61], [65, 64], [66, 65], [67, 66], [69, 65], [69, 68], [70, 69], [72, 70], [72, 71], [73, 72], [75, 74], [77, 75], [77, 68], [77, 52], [77, 65], [78, 77], [78, 76], [79, 78], [80, 7], [81, 80], [82, 3], [84, 82], [86, 85], [87, 86], [88, 3], [90, 88], [92, 91], [93, 92], [94, 93], [97, 95], [97, 92], [97, 96], [98, 97], [100, 99], [101, 51], [101, 37], [101, 46], [102, 100], [102, 79], [102, 95], [102, 92], [103, 102], [103, 101], [105, 104], [105, 103], [106, 105], [108, 107], [108, 51], [108, 37], [108, 46], [109, 108], [110, 95], [110, 79], [110, 109], [110, 92], [110, 100], [111, 110], [112, 100], [112, 79], [112, 109], [112, 95], [112, 92], [114, 65], [114, 75], [114, 68], [114, 52], [115, 114], [116, 43], [117, 83], [117, 62], [117, 89], [117, 56], [117, 40], [117, 115], [119, 51], [119, 37], [119, 46], [120, 119], [121, 118], [121, 120], [122, 112], [123, 121], [125, 3], [126, 125], [129, 127]]}
| {"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_41755B", "query": "\n\n\n__int64 __fastcall sub_41755B(__int64 a1)\n{\nunsigned __int64 v2; // [rsp+18h] [rbp-48h] BYREF\n_QWORD v3[5]; // [rsp+20h] [rbp-40h] BYREF\n__int64 v4; // [rsp+48h] [rbp-18h]\nint v5; // [rsp+50h] [rbp-10h]\nint v6; // [rsp+54h] [rbp-Ch]\nint v7; // [rsp+58h] [rbp-8h]\nint v8; // [rsp+5Ch] [rbp-4h]\n\nv5 = be_top(a1);\nbytes_check_data(v3, a1, 0);\nsub_415FEE(a1, (__int64)v3);\nif ( v5 > 2 && be_isint(a1, 2u) && (unsigned __int8)be_isbytes(a1, 3LL) )\n{\nv8 = be_toint(a1, 2u);\nv4 = be_tobytes(a1, 3LL, &v2);\nif ( v8 < 0 )\nv8 = 0;\nif ( v8 >= SHIDWORD(v3[0]) )\nv8 = HIDWORD(v3[0]);\nv7 = 0;\nif ( v5 > 3 && be_isint(a1, 4u) )\n{\nv7 = be_toint(a1, 4u);\nif ( v7 < 0 )\nv7 = 0;\nif ( v7 >= v2 )\nv7 = v2;\n}\nv6 = v2 - v7;\nif ( v5 > 4 && be_isint(a1, 5u) )\n{\nv6 = be_toint(a1, 5u);\nif ( v6 < 0 )\nv6 = 0;\nif ( v6 >= (int)v2 )\nv6 = v2;\n}\nif ( v6 + v8 >= SHIDWORD(v3[0]) )\nv6 = HIDWORD(v3[0]) - v8;\nif ( v6 > 0 )\nmemmove((void *)(v8 + v3[1]), (const void *)(v7 + v4), v6);\n}\nreturn be_returnnilvalue(a1);\n}\n\n\n\nQ:[a1,v2,v3,v4,v5,v6,v7,v8,sub_41755B,sub_415FEE,]", "hints": "[]", "response": "{'a1': 'vm', 'v2': 'from_len_total', 'v3': 'attr', 'v4': 'buf_ptr', 'v5': 'argc', 'v6': 'from_len', 'v7': 'from_byte', 'v8': 'idx', 'sub_41755B': 'm_setbytes', 'sub_415FEE': 'check_ptr'}"} | [
[
0.757036566734314,
0.739362895488739,
0.7308784127235413,
0.7296438217163086,
0.7247343063354492,
0.7146544456481934,
0.7132842540740967,
0.7110599279403687,
0.7109004259109497,
0.7094663977622986,
0.7055405974388123,
0.7032326459884644,
0.703009843826294,
0.7017119526863098,
0.7015531063079834,
0.6981207132339478,
0.6960369348526001,
0.6955850720405579,
0.6857879161834717,
0.6850185990333557
],
[
141958,
253469,
176247,
153923,
92952,
211764,
163587,
97883,
150375,
132252,
191539,
259851,
132614,
96823,
171744,
73475,
169501,
233440,
151297,
128190
]
] |
|
convert_byteorder | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | int32_t convert_byteorder(unsigned char **result, int32_t size) {
int32_t i = 0;
char *buff;
if ((buff = malloc(size)) == NULL) {
hydra_report(stderr, "[ERROR] Can't allocate memory\n");
return 1;
}
memcpy(buff, *result, size);
while (i < size) {
buff[i + 0] = (*result)[i + 3];
buff[i + 1] = (*result)[i + 2];
buff[i + 2] = (*result)[i + 1];
buff[i + 3] = (*result)[i + 0];
i += 4;
}
memcpy(*result, buff, size);
free(buff);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_436477", "function_addr": 4416631, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.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_2C], esi"], [5, "mov rax, fs:28h"], [6, "mov [rbp+var_8], rax"], [7, "xor eax, eax"], [8, "mov [rbp+var_14], 0"], [9, "mov eax, [rbp+var_2C]"], [10, "cdqe"], [11, "mov rdi, rax"], [12, "call _malloc"], [13, "mov [rbp+dest], rax"], [14, "cmp [rbp+dest], 0"], [15, "jnz short loc_4364DC"], [16, "mov rax, cs:stderr"], [17, "mov rcx, rax"], [18, "mov edx, 1Eh"], [19, "mov esi, 1"], [20, "mov edi, offset aErrorCanTAlloc"], [21, "call _fwrite"], [22, "mov eax, 1"], [23, "jmp loc_4365D3"], [24, "mov eax, [rbp+var_2C]"], [25, "movsxd rdx, eax"], [26, "mov rax, [rbp+var_28]"], [27, "mov rcx, [rax]"], [28, "mov rax, [rbp+dest]"], [29, "mov rsi, rcx"], [30, "mov rdi, rax"], [31, "call _memcpy"], [32, "jmp loc_43659A"], [33, "mov rax, [rbp+var_28]"], [34, "mov rdx, [rax]"], [35, "mov eax, [rbp+var_14]"], [36, "cdqe"], [37, "add rax, 3"], [38, "add rax, rdx"], [39, "movzx edx, byte ptr [rax]"], [40, "mov eax, [rbp+var_14]"], [41, "movsxd rcx, eax"], [42, "mov rax, [rbp+dest]"], [43, "add rax, rcx"], [44, "mov [rax], dl"], [45, "mov rax, [rbp+var_28]"], [46, "mov rdx, [rax]"], [47, "mov eax, [rbp+var_14]"], [48, "cdqe"], [49, "add rax, 2"], [50, "add rax, rdx"], [51, "movzx edx, byte ptr [rax]"], [52, "mov eax, [rbp+var_14]"], [53, "cdqe"], [54, "lea rcx, [rax+1]"], [55, "mov rax, [rbp+dest]"], [56, "add rax, rcx"], [57, "mov [rax], dl"], [58, "mov rax, [rbp+var_28]"], [59, "mov rdx, [rax]"], [60, "mov eax, [rbp+var_14]"], [61, "cdqe"], [62, "add rax, 1"], [63, "add rax, rdx"], [64, "movzx edx, byte ptr [rax]"], [65, "mov eax, [rbp+var_14]"], [66, "cdqe"], [67, "lea rcx, [rax+2]"], [68, "mov rax, [rbp+dest]"], [69, "add rax, rcx"], [70, "mov [rax], dl"], [71, "mov rax, [rbp+var_28]"], [72, "mov rdx, [rax]"], [73, "mov eax, [rbp+var_14]"], [74, "cdqe"], [75, "add rax, rdx"], [76, "movzx edx, byte ptr [rax]"], [77, "mov eax, [rbp+var_14]"], [78, "cdqe"], [79, "lea rcx, [rax+3]"], [80, "mov rax, [rbp+dest]"], [81, "add rax, rcx"], [82, "mov [rax], dl"], [83, "add [rbp+var_14], 4"], [84, "mov eax, [rbp+var_14]"], [85, "cmp eax, [rbp+var_2C]"], [86, "jl loc_4364FD"], [87, "mov eax, [rbp+var_2C]"], [88, "movsxd rdx, eax"], [89, "mov rax, [rbp+var_28]"], [90, "mov rax, [rax]"], [91, "mov rcx, [rbp+dest]"], [92, "mov rsi, rcx"], [93, "mov rdi, rax"], [94, "call _memcpy"], [95, "mov rax, [rbp+dest]"], [96, "mov rdi, rax"], [97, "call _free"], [98, "mov eax, 0"], [99, "mov rsi, [rbp+var_8]"], [100, "sub rsi, fs:28h"], [101, "jz short locret_4365E7"], [102, "call ___stack_chk_fail"], [103, "leave"], [104, "retn"]], "data_dep": [[6, 5], [9, 4], [11, 9], [13, 12], [14, 13], [15, 14], [17, 16], [24, 4], [25, 24], [26, 3], [27, 26], [28, 13], [29, 27], [30, 28], [33, 3], [34, 82], [34, 57], [34, 70], [34, 33], [34, 44], [35, 8], [35, 83], [37, 35], [38, 34], [38, 37], [39, 44], [39, 82], [39, 57], [39, 70], [39, 38], [40, 8], [40, 83], [41, 40], [42, 13], [43, 41], [43, 42], [44, 39], [44, 43], [45, 3], [46, 45], [46, 44], [47, 8], [47, 83], [49, 47], [50, 49], [50, 46], [51, 50], [51, 44], [52, 8], [52, 83], [54, 44], [54, 41], [54, 52], [55, 13], [56, 55], [56, 54], [57, 56], [57, 51], [58, 3], [59, 57], [59, 58], [60, 83], [60, 8], [62, 60], [63, 62], [63, 59], [64, 57], [64, 63], [65, 8], [65, 83], [67, 54], [67, 65], [67, 57], [68, 13], [69, 67], [69, 68], [70, 64], [70, 69], [71, 3], [72, 70], [72, 71], [73, 83], [73, 8], [75, 72], [75, 73], [76, 70], [76, 75], [77, 83], [77, 8], [79, 67], [79, 77], [79, 70], [80, 13], [81, 80], [81, 79], [82, 81], [82, 76], [83, 8], [83, 83], [84, 8], [84, 83], [85, 84], [85, 4], [86, 85], [87, 4], [88, 87], [89, 3], [90, 44], [90, 89], [90, 82], [90, 57], [90, 70], [91, 13], [92, 91], [93, 90], [95, 13], [96, 95], [99, 6], [100, 99], [101, 100], [104, 98], [104, 22]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40_a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.jsonl.gz", "strip_func_name": "sub_436477", "query": "\n\n\n__int64 __fastcall sub_436477(const void **a1, int a2)\n{\n__int64 result; // rax\nint v3; // [rsp+1Ch] [rbp-14h]\nvoid *dest; // [rsp+20h] [rbp-10h]\n\nv3 = 0;\ndest = malloc(a2);\nif ( dest )\n{\nmemcpy(dest, *a1, a2);\nwhile ( v3 < a2 )\n{\n*((_BYTE *)dest + v3) = *((_BYTE *)*a1 + v3 + 3);\n*((_BYTE *)dest + v3 + 1) = *((_BYTE *)*a1 + v3 + 2);\n*((_BYTE *)dest + v3 + 2) = *((_BYTE *)*a1 + v3 + 1);\n*((_BYTE *)dest + v3 + 3) = *((_BYTE *)*a1 + v3);\nv3 += 4;\n}\nmemcpy((void *)*a1, dest, a2);\nfree(dest);\nresult = 0LL;\n}\nelse\n{\nfwrite(\"[ERROR] Can't allocate memory\\n\", 1uLL, 0x1EuLL, stderr);\nresult = 1LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,dest,sub_436477,]", "hints": "[]", "response": "{'a1': 'result', 'a2': 'size', 'dest': 'buff', 'sub_436477': 'convert_byteorder'}"} | [
[
0.7336295247077942,
0.7330811023712158,
0.7175994515419006,
0.7122138738632202,
0.7070976495742798,
0.7069867253303528,
0.706680178642273,
0.705428421497345,
0.7022267580032349,
0.7022219300270081,
0.6992402076721191,
0.6983143091201782,
0.696731448173523,
0.6951577663421631,
0.6945115327835083,
0.6935945153236389,
0.692898154258728,
0.6927135586738586,
0.6892175078392029,
0.6890959143638611
],
[
192082,
200848,
218681,
27726,
21490,
144060,
160761,
241978,
99841,
249063,
229419,
4893,
125870,
64852,
26863,
192523,
99114,
249854,
2062,
76833
]
] |
|
findhirange | 0358ea8d0160dffe3812f472287d538c0b35fc7b562fdd63e7fa4be171e963e3 | BR903 | ELFkickers | NA | static int findhirange(struct name const *names, int count, int lo)
{
char hiname[MACRO_MAXLEN];
char *p;
int hi;
strcpy(hiname, names[lo].str);
p = strstr(hiname, "LO");
p[0] = 'H';
p[1] = 'I';
for (hi = 0 ; hi < count ; ++hi)
if (hi != lo && !strcmp(names[hi].str, hiname))
return hi - lo;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40163B", "function_addr": 4199995, "binary_name": "0358ea8d0160dffe3812f472287d538c0b35fc7b562fdd63e7fa4be171e963e3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 70h"], [3, "mov [rbp+var_68], rdi"], [4, "mov [rbp+var_6C], esi"], [5, "mov [rbp+var_70], edx"], [6, "mov eax, [rbp+var_70]"], [7, "cdqe"], [8, "shl rax, 4"], [9, "mov rdx, rax"], [10, "mov rax, [rbp+var_68]"], [11, "add rax, rdx"], [12, "mov rdx, [rax]"], [13, "lea rax, [rbp+dest]"], [14, "mov rsi, rdx"], [15, "mov rdi, rax"], [16, "call _strcpy"], [17, "lea rax, [rbp+dest]"], [18, "mov esi, offset needle"], [19, "mov rdi, rax"], [20, "call _strstr"], [21, "mov [rbp+var_10], rax"], [22, "mov rax, [rbp+var_10]"], [23, "mov byte ptr [rax], 48h "], [24, "mov rax, [rbp+var_10]"], [25, "add rax, 1"], [26, "mov byte ptr [rax], 49h "], [27, "mov [rbp+var_4], 0"], [28, "jmp short loc_4016DF"], [29, "mov eax, [rbp+var_4]"], [30, "cmp eax, [rbp+var_70]"], [31, "jz short loc_4016DB"], [32, "mov eax, [rbp+var_4]"], [33, "cdqe"], [34, "shl rax, 4"], [35, "mov rdx, rax"], [36, "mov rax, [rbp+var_68]"], [37, "add rax, rdx"], [38, "mov rax, [rax]"], [39, "lea rdx, [rbp+dest]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _strcmp"], [43, "test eax, eax"], [44, "jnz short loc_4016DB"], [45, "mov eax, [rbp+var_4]"], [46, "sub eax, [rbp+var_70]"], [47, "jmp short locret_4016EC"], [48, "add [rbp+var_4], 1"], [49, "mov eax, [rbp+var_4]"], [50, "cmp eax, [rbp+var_6C]"], [51, "jl short loc_4016A2"], [52, "mov eax, 0"], [53, "leave"], [54, "retn"]], "data_dep": [[6, 5], [8, 6], [9, 8], [10, 3], [11, 10], [11, 9], [12, 11], [13, 11], [14, 12], [15, 13], [17, 16], [19, 17], [21, 20], [22, 21], [23, 22], [24, 21], [25, 24], [26, 25], [29, 27], [29, 48], [30, 5], [30, 29], [31, 30], [32, 27], [32, 48], [34, 32], [35, 34], [36, 3], [37, 36], [37, 35], [38, 23], [38, 26], [38, 37], [39, 35], [40, 39], [41, 38], [43, 42], [44, 43], [45, 27], [45, 48], [46, 45], [46, 5], [48, 27], [48, 48], [49, 27], [49, 48], [50, 49], [50, 4], [51, 50], [54, 52], [54, 46]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0358ea8d0160dffe3812f472287d538c0b35fc7b562fdd63e7fa4be171e963e3_0358ea8d0160dffe3812f472287d538c0b35fc7b562fdd63e7fa4be171e963e3.jsonl.gz", "strip_func_name": "sub_40163B", "query": "\n\n\n__int64 __fastcall sub_40163B(__int64 a1, int a2, int a3)\n{\nchar dest[80]; // [rsp+10h] [rbp-60h] BYREF\nchar *v6; // [rsp+60h] [rbp-10h]\nint i; // [rsp+6Ch] [rbp-4h]\n\nstrcpy(dest, *(const char **)(16LL * a3 + a1));\nv6 = strstr(dest, \"LO\");\n*v6 = 72;\nv6[1] = 73;\nfor ( i = 0; i < a2; ++i )\n{\nif ( i != a3 && !strcmp(*(const char **)(16LL * i + a1), dest) )\nreturn (unsigned int)(i - a3);\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,dest,v6,i,sub_40163B,]", "hints": "[]", "response": "{'a3': 'lo', 'a1': 'names', 'a2': 'count', 'dest': 'hiname', 'v6': 'p', 'i': 'hi', 'sub_40163B': 'findhirange'}"} | [
[
0.7918486595153809,
0.7498311996459961,
0.7225985527038574,
0.7092416882514954,
0.7055022716522217,
0.7047576904296875,
0.7039170265197754,
0.6998488306999207,
0.6968735456466675,
0.696796715259552,
0.6951838731765747,
0.6861915588378906,
0.6837656497955322,
0.6820958852767944,
0.679946780204773,
0.6782193779945374,
0.6733425855636597,
0.672165036201477,
0.6700818538665771,
0.6632999181747437
],
[
205046,
21923,
203070,
86450,
199137,
108530,
203914,
234,
100555,
96796,
72096,
209234,
119038,
127755,
204214,
255864,
21972,
261339,
101739,
87121
]
] |
|
m_find | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_find(bvm *vm)
{
bbool found = bfalse;
int idx;
be_getmember(vm, 1, ".p");
list_check_data(vm, 2);
list_check_ref(vm);
be_refpush(vm, 1);
be_pushiter(vm, -1);
for (idx=0; be_iter_hasnext(vm, -2); idx++) {
be_iter_next(vm, -2);
be_pushvalue(vm, 2); /* push needle to compare */
if (be_iseq(vm)) {
found = btrue;
be_pop(vm, 2);
break;
}
be_pop(vm, 2);
}
be_pop(vm, 1); /* pop iterator */
be_refpop(vm);
if (found) {
be_pushint(vm, idx);
be_return(vm);
} else {
be_return_nil(vm);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_419B66", "function_addr": 4299622, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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_1], 0"], [5, "mov rax, [rbp+var_18]"], [6, "mov edx, offset aP_3"], [7, "mov esi, 1"], [8, "mov rdi, rax"], [9, "call be_getmember"], [10, "mov rax, [rbp+var_18]"], [11, "mov esi, 0FFFFFFFFh"], [12, "mov rdi, rax"], [13, "call be_islist"], [14, "xor eax, 1"], [15, "test al, al"], [16, "jnz short loc_419BB5"], [17, "mov rax, [rbp+var_18]"], [18, "mov rdi, rax"], [19, "call be_top"], [20, "cmp eax, 2"], [21, "jg short loc_419BC6"], [22, "mov rax, [rbp+var_18]"], [23, "mov rdi, rax"], [24, "call be_returnnilvalue"], [25, "jmp locret_419CE9"], [26, "mov rax, [rbp+var_18]"], [27, "mov esi, 1"], [28, "mov rdi, rax"], [29, "call be_refcontains"], [30, "test al, al"], [31, "jz short loc_419BFD"], [32, "mov rax, [rbp+var_18]"], [33, "mov esi, offset asc_4407C7"], [34, "mov rdi, rax"], [35, "call be_pushstring"], [36, "mov rax, [rbp+var_18]"], [37, "mov rdi, rax"], [38, "call be_returnvalue"], [39, "jmp locret_419CE9"], [40, "mov rax, [rbp+var_18]"], [41, "mov esi, 1"], [42, "mov rdi, rax"], [43, "call be_refpush"], [44, "mov rax, [rbp+var_18]"], [45, "mov esi, 0FFFFFFFFh"], [46, "mov rdi, rax"], [47, "call be_pushiter"], [48, "mov [rbp+var_8], 0"], [49, "jmp short loc_419C86"], [50, "mov rax, [rbp+var_18]"], [51, "mov esi, 0FFFFFFFEh"], [52, "mov rdi, rax"], [53, "call be_iter_next"], [54, "mov rax, [rbp+var_18]"], [55, "mov esi, 2"], [56, "mov rdi, rax"], [57, "call be_pushvalue"], [58, "mov rax, [rbp+var_18]"], [59, "mov rdi, rax"], [60, "call be_iseq"], [61, "test al, al"], [62, "jz short loc_419C71"], [63, "mov [rbp+var_1], 1"], [64, "mov rax, [rbp+var_18]"], [65, "mov esi, 2"], [66, "mov rdi, rax"], [67, "call be_pop"], [68, "jmp short loc_419C9B"], [69, "mov rax, [rbp+var_18]"], [70, "mov esi, 2"], [71, "mov rdi, rax"], [72, "call be_pop"], [73, "add [rbp+var_8], 1"], [74, "mov rax, [rbp+var_18]"], [75, "mov esi, 0FFFFFFFEh"], [76, "mov rdi, rax"], [77, "call be_iter_hasnext"], [78, "test al, al"], [79, "jnz short loc_419C28"], [80, "mov rax, [rbp+var_18]"], [81, "mov esi, 1"], [82, "mov rdi, rax"], [83, "call be_pop"], [84, "mov rax, [rbp+var_18]"], [85, "mov rdi, rax"], [86, "call be_refpop"], [87, "cmp [rbp+var_1], 0"], [88, "jz short loc_419CDD"], [89, "mov edx, [rbp+var_8]"], [90, "mov rax, [rbp+var_18]"], [91, "mov esi, edx"], [92, "mov rdi, rax"], [93, "call be_pushint"], [94, "mov rax, [rbp+var_18]"], [95, "mov rdi, rax"], [96, "call be_returnvalue"], [97, "jmp short locret_419CE9"], [98, "mov rax, [rbp+var_18]"], [99, "mov rdi, rax"], [100, "call be_returnnilvalue"], [101, "leave"], [102, "retn"]], "data_dep": [[5, 3], [8, 5], [10, 3], [12, 10], [14, 13], [15, 14], [16, 15], [17, 3], [18, 17], [20, 19], [21, 20], [22, 3], [23, 22], [26, 3], [28, 26], [30, 29], [31, 30], [32, 3], [34, 32], [36, 3], [37, 36], [40, 3], [42, 40], [44, 3], [46, 44], [50, 3], [52, 50], [54, 3], [56, 54], [58, 3], [59, 58], [61, 60], [62, 61], [64, 3], [66, 64], [69, 3], [71, 69], [73, 73], [73, 48], [74, 3], [76, 74], [78, 77], [79, 78], [80, 3], [82, 80], [84, 3], [85, 84], [87, 63], [87, 4], [88, 87], [89, 73], [89, 48], [90, 3], [91, 89], [92, 90], [94, 3], [95, 94], [98, 3], [99, 98], [102, 24], [102, 100], [102, 96], [102, 38]]}
| {"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_419B66", "query": "\n\n\n__int64 __fastcall sub_419B66(__int64 a1)\n{\nint v2; // [rsp+18h] [rbp-8h]\nchar v3; // [rsp+1Fh] [rbp-1h]\n\nv3 = 0;\nbe_getmember(a1, 1u, (__int64)\".p\");\nif ( !be_islist(a1, 0xFFFFFFFF) || (int)be_top(a1) <= 2 )\nreturn be_returnnilvalue(a1);\nif ( be_refcontains(a1, 1u) )\n{\nbe_pushstring(a1, (__int64)\"[...]\");\nreturn be_returnvalue(a1);\n}\nbe_refpush(a1, 1u);\nbe_pushiter(a1, 0xFFFFFFFF);\nv2 = 0;\nwhile ( be_iter_hasnext(a1, 0xFFFFFFFE) )\n{\nbe_iter_next(a1, 0xFFFFFFFE);\nbe_pushvalue(a1, 2u);\nif ( (unsigned __int8)be_iseq(a1) )\n{\nv3 = 1;\nbe_pop(a1, 2);\nbreak;\n}\nbe_pop(a1, 2);\n++v2;\n}\nbe_pop(a1, 1);\nbe_refpop(a1);\nif ( !v3 )\nreturn be_returnnilvalue(a1);\nbe_pushint(a1, v2);\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,v2,v3,sub_419B66,]", "hints": "[]", "response": "{'a1': 'vm', 'v2': 'idx', 'v3': 'found', 'sub_419B66': 'm_find'}"} | [
[
0.7302689552307129,
0.727678120136261,
0.7269700169563293,
0.7249242663383484,
0.7206523418426514,
0.7204344272613525,
0.7172374129295349,
0.714214563369751,
0.7041227221488953,
0.7028530836105347,
0.7023791074752808,
0.702265739440918,
0.7019261121749878,
0.6986951231956482,
0.698522686958313,
0.6954982876777649,
0.6944156885147095,
0.692029595375061,
0.6895354390144348,
0.688621997833252
],
[
146305,
73451,
112406,
246234,
236653,
207896,
22973,
95525,
64929,
134485,
149093,
14522,
156484,
143992,
199094,
80783,
229742,
151365,
8115,
190138
]
] |
|
getBssid | ae4ca2c32876c8e1872c092be1a2aebced40bb651c7c2b7d41dd8e449d171ef6 | aloksinha2001 | Linux3188 | NA | static void getBssid(char *bssid)
{
WMI_BSS_INFO_HDR2 *p = &myBssInfo[0];
char tmp[3];
if (fakeId == (MAX_WAC_BSS+1)) {
strcpy(bssid, "1c:af:f7:1b:81:82");
return;
}
sprintf(tmp, "%02x", p->bssid[0]);
strcpy(bssid, tmp);
strcat(bssid, ":");
sprintf(tmp, "%02x", p->bssid[1]);
strcat(bssid, tmp);
strcat(bssid, ":");
sprintf(tmp, "%02x", p->bssid[2]);
strcat(bssid, tmp);
strcat(bssid, ":");
sprintf(tmp, "%02x", p->bssid[3]);
strcat(bssid, tmp);
strcat(bssid, ":");
sprintf(tmp, "%02x", p->bssid[4]);
strcat(bssid, tmp);
strcat(bssid, ":");
sprintf(tmp, "%02x", p->bssid[5]);
strcat(bssid, tmp);
printf("bssid = %s\n", bssid);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401BB1", "function_addr": 4201393, "binary_name": "ae4ca2c32876c8e1872c092be1a2aebced40bb651c7c2b7d41dd8e449d171ef6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+dest], rdi"], [4, "mov [rbp+var_8], offset unk_406180"], [5, "mov eax, cs:dword_40628C"], [6, "cmp eax, 0Bh"], [7, "jnz short loc_401BFA"], [8, "mov rax, [rbp+dest]"], [9, "mov rsi, 37663A66613A6331h"], [10, "mov rdi, 383A31383A62313Ah"], [11, "mov [rax], rsi"], [12, "mov [rax+8], rdi"], [13, "mov word ptr [rax+10h], 32h "], [14, "jmp locret_401DCF"], [15, "mov rax, [rbp+var_8]"], [16, "movzx eax, byte ptr [rax+4]"], [17, "movzx edx, al"], [18, "lea rax, [rbp+s]"], [19, "mov esi, offset a02x"], [20, "mov rdi, rax"], [21, "mov eax, 0"], [22, "call _sprintf"], [23, "lea rdx, [rbp+s]"], [24, "mov rax, [rbp+dest]"], [25, "mov rsi, rdx"], [26, "mov rdi, rax"], [27, "call _strcpy"], [28, "mov rax, [rbp+dest]"], [29, "mov rdi, rax"], [30, "call _strlen"], [31, "mov rdx, rax"], [32, "mov rax, [rbp+dest]"], [33, "add rax, rdx"], [34, "mov word ptr [rax], 3Ah "], [35, "mov rax, [rbp+var_8]"], [36, "movzx eax, byte ptr [rax+5]"], [37, "movzx edx, al"], [38, "lea rax, [rbp+s]"], [39, "mov esi, offset a02x"], [40, "mov rdi, rax"], [41, "mov eax, 0"], [42, "call _sprintf"], [43, "lea rdx, [rbp+s]"], [44, "mov rax, [rbp+dest]"], [45, "mov rsi, rdx"], [46, "mov rdi, rax"], [47, "call _strcat"], [48, "mov rax, [rbp+dest]"], [49, "mov rdi, rax"], [50, "call _strlen"], [51, "mov rdx, rax"], [52, "mov rax, [rbp+dest]"], [53, "add rax, rdx"], [54, "mov word ptr [rax], 3Ah "], [55, "mov rax, [rbp+var_8]"], [56, "movzx eax, byte ptr [rax+6]"], [57, "movzx edx, al"], [58, "lea rax, [rbp+s]"], [59, "mov esi, offset a02x"], [60, "mov rdi, rax"], [61, "mov eax, 0"], [62, "call _sprintf"], [63, "lea rdx, [rbp+s]"], [64, "mov rax, [rbp+dest]"], [65, "mov rsi, rdx"], [66, "mov rdi, rax"], [67, "call _strcat"], [68, "mov rax, [rbp+dest]"], [69, "mov rdi, rax"], [70, "call _strlen"], [71, "mov rdx, rax"], [72, "mov rax, [rbp+dest]"], [73, "add rax, rdx"], [74, "mov word ptr [rax], 3Ah "], [75, "mov rax, [rbp+var_8]"], [76, "movzx eax, byte ptr [rax+7]"], [77, "movzx edx, al"], [78, "lea rax, [rbp+s]"], [79, "mov esi, offset a02x"], [80, "mov rdi, rax"], [81, "mov eax, 0"], [82, "call _sprintf"], [83, "lea rdx, [rbp+s]"], [84, "mov rax, [rbp+dest]"], [85, "mov rsi, rdx"], [86, "mov rdi, rax"], [87, "call _strcat"], [88, "mov rax, [rbp+dest]"], [89, "mov rdi, rax"], [90, "call _strlen"], [91, "mov rdx, rax"], [92, "mov rax, [rbp+dest]"], [93, "add rax, rdx"], [94, "mov word ptr [rax], 3Ah "], [95, "mov rax, [rbp+var_8]"], [96, "movzx eax, byte ptr [rax+8]"], [97, "movzx edx, al"], [98, "lea rax, [rbp+s]"], [99, "mov esi, offset a02x"], [100, "mov rdi, rax"], [101, "mov eax, 0"], [102, "call _sprintf"], [103, "lea rdx, [rbp+s]"], [104, "mov rax, [rbp+dest]"], [105, "mov rsi, rdx"], [106, "mov rdi, rax"], [107, "call _strcat"], [108, "mov rax, [rbp+dest]"], [109, "mov rdi, rax"], [110, "call _strlen"], [111, "mov rdx, rax"], [112, "mov rax, [rbp+dest]"], [113, "add rax, rdx"], [114, "mov word ptr [rax], 3Ah "], [115, "mov rax, [rbp+var_8]"], [116, "movzx eax, byte ptr [rax+9]"], [117, "movzx edx, al"], [118, "lea rax, [rbp+s]"], [119, "mov esi, offset a02x"], [120, "mov rdi, rax"], [121, "mov eax, 0"], [122, "call _sprintf"], [123, "lea rdx, [rbp+s]"], [124, "mov rax, [rbp+dest]"], [125, "mov rsi, rdx"], [126, "mov rdi, rax"], [127, "call _strcat"], [128, "mov rax, [rbp+dest]"], [129, "mov rsi, rax"], [130, "mov edi, offset aBssidS"], [131, "mov eax, 0"], [132, "call _printf"], [133, "leave"], [134, "retn"]], "data_dep": [[6, 5], [7, 6], [8, 3], [11, 9], [11, 8], [12, 8], [12, 10], [13, 8], [15, 4], [16, 15], [17, 16], [18, 16], [20, 18], [23, 17], [24, 3], [25, 23], [26, 24], [28, 3], [29, 28], [31, 30], [32, 3], [33, 31], [33, 32], [34, 33], [35, 4], [36, 34], [36, 35], [37, 36], [38, 36], [40, 38], [43, 37], [44, 3], [45, 43], [46, 44], [48, 3], [49, 48], [51, 50], [52, 3], [53, 52], [53, 51], [54, 53], [55, 4], [56, 55], [56, 54], [57, 56], [58, 56], [60, 58], [63, 57], [64, 3], [65, 63], [66, 64], [68, 3], [69, 68], [71, 70], [72, 3], [73, 71], [73, 72], [74, 73], [75, 4], [76, 74], [76, 75], [77, 76], [78, 76], [80, 78], [83, 77], [84, 3], [85, 83], [86, 84], [88, 3], [89, 88], [91, 90], [92, 3], [93, 92], [93, 91], [94, 93], [95, 4], [96, 95], [96, 94], [97, 96], [98, 96], [100, 98], [103, 97], [104, 3], [105, 103], [106, 104], [108, 3], [109, 108], [111, 110], [112, 3], [113, 112], [113, 111], [114, 113], [115, 4], [116, 115], [116, 114], [117, 116], [118, 116], [120, 118], [123, 117], [124, 3], [125, 123], [126, 124], [128, 3], [129, 128], [134, 132], [134, 8]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ae4ca2c32876c8e1872c092be1a2aebced40bb651c7c2b7d41dd8e449d171ef6_ae4ca2c32876c8e1872c092be1a2aebced40bb651c7c2b7d41dd8e449d171ef6.jsonl.gz", "strip_func_name": "sub_401BB1", "query": "\n\n\nint __fastcall sub_401BB1(char *a1)\n{\nint result; // eax\nchar s[3]; // [rsp+15h] [rbp-Bh] BYREF\nunsigned __int8 *v3; // [rsp+18h] [rbp-8h]\n\nv3 = (unsigned __int8 *)&unk_406180;\nif ( dword_40628C == 11 )\n{\nresult = (int)a1;\nstrcpy(a1, \"1c:af:f7:1b:81:82\");\n}\nelse\n{\nsprintf(s, \"%02x\", v3[4]);\nstrcpy(a1, s);\n*(_WORD *)&a1[strlen(a1)] = 58;\nsprintf(s, \"%02x\", v3[5]);\nstrcat(a1, s);\n*(_WORD *)&a1[strlen(a1)] = 58;\nsprintf(s, \"%02x\", v3[6]);\nstrcat(a1, s);\n*(_WORD *)&a1[strlen(a1)] = 58;\nsprintf(s, \"%02x\", v3[7]);\nstrcat(a1, s);\n*(_WORD *)&a1[strlen(a1)] = 58;\nsprintf(s, \"%02x\", v3[8]);\nstrcat(a1, s);\n*(_WORD *)&a1[strlen(a1)] = 58;\nsprintf(s, \"%02x\", v3[9]);\nstrcat(a1, s);\nresult = printf(\"bssid = %s\\n\", a1);\n}\nreturn result;\n}\n\n\n\nQ:[a1,s,v3,sub_401BB1,]", "hints": "[]", "response": "{'a1': 'bssid', 's': 'tmp', 'v3': 'p', 'sub_401BB1': 'getBssid'}"} | [
[
0.8092510104179382,
0.7924137115478516,
0.7860177755355835,
0.7755002379417419,
0.7729282379150391,
0.7593183517456055,
0.7463161945343018,
0.7313244938850403,
0.7279062271118164,
0.7239585518836975,
0.7220777273178101,
0.7198760509490967,
0.7197536826133728,
0.7192566394805908,
0.7150285243988037,
0.7139981985092163,
0.7133217453956604,
0.708791971206665,
0.7047708630561829,
0.7019122838973999
],
[
218641,
231209,
253650,
231849,
15329,
83410,
73543,
133349,
107121,
113869,
95833,
40288,
57713,
118856,
142195,
123133,
237795,
140740,
227884,
223492
]
] |
|
printProgress | bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2 | embotech | ecos | NA | void printProgress(stats* info)
{
if( info->iter == 0 )
{
/* print header at very first iteration */
#if PRINTLEVEL == 2
PRINTTEXT("\nECOS %s - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS\n", ECOS_VERSION);
#if PRINTLEVEL > 2
PRINTTEXT("Contributors: Core interior point solver: A. Domahidi, embotech GmbH\n");
PRINTTEXT(" Python interface and equilibration: Eric Chu, Stanford University\n");
PRINTTEXT(" Branch-and-bound module: Han Wang, Stanford University\n");
PRINTTEXT(" Maths and Methods: Stephen Boyd, Stanford University\n");
#ifdef EXPCONE
PRINTTEXT(" Exponential cone support: Santiago Akle, Stanford University\n");
#endif
#endif
PRINTTEXT("\n");
#endif
#if defined _WIN32 || defined _WIN64
#if defined EXPCONE
PRINTTEXT("It pcost dcost gap pres dres k/t mu step sigma IR | BT\n");
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e --- --- %2d %2d - | - - \n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, (int)info->nitref1, (int)info->nitref2);
#else
PRINTTEXT("It pcost dcost gap pres dres k/t mu step sigma IR\n");
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e --- --- %2d %2d -\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, (int)info->nitref1, (int)info->nitref2);
#endif //if defined expcone
#else
#if defined EXPCONE
PRINTTEXT("It pcost dcost gap pres dres k/t mu step sigma IR | BT\n");
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e --- --- %2d %2d - | - - \n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, (int)info->nitref1, (int)info->nitref2);
#else
PRINTTEXT("It pcost dcost gap pres dres k/t mu step sigma IR\n");
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e --- --- %2d %2d -\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, (int)info->nitref1, (int)info->nitref2);
#endif /*End if defined EXPCONE for the branch of the first iteration non windows */
#endif
} else {
#if defined _WIN32 || defined _WIN64
#if defined EXPCONE
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e %6.4f %2.0e %2d %2d %2d | %2d %2d\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, info->step, info->sigma,\
(int)info->nitref1,\
(int)info->nitref2,\
(int)info->nitref3,\
(int)info->affBack,\
(int)info->cmbBack);
#else
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e %6.4f %2.0e %2d %2d %2d\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, info->step, info->sigma,\
(int)info->nitref1,\
(int)info->nitref2,\
(int)info->nitref3);
#endif //End of if defined EXPCONE
#else
#if defined EXPCONE
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e %6.4f %2.0e %2d %2d %2d | %2d %2d\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, info->step, info->sigma,\
(int)info->nitref1,\
(int)info->nitref2,\
(int)info->nitref3,\
(int)info->affBack,\
(int)info->cmbBack);
#else
PRINTTEXT("%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e %6.4f %2.0e %2d %2d %2d\n",(int)info->iter, info->pcost, info->dcost, info->gap, info->pres, info->dres, info->kapovert, info->mu, info->step, info->sigma,\
(int)info->nitref1,\
(int)info->nitref2,\
(int)info->nitref3);
#endif /* End of if defined expcone */
#endif /* end of windows block */
}
/* enable to flush printf in Matlab immediately */
#ifdef MATLAB_MEX_FILE
#if defined MATLAB_FLUSH_PRINTS
mexEvalString("pause(0.0001);");
#endif
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4037D4", "function_addr": 4208596, "binary_name": "bfa1835a8cfa41c6110f4663d2d821bce11bf6fbfb1ac54ccfda804c176264e2.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 rax, [rax+78h]"], [6, "test rax, rax"], [7, "jnz loc_4038B5"], [8, "lea rsi, a207"], [9, "lea rdi, aEcosSCEmbotech"], [10, "mov eax, 0"], [11, "call _printf"], [12, "mov edi, 0Ah"], [13, "call _putchar"], [14, "lea rdi, s"], [15, "call _puts"], [16, "mov rax, [rbp+var_8]"], [17, "mov rax, [rax+88h]"], [18, "mov ecx, eax"], [19, "mov rax, [rbp+var_8]"], [20, "mov rax, [rax+80h]"], [21, "mov edi, eax"], [22, "mov rax, [rbp+var_8]"], [23, "movsd xmm5, qword ptr [rax+58h]"], [24, "mov rax, [rbp+var_8]"], [25, "movsd xmm4, qword ptr [rax+70h]"], [26, "mov rax, [rbp+var_8]"], [27, "movsd xmm3, qword ptr [rax+18h]"], [28, "mov rax, [rbp+var_8]"], [29, "movsd xmm2, qword ptr [rax+10h]"], [30, "mov rax, [rbp+var_8]"], [31, "movsd xmm1, qword ptr [rax+40h]"], [32, "mov rax, [rbp+var_8]"], [33, "movsd xmm0, qword ptr [rax+8]"], [34, "mov rax, [rbp+var_8]"], [35, "mov rax, [rax]"], [36, "mov rdx, [rbp+var_8]"], [37, "mov rdx, [rdx+78h]"], [38, "mov esi, edx"], [39, "mov edx, edi"], [40, "movapd xmm6, xmm5"], [41, "movapd xmm5, xmm4"], [42, "movapd xmm4, xmm3"], [43, "movapd xmm3, xmm2"], [44, "movapd xmm2, xmm1"], [45, "movapd xmm1, xmm0"], [46, "movq xmm0, rax"], [47, "lea rdi, a2d53e53e20e20e"], [48, "mov eax, 7"], [49, "call _printf"], [50, "jmp loc_40397D"], [51, "mov rax, [rbp+var_8]"], [52, "mov rax, [rax+0D8h]"], [53, "mov r8d, eax"], [54, "mov rax, [rbp+var_8]"], [55, "mov rax, [rax+0D0h]"], [56, "mov r9d, eax"], [57, "mov rax, [rbp+var_8]"], [58, "mov rax, [rax+90h]"], [59, "mov r10d, eax"], [60, "mov rax, [rbp+var_8]"], [61, "mov rax, [rax+88h]"], [62, "mov ecx, eax"], [63, "mov rax, [rbp+var_8]"], [64, "mov rax, [rax+80h]"], [65, "mov edi, eax"], [66, "mov rax, [rbp+var_8]"], [67, "movsd xmm0, qword ptr [rax+50h]"], [68, "mov rax, [rbp+var_8]"], [69, "movsd xmm7, qword ptr [rax+60h]"], [70, "mov rax, [rbp+var_8]"], [71, "movsd xmm6, qword ptr [rax+58h]"], [72, "mov rax, [rbp+var_8]"], [73, "movsd xmm5, qword ptr [rax+70h]"], [74, "mov rax, [rbp+var_8]"], [75, "movsd xmm4, qword ptr [rax+18h]"], [76, "mov rax, [rbp+var_8]"], [77, "movsd xmm3, qword ptr [rax+10h]"], [78, "mov rax, [rbp+var_8]"], [79, "movsd xmm2, qword ptr [rax+40h]"], [80, "mov rax, [rbp+var_8]"], [81, "movsd xmm1, qword ptr [rax+8]"], [82, "mov rax, [rbp+var_8]"], [83, "mov rax, [rax]"], [84, "mov rdx, [rbp+var_8]"], [85, "mov rdx, [rdx+78h]"], [86, "mov esi, edx"], [87, "push r8"], [88, "lea rsp, [rsp-8]"], [89, "movsd [rsp+20h+var_20], xmm0"], [90, "mov r8d, r10d"], [91, "mov edx, edi"], [92, "movq xmm0, rax"], [93, "lea rdi, a2d53e53e20e20e_0"], [94, "mov eax, 8"], [95, "call _printf"], [96, "add rsp, 10h"], [97, "nop"], [98, "leave"], [99, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [14, 12], [16, 3], [17, 16], [18, 17], [19, 3], [20, 19], [21, 20], [22, 3], [23, 22], [24, 3], [25, 24], [26, 3], [27, 26], [28, 3], [29, 28], [30, 3], [31, 30], [32, 3], [33, 32], [34, 3], [35, 34], [36, 3], [37, 36], [38, 37], [39, 21], [40, 23], [41, 25], [42, 27], [43, 29], [44, 31], [45, 33], [46, 35], [47, 21], [51, 3], [52, 51], [53, 52], [54, 3], [55, 54], [56, 55], [57, 3], [58, 57], [59, 58], [60, 3], [61, 60], [62, 61], [63, 3], [64, 63], [65, 64], [66, 3], [67, 66], [68, 3], [69, 68], [70, 3], [71, 70], [72, 3], [73, 72], [74, 3], [75, 74], [76, 3], [77, 76], [78, 3], [79, 78], [80, 3], [81, 80], [82, 3], [83, 82], [84, 3], [85, 84], [86, 85], [87, 53], [88, 2], [89, 67], [90, 59], [91, 65], [92, 83], [93, 65], [96, 88], [99, 95], [99, 49]]}
| {"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_4037D4", "query": "\n\n\nint __fastcall sub_4037D4(__int64 a1)\n{\nif ( *(_QWORD *)(a1 + 120) )\nreturn printf(\n\"%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e %6.4f %2.0e %2d %2d %2d | %2d %2d\\n\",\n(unsigned int)*(_QWORD *)(a1 + 120),\n*(double *)a1,\n*(double *)(a1 + 8),\n*(double *)(a1 + 64),\n*(double *)(a1 + 16),\n*(double *)(a1 + 24),\n*(double *)(a1 + 112),\n*(double *)(a1 + 88),\n*(double *)(a1 + 96),\n*(double *)(a1 + 80),\n(unsigned int)*(_QWORD *)(a1 + 128),\n(unsigned int)*(_QWORD *)(a1 + 136),\n(unsigned int)*(_QWORD *)(a1 + 144),\n(unsigned int)*(_QWORD *)(a1 + 208),\n(unsigned int)*(_QWORD *)(a1 + 216));\nprintf(\"\\nECOS %s - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS\\n\", \"2.0.7\");\nputchar(10);\nputs(\"It pcost dcost gap pres dres k/t mu step sigma IR | BT\");\nreturn printf(\n\"%2d %+5.3e %+5.3e %+2.0e %2.0e %2.0e %2.0e %2.0e --- --- %2d %2d - | - - \\n\",\n(unsigned int)*(_QWORD *)(a1 + 120),\n*(double *)a1,\n*(double *)(a1 + 8),\n*(double *)(a1 + 64),\n*(double *)(a1 + 16),\n*(double *)(a1 + 24),\n*(double *)(a1 + 112),\n*(double *)(a1 + 88),\n(unsigned int)*(_QWORD *)(a1 + 128),\n(unsigned int)*(_QWORD *)(a1 + 136));\n}\n\n\n\nQ:[a1,sub_4037D4,]", "hints": "[]", "response": "{'a1': 'info', 'sub_4037D4': 'printProgress'}"} | [
[
0.831601619720459,
0.8253569006919861,
0.8200650215148926,
0.8152042627334595,
0.8143551349639893,
0.7990431189537048,
0.7973299026489258,
0.7956079840660095,
0.7935918569564819,
0.784713864326477,
0.7838279008865356,
0.778457760810852,
0.7746108770370483,
0.7702026963233948,
0.7687413096427917,
0.7649376392364502,
0.7631688714027405,
0.7571172714233398,
0.7544407844543457,
0.7533646821975708
],
[
58163,
213746,
11836,
28200,
213588,
213060,
144827,
241117,
175914,
177743,
264007,
137179,
35433,
138718,
220662,
223728,
140829,
120834,
100343,
25668
]
] |
|
btbind | 3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa | xenogenesi | hidclient | NA | int btbind ( int sockfd, unsigned short port ) {
struct sockaddr_l2 l2a;
int i;
memset ( &l2a, 0, sizeof(l2a) );
l2a.l2_family = AF_BLUETOOTH;
bacpy ( &l2a.l2_bdaddr, BDADDR_ANY );
l2a.l2_psm = htobs ( port );
i = bind ( sockfd, (struct sockaddr *)&l2a, sizeof(l2a) );
if ( 0 > i )
{
fprintf ( stderr, "Bind error (PSM %d): %s\n",
port, strerror ( errno ) );
}
return i;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402ECE", "function_addr": 4206286, "binary_name": "3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+fd], edi"], [4, "mov eax, esi"], [5, "mov [rbp+var_28], ax"], [6, "lea rax, [rbp+s]"], [7, "mov edx, 0Eh"], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "call _memset"], [11, "mov [rbp+s], 1Fh"], [12, "mov [rbp+var_18], 0"], [13, "mov [rbp+var_17], 0"], [14, "mov [rbp+var_16], 0"], [15, "mov [rbp+var_15], 0"], [16, "mov [rbp+var_14], 0"], [17, "mov [rbp+var_13], 0"], [18, "lea rax, [rbp+var_18]"], [19, "lea rdx, [rbp+s]"], [20, "add rdx, 4"], [21, "mov rsi, rax"], [22, "mov rdi, rdx"], [23, "call sub_4024A2"], [24, "movzx eax, [rbp+var_28]"], [25, "mov [rbp+var_10], ax"], [26, "lea rcx, [rbp+s]"], [27, "mov eax, [rbp+fd]"], [28, "mov edx, 0Eh"], [29, "mov rsi, rcx"], [30, "mov edi, eax"], [31, "call _bind"], [32, "mov [rbp+var_4], eax"], [33, "cmp [rbp+var_4], 0"], [34, "jns short loc_402F7F"], [35, "call ___errno_location"], [36, "mov eax, [rax]"], [37, "mov edi, eax"], [38, "call _strerror"], [39, "mov rcx, rax"], [40, "movzx edx, [rbp+var_28]"], [41, "mov rax, cs:stderr"], [42, "mov esi, offset aBindErrorPsmDS"], [43, "mov rdi, rax"], [44, "mov eax, 0"], [45, "call _fprintf"], [46, "mov eax, [rbp+var_4]"], [47, "leave"], [48, "retn"]], "data_dep": [[5, 4], [6, 4], [9, 6], [18, 10], [18, 12], [19, 11], [19, 7], [20, 19], [21, 18], [22, 20], [24, 5], [25, 24], [26, 11], [27, 3], [29, 26], [30, 27], [32, 31], [33, 32], [34, 33], [36, 35], [37, 36], [39, 38], [40, 5], [43, 41], [46, 32], [48, 46]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa_3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.jsonl.gz", "strip_func_name": "sub_402ECE", "query": "\n\n\n__int64 __fastcall sub_402ECE(int a1, unsigned __int16 a2)\n{\nint *v2; // rax\nchar *v3; // rax\nchar v5[6]; // [rsp+18h] [rbp-18h] BYREF\n__int16 s[2]; // [rsp+1Eh] [rbp-12h] BYREF\n_BYTE v7[6]; // [rsp+22h] [rbp-Eh] BYREF\nint v8; // [rsp+2Ch] [rbp-4h]\n\nmemset(s, 0, 0xEuLL);\ns[0] = 31;\nv5[0] = 0;\nv5[1] = 0;\nv5[2] = 0;\nv5[3] = 0;\nv5[4] = 0;\nv5[5] = 0;\nsub_4024A2(v7, v5);\ns[1] = a2;\nv8 = bind(a1, (const struct sockaddr *)s, 0xEu);\nif ( v8 < 0 )\n{\nv2 = __errno_location();\nv3 = strerror(*v2);\nfprintf(stderr, \"Bind error (PSM %d): %s\\n\", a2, v3);\n}\nreturn (unsigned int)v8;\n}\n\n\n\nQ:[a1,a2,v5,s,sub_402ECE,sub_4024A2,]", "hints": "[]", "response": "{'a1': 'sockfd', 'a2': 'port', 'v5': 'src', 's': 'l2a', 'sub_402ECE': 'btbind', 'sub_4024A2': 'bacpy'}"} | [
[
0.8059994578361511,
0.7702621221542358,
0.7580851912498474,
0.7538850903511047,
0.7535930871963501,
0.7534601092338562,
0.7376583814620972,
0.7376183271408081,
0.736972987651825,
0.735142707824707,
0.7254855036735535,
0.7231606245040894,
0.7191368341445923,
0.717782199382782,
0.7157370448112488,
0.7147713899612427,
0.7146701812744141,
0.7123793363571167,
0.7119500637054443,
0.7110598683357239
],
[
245532,
175047,
208802,
204801,
79004,
243244,
160067,
248907,
215647,
258337,
117134,
211604,
66469,
97846,
132419,
26740,
233662,
97471,
87403,
109135
]
] |
|
packlineRLE | 434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff | jfdelnero | HXCFE_file_selector | NA | int packlineRLE(unsigned char * src,int size,unsigned char * dst)
{
int cnt,i,j,lastvalue;
i = 0;
j = 0;
lastvalue = src[0];
cnt = 0;
while(i < size)
{
if( (src[i] == lastvalue) && (cnt<254))
{
cnt++;
}
else
{
dst[j++] = cnt;
dst[j++] = lastvalue;
lastvalue = src[i];
cnt = 1;
}
i++;
}
if(cnt)
{
dst[j++] = cnt;
dst[j++] = lastvalue;
}
dst[j++] = 0;
dst[j++] = 0;
return j;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4021DB", "function_addr": 4202971, "binary_name": "434ed2fa9a4f7fc3bac15ce222f011d74c30c4bca74d2ee23f9e17163c1019ff.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 [rbp+var_8], 0"], [6, "mov [rbp+var_C], 0"], [7, "mov rax, [rbp+var_18]"], [8, "movzx eax, byte ptr [rax]"], [9, "movzx eax, al"], [10, "mov [rbp+var_10], eax"], [11, "mov [rbp+var_4], 0"], [12, "jmp short loc_402286"], [13, "mov eax, [rbp+var_8]"], [14, "movsxd rdx, eax"], [15, "mov rax, [rbp+var_18]"], [16, "add rax, rdx"], [17, "movzx eax, byte ptr [rax]"], [18, "movzx eax, al"], [19, "cmp [rbp+var_10], eax"], [20, "jnz short loc_402235"], [21, "cmp [rbp+var_4], 0FDh"], [22, "jg short loc_402235"], [23, "add [rbp+var_4], 1"], [24, "jmp short loc_402282"], [25, "mov eax, [rbp+var_C]"], [26, "lea edx, [rax+1]"], [27, "mov [rbp+var_C], edx"], [28, "movsxd rdx, eax"], [29, "mov rax, [rbp+var_28]"], [30, "add rax, rdx"], [31, "mov edx, [rbp+var_4]"], [32, "mov [rax], dl"], [33, "mov eax, [rbp+var_C]"], [34, "lea edx, [rax+1]"], [35, "mov [rbp+var_C], edx"], [36, "movsxd rdx, eax"], [37, "mov rax, [rbp+var_28]"], [38, "add rax, rdx"], [39, "mov edx, [rbp+var_10]"], [40, "mov [rax], dl"], [41, "mov eax, [rbp+var_8]"], [42, "movsxd rdx, eax"], [43, "mov rax, [rbp+var_18]"], [44, "add rax, rdx"], [45, "movzx eax, byte ptr [rax]"], [46, "movzx eax, al"], [47, "mov [rbp+var_10], eax"], [48, "mov [rbp+var_4], 1"], [49, "add [rbp+var_8], 1"], [50, "mov eax, [rbp+var_8]"], [51, "cmp eax, [rbp+var_1C]"], [52, "jl short loc_40220E"], [53, "cmp [rbp+var_4], 0"], [54, "jz short loc_4022C4"], [55, "mov eax, [rbp+var_C]"], [56, "lea edx, [rax+1]"], [57, "mov [rbp+var_C], edx"], [58, "movsxd rdx, eax"], [59, "mov rax, [rbp+var_28]"], [60, "add rax, rdx"], [61, "mov edx, [rbp+var_4]"], [62, "mov [rax], dl"], [63, "mov eax, [rbp+var_C]"], [64, "lea edx, [rax+1]"], [65, "mov [rbp+var_C], edx"], [66, "movsxd rdx, eax"], [67, "mov rax, [rbp+var_28]"], [68, "add rax, rdx"], [69, "mov edx, [rbp+var_10]"], [70, "mov [rax], dl"], [71, "mov eax, [rbp+var_C]"], [72, "lea edx, [rax+1]"], [73, "mov [rbp+var_C], edx"], [74, "movsxd rdx, eax"], [75, "mov rax, [rbp+var_28]"], [76, "add rax, rdx"], [77, "mov byte ptr [rax], 0"], [78, "mov eax, [rbp+var_C]"], [79, "lea edx, [rax+1]"], [80, "mov [rbp+var_C], edx"], [81, "movsxd rdx, eax"], [82, "mov rax, [rbp+var_28]"], [83, "add rax, rdx"], [84, "mov byte ptr [rax], 0"], [85, "mov eax, [rbp+var_C]"], [86, "pop rbp"], [87, "retn"]], "data_dep": [[7, 2], [8, 7], [9, 8], [10, 9], [13, 5], [13, 49], [14, 13], [15, 2], [16, 15], [16, 14], [17, 16], [17, 32], [17, 40], [18, 17], [19, 18], [19, 47], [19, 10], [20, 19], [21, 48], [21, 11], [21, 23], [22, 21], [23, 23], [23, 48], [23, 11], [25, 6], [25, 35], [26, 14], [26, 32], [26, 25], [26, 40], [27, 26], [28, 25], [29, 4], [30, 29], [30, 28], [31, 23], [31, 48], [31, 11], [32, 30], [32, 31], [33, 27], [34, 32], [34, 31], [34, 33], [35, 34], [36, 33], [37, 4], [38, 36], [38, 37], [39, 10], [39, 47], [40, 38], [40, 39], [41, 49], [41, 5], [42, 41], [43, 2], [44, 42], [44, 43], [45, 40], [45, 44], [46, 45], [47, 46], [49, 49], [49, 5], [50, 49], [50, 5], [51, 50], [51, 3], [52, 51], [53, 23], [53, 48], [53, 11], [54, 53], [55, 6], [55, 35], [56, 14], [56, 32], [56, 62], [56, 55], [56, 70], [56, 40], [56, 42], [57, 56], [58, 55], [59, 4], [60, 59], [60, 58], [61, 23], [61, 48], [61, 11], [62, 60], [62, 61], [63, 57], [64, 62], [64, 61], [64, 63], [65, 64], [66, 63], [67, 4], [68, 66], [68, 67], [69, 10], [69, 47], [70, 68], [70, 69], [71, 35], [71, 65], [71, 6], [72, 84], [72, 77], [72, 70], [72, 40], [72, 42], [72, 62], [72, 69], [72, 14], [72, 32], [72, 71], [73, 72], [74, 71], [75, 4], [76, 74], [76, 75], [77, 76], [78, 73], [79, 74], [79, 78], [79, 77], [80, 79], [81, 78], [82, 4], [83, 82], [83, 81], [84, 83], [85, 80], [86, 0], [87, 85]]}
| {"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_4021DB", "query": "\n\n\n__int64 __fastcall sub_4021DB(unsigned __int8 *a1, int a2, __int64 a3)\n{\nint v3; // eax\nint v4; // eax\nint v6; // [rsp+18h] [rbp-10h]\nint v7; // [rsp+1Ch] [rbp-Ch]\nint v8; // [rsp+20h] [rbp-8h]\nint v9; // [rsp+24h] [rbp-4h]\n\nv8 = 0;\nv7 = 0;\nv6 = *a1;\nv9 = 0;\nwhile ( v8 < a2 )\n{\nif ( v6 == a1[v8] && v9 <= 253 )\n{\n++v9;\n}\nelse\n{\n*(_BYTE *)(v7 + a3) = v9;\nv3 = v7 + 1;\nv7 += 2;\n*(_BYTE *)(v3 + a3) = v6;\nv6 = a1[v8];\nv9 = 1;\n}\n++v8;\n}\nif ( v9 )\n{\n*(_BYTE *)(v7 + a3) = v9;\nv4 = v7 + 1;\nv7 += 2;\n*(_BYTE *)(v4 + a3) = v6;\n}\n*(_BYTE *)(v7 + a3) = 0;\n*(_BYTE *)(v7 + 1 + a3) = 0;\nreturn (unsigned int)(v7 + 2);\n}\n\n\n\nQ:[a3,a1,a2,v6,v9,sub_4021DB,]", "hints": "[]", "response": "{'a3': 'dst', 'a1': 'src', 'a2': 'size', 'v6': 'lastvalue', 'v9': 'cnt', 'sub_4021DB': 'packlineRLE'}"} | [
[
0.8092707395553589,
0.8082799911499023,
0.79718017578125,
0.7925410866737366,
0.7915271520614624,
0.7882671356201172,
0.7673100829124451,
0.7636834979057312,
0.7509744167327881,
0.7503894567489624,
0.7501198053359985,
0.745749831199646,
0.7401750683784485,
0.7385635375976562,
0.7382097840309143,
0.7380346655845642,
0.7356846332550049,
0.7287499904632568,
0.721848726272583,
0.7217626571655273
],
[
156244,
27203,
17919,
247954,
205114,
135023,
201137,
198777,
223695,
85159,
245820,
13369,
233874,
234900,
21454,
155110,
57854,
196971,
184621,
262665
]
] |
|
do_int64_mod | 516ce2a9db5c061aae5f401c446903d6244864e373920aa79c419472cdcea5c4 | foss-for-synopsys-dwc-arc-processors | lmbench | NA | void
do_int64_mod(iter_t iterations, void* cookie)
{
struct _state *pState = (struct _state*)cookie;
register int64 r = iterations + ((int64)iterations << 32);
register int64 s = (int64)pState->N + ((int64)pState->N << 56);
while (iterations-- > 0) {
HUNDRED(r %= s; r |= s;);
}
use_int((int)r);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4030ED", "function_addr": 4206829, "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, "mov rax, [rbp+var_28]"], [10, "shl rax, 20h"], [11, "mov rdx, rax"], [12, "mov rax, [rbp+var_28]"], [13, "add rax, rdx"], [14, "mov rbx, rax"], [15, "mov rax, [rbp+var_18]"], [16, "mov eax, [rax]"], [17, "movsxd rdx, eax"], [18, "mov rax, [rbp+var_18]"], [19, "mov eax, [rax]"], [20, "cdqe"], [21, "shl rax, 38h"], [22, "lea r12, [rdx+rax]"], [23, "jmp loc_4036B3"], [24, "mov rax, rbx"], [25, "cqo"], [26, "idiv r12"], [27, "mov rbx, rdx"], [28, "or rbx, r12"], [29, "mov rax, rbx"], [30, "cqo"], [31, "idiv r12"], [32, "mov rbx, rdx"], [33, "or rbx, r12"], [34, "mov rax, rbx"], [35, "cqo"], [36, "idiv r12"], [37, "mov rbx, rdx"], [38, "or rbx, r12"], [39, "mov rax, rbx"], [40, "cqo"], [41, "idiv r12"], [42, "mov rbx, rdx"], [43, "or rbx, r12"], [44, "mov rax, rbx"], [45, "cqo"], [46, "idiv r12"], [47, "mov rbx, rdx"], [48, "or rbx, r12"], [49, "mov rax, rbx"], [50, "cqo"], [51, "idiv r12"], [52, "mov rbx, rdx"], [53, "or rbx, r12"], [54, "mov rax, rbx"], [55, "cqo"], [56, "idiv r12"], [57, "mov rbx, rdx"], [58, "or rbx, r12"], [59, "mov rax, rbx"], [60, "cqo"], [61, "idiv r12"], [62, "mov rbx, rdx"], [63, "or rbx, r12"], [64, "mov rax, rbx"], [65, "cqo"], [66, "idiv r12"], [67, "mov rbx, rdx"], [68, "or rbx, r12"], [69, "mov rax, rbx"], [70, "cqo"], [71, "idiv r12"], [72, "mov rbx, rdx"], [73, "or rbx, r12"], [74, "mov rax, rbx"], [75, "cqo"], [76, "idiv r12"], [77, "mov rbx, rdx"], [78, "or rbx, r12"], [79, "mov rax, rbx"], [80, "cqo"], [81, "idiv r12"], [82, "mov rbx, rdx"], [83, "or rbx, r12"], [84, "mov rax, rbx"], [85, "cqo"], [86, "idiv r12"], [87, "mov rbx, rdx"], [88, "or rbx, r12"], [89, "mov rax, rbx"], [90, "cqo"], [91, "idiv r12"], [92, "mov rbx, rdx"], [93, "or rbx, r12"], [94, "mov rax, rbx"], [95, "cqo"], [96, "idiv r12"], [97, "mov rbx, rdx"], [98, "or rbx, r12"], [99, "mov rax, rbx"], [100, "cqo"], [101, "idiv r12"], [102, "mov rbx, rdx"], [103, "or rbx, r12"], [104, "mov rax, rbx"], [105, "cqo"], [106, "idiv r12"], [107, "mov rbx, rdx"], [108, "or rbx, r12"], [109, "mov rax, rbx"], [110, "cqo"], [111, "idiv r12"], [112, "mov rbx, rdx"], [113, "or rbx, r12"], [114, "mov rax, rbx"], [115, "cqo"], [116, "idiv r12"], [117, "mov rbx, rdx"], [118, "or rbx, r12"], [119, "mov rax, rbx"], [120, "cqo"], [121, "idiv r12"], [122, "mov rbx, rdx"], [123, "or rbx, r12"], [124, "mov rax, rbx"], [125, "cqo"], [126, "idiv r12"], [127, "mov rbx, rdx"], [128, "or rbx, r12"], [129, "mov rax, rbx"], [130, "cqo"], [131, "idiv r12"], [132, "mov rbx, rdx"], [133, "or rbx, r12"], [134, "mov rax, rbx"], [135, "cqo"], [136, "idiv r12"], [137, "mov rbx, rdx"], [138, "or rbx, r12"], [139, "mov rax, rbx"], [140, "cqo"], [141, "idiv r12"], [142, "mov rbx, rdx"], [143, "or rbx, r12"], [144, "mov rax, rbx"], [145, "cqo"], [146, "idiv r12"], [147, "mov rbx, rdx"], [148, "or rbx, r12"], [149, "mov rax, rbx"], [150, "cqo"], [151, "idiv r12"], [152, "mov rbx, rdx"], [153, "or rbx, r12"], [154, "mov rax, rbx"], [155, "cqo"], [156, "idiv r12"], [157, "mov rbx, rdx"], [158, "or rbx, r12"], [159, "mov rax, rbx"], [160, "cqo"], [161, "idiv r12"], [162, "mov rbx, rdx"], [163, "or rbx, r12"], [164, "mov rax, rbx"], [165, "cqo"], [166, "idiv r12"], [167, "mov rbx, rdx"], [168, "or rbx, r12"], [169, "mov rax, rbx"], [170, "cqo"], [171, "idiv r12"], [172, "mov rbx, rdx"], [173, "or rbx, r12"], [174, "mov rax, rbx"], [175, "cqo"], [176, "idiv r12"], [177, "mov rbx, rdx"], [178, "or rbx, r12"], [179, "mov rax, rbx"], [180, "cqo"], [181, "idiv r12"], [182, "mov rbx, rdx"], [183, "or rbx, r12"], [184, "mov rax, rbx"], [185, "cqo"], [186, "idiv r12"], [187, "mov rbx, rdx"], [188, "or rbx, r12"], [189, "mov rax, rbx"], [190, "cqo"], [191, "idiv r12"], [192, "mov rbx, rdx"], [193, "or rbx, r12"], [194, "mov rax, rbx"], [195, "cqo"], [196, "idiv r12"], [197, "mov rbx, rdx"], [198, "or rbx, r12"], [199, "mov rax, rbx"], [200, "cqo"], [201, "idiv r12"], [202, "mov rbx, rdx"], [203, "or rbx, r12"], [204, "mov rax, rbx"], [205, "cqo"], [206, "idiv r12"], [207, "mov rbx, rdx"], [208, "or rbx, r12"], [209, "mov rax, rbx"], [210, "cqo"], [211, "idiv r12"], [212, "mov rbx, rdx"], [213, "or rbx, r12"], [214, "mov rax, rbx"], [215, "cqo"], [216, "idiv r12"], [217, "mov rbx, rdx"], [218, "or rbx, r12"], [219, "mov rax, rbx"], [220, "cqo"], [221, "idiv r12"], [222, "mov rbx, rdx"], [223, "or rbx, r12"], [224, "mov rax, rbx"], [225, "cqo"], [226, "idiv r12"], [227, "mov rbx, rdx"], [228, "or rbx, r12"], [229, "mov rax, rbx"], [230, "cqo"], [231, "idiv r12"], [232, "mov rbx, rdx"], [233, "or rbx, r12"], [234, "mov rax, rbx"], [235, "cqo"], [236, "idiv r12"], [237, "mov rbx, rdx"], [238, "or rbx, r12"], [239, "mov rax, rbx"], [240, "cqo"], [241, "idiv r12"], [242, "mov rbx, rdx"], [243, "or rbx, r12"], [244, "mov rax, rbx"], [245, "cqo"], [246, "idiv r12"], [247, "mov rbx, rdx"], [248, "or rbx, r12"], [249, "mov rax, rbx"], [250, "cqo"], [251, "idiv r12"], [252, "mov rbx, rdx"], [253, "or rbx, r12"], [254, "mov rax, rbx"], [255, "cqo"], [256, "idiv r12"], [257, "mov rbx, rdx"], [258, "or rbx, r12"], [259, "mov rax, rbx"], [260, "cqo"], [261, "idiv r12"], [262, "mov rbx, rdx"], [263, "or rbx, r12"], [264, "mov rax, rbx"], [265, "cqo"], [266, "idiv r12"], [267, "mov rbx, rdx"], [268, "or rbx, r12"], [269, "mov rax, rbx"], [270, "cqo"], [271, "idiv r12"], [272, "mov rbx, rdx"], [273, "or rbx, r12"], [274, "mov rax, rbx"], [275, "cqo"], [276, "idiv r12"], [277, "mov rbx, rdx"], [278, "or rbx, r12"], [279, "mov rax, rbx"], [280, "cqo"], [281, "idiv r12"], [282, "mov rbx, rdx"], [283, "or rbx, r12"], [284, "mov rax, rbx"], [285, "cqo"], [286, "idiv r12"], [287, "mov rbx, rdx"], [288, "or rbx, r12"], [289, "mov rax, rbx"], [290, "cqo"], [291, "idiv r12"], [292, "mov rbx, rdx"], [293, "or rbx, r12"], [294, "mov rax, rbx"], [295, "cqo"], [296, "idiv r12"], [297, "mov rbx, rdx"], [298, "or rbx, r12"], [299, "mov rax, rbx"], [300, "cqo"], [301, "idiv r12"], [302, "mov rbx, rdx"], [303, "or rbx, r12"], [304, "mov rax, rbx"], [305, "cqo"], [306, "idiv r12"], [307, "mov rbx, rdx"], [308, "or rbx, r12"], [309, "mov rax, rbx"], [310, "cqo"], [311, "idiv r12"], [312, "mov rbx, rdx"], [313, "or rbx, r12"], [314, "mov rax, rbx"], [315, "cqo"], [316, "idiv r12"], [317, "mov rbx, rdx"], [318, "or rbx, r12"], [319, "mov rax, rbx"], [320, "cqo"], [321, "idiv r12"], [322, "mov rbx, rdx"], [323, "or rbx, r12"], [324, "mov rax, rbx"], [325, "cqo"], [326, "idiv r12"], [327, "mov rbx, rdx"], [328, "or rbx, r12"], [329, "mov rax, rbx"], [330, "cqo"], [331, "idiv r12"], [332, "mov rbx, rdx"], [333, "or rbx, r12"], [334, "mov rax, rbx"], [335, "cqo"], [336, "idiv r12"], [337, "mov rbx, rdx"], [338, "or rbx, r12"], [339, "mov rax, rbx"], [340, "cqo"], [341, "idiv r12"], [342, "mov rbx, rdx"], [343, "or rbx, r12"], [344, "mov rax, rbx"], [345, "cqo"], [346, "idiv r12"], [347, "mov rbx, rdx"], [348, "or rbx, r12"], [349, "mov rax, rbx"], [350, "cqo"], [351, "idiv r12"], [352, "mov rbx, rdx"], [353, "or rbx, r12"], [354, "mov rax, rbx"], [355, "cqo"], [356, "idiv r12"], [357, "mov rbx, rdx"], [358, "or rbx, r12"], [359, "mov rax, rbx"], [360, "cqo"], [361, "idiv r12"], [362, "mov rbx, rdx"], [363, "or rbx, r12"], [364, "mov rax, rbx"], [365, "cqo"], [366, "idiv r12"], [367, "mov rbx, rdx"], [368, "or rbx, r12"], [369, "mov rax, rbx"], [370, "cqo"], [371, "idiv r12"], [372, "mov rbx, rdx"], [373, "or rbx, r12"], [374, "mov rax, rbx"], [375, "cqo"], [376, "idiv r12"], [377, "mov rbx, rdx"], [378, "or rbx, r12"], [379, "mov rax, rbx"], [380, "cqo"], [381, "idiv r12"], [382, "mov rbx, rdx"], [383, "or rbx, r12"], [384, "mov rax, rbx"], [385, "cqo"], [386, "idiv r12"], [387, "mov rbx, rdx"], [388, "or rbx, r12"], [389, "mov rax, rbx"], [390, "cqo"], [391, "idiv r12"], [392, "mov rbx, rdx"], [393, "or rbx, r12"], [394, "mov rax, rbx"], [395, "cqo"], [396, "idiv r12"], [397, "mov rbx, rdx"], [398, "or rbx, r12"], [399, "mov rax, rbx"], [400, "cqo"], [401, "idiv r12"], [402, "mov rbx, rdx"], [403, "or rbx, r12"], [404, "mov rax, rbx"], [405, "cqo"], [406, "idiv r12"], [407, "mov rbx, rdx"], [408, "or rbx, r12"], [409, "mov rax, rbx"], [410, "cqo"], [411, "idiv r12"], [412, "mov rbx, rdx"], [413, "or rbx, r12"], [414, "mov rax, rbx"], [415, "cqo"], [416, "idiv r12"], [417, "mov rbx, rdx"], [418, "or rbx, r12"], [419, "mov rax, rbx"], [420, "cqo"], [421, "idiv r12"], [422, "mov rbx, rdx"], [423, "or rbx, r12"], [424, "mov rax, rbx"], [425, "cqo"], [426, "idiv r12"], [427, "mov rbx, rdx"], [428, "or rbx, r12"], [429, "mov rax, rbx"], [430, "cqo"], [431, "idiv r12"], [432, "mov rbx, rdx"], [433, "or rbx, r12"], [434, "mov rax, rbx"], [435, "cqo"], [436, "idiv r12"], [437, "mov rbx, rdx"], [438, "or rbx, r12"], [439, "mov rax, rbx"], [440, "cqo"], [441, "idiv r12"], [442, "mov rbx, rdx"], [443, "or rbx, r12"], [444, "mov rax, rbx"], [445, "cqo"], [446, "idiv r12"], [447, "mov rbx, rdx"], [448, "or rbx, r12"], [449, "mov rax, rbx"], [450, "cqo"], [451, "idiv r12"], [452, "mov rbx, rdx"], [453, "or rbx, r12"], [454, "mov rax, rbx"], [455, "cqo"], [456, "idiv r12"], [457, "mov rbx, rdx"], [458, "or rbx, r12"], [459, "mov rax, rbx"], [460, "cqo"], [461, "idiv r12"], [462, "mov rbx, rdx"], [463, "or rbx, r12"], [464, "mov rax, rbx"], [465, "cqo"], [466, "idiv r12"], [467, "mov rbx, rdx"], [468, "or rbx, r12"], [469, "mov rax, rbx"], [470, "cqo"], [471, "idiv r12"], [472, "mov rbx, rdx"], [473, "or rbx, r12"], [474, "mov rax, rbx"], [475, "cqo"], [476, "idiv r12"], [477, "mov rbx, rdx"], [478, "or rbx, r12"], [479, "mov rax, rbx"], [480, "cqo"], [481, "idiv r12"], [482, "mov rbx, rdx"], [483, "or rbx, r12"], [484, "mov rax, rbx"], [485, "cqo"], [486, "idiv r12"], [487, "mov rbx, rdx"], [488, "or rbx, r12"], [489, "mov rax, rbx"], [490, "cqo"], [491, "idiv r12"], [492, "mov rbx, rdx"], [493, "or rbx, r12"], [494, "mov rax, rbx"], [495, "cqo"], [496, "idiv r12"], [497, "mov rbx, rdx"], [498, "or rbx, r12"], [499, "mov rax, rbx"], [500, "cqo"], [501, "idiv r12"], [502, "mov rbx, rdx"], [503, "or rbx, r12"], [504, "mov rax, rbx"], [505, "cqo"], [506, "idiv r12"], [507, "mov rbx, rdx"], [508, "or rbx, r12"], [509, "mov rax, rbx"], [510, "cqo"], [511, "idiv r12"], [512, "mov rbx, rdx"], [513, "or rbx, r12"], [514, "mov rax, rbx"], [515, "cqo"], [516, "idiv r12"], [517, "mov rbx, rdx"], [518, "or rbx, r12"], [519, "mov rax, rbx"], [520, "cqo"], [521, "idiv r12"], [522, "mov rbx, rdx"], [523, "or rbx, r12"], [524, "mov rax, [rbp+var_28]"], [525, "lea rdx, [rax-1]"], [526, "mov [rbp+var_28], rdx"], [527, "test rax, rax"], [528, "jnz loc_40313B"], [529, "mov eax, ebx"], [530, "mov edi, eax"], [531, "call sub_40845C"], [532, "nop"], [533, "add rsp, 20h"], [534, "pop rbx"], [535, "pop r12"], [536, "pop rbp"], [537, "retn"]], "data_dep": [[7, 6], [8, 7], [9, 5], [10, 9], [11, 10], [12, 5], [13, 12], [13, 11], [14, 13], [15, 8], [16, 15], [17, 16], [18, 8], [19, 18], [21, 19], [22, 21], [24, 523], [24, 14], [26, 521], [26, 22], [27, 525], [28, 27], [28, 26], [29, 28], [31, 26], [32, 525], [33, 32], [33, 31], [34, 33], [36, 31], [37, 525], [38, 36], [38, 37], [39, 38], [41, 36], [42, 525], [43, 41], [43, 42], [44, 43], [46, 41], [47, 525], [48, 47], [48, 46], [49, 48], [51, 46], [52, 525], [53, 52], [53, 51], [54, 53], [56, 51], [57, 525], [58, 57], [58, 56], [59, 58], [61, 56], [62, 525], [63, 61], [63, 62], [64, 63], [66, 61], [67, 525], [68, 67], [68, 66], [69, 68], [71, 66], [72, 525], [73, 72], [73, 71], [74, 73], [76, 71], [77, 525], [78, 77], [78, 76], [79, 78], [81, 76], [82, 525], [83, 81], [83, 82], [84, 83], [86, 81], [87, 525], [88, 86], [88, 87], [89, 88], [91, 86], [92, 525], [93, 92], [93, 91], [94, 93], [96, 91], [97, 525], [98, 97], [98, 96], [99, 98], [101, 96], [102, 525], [103, 102], [103, 101], [104, 103], [106, 101], [107, 525], [108, 107], [108, 106], [109, 108], [111, 106], [112, 525], [113, 112], [113, 111], [114, 113], [116, 111], [117, 525], [118, 117], [118, 116], [119, 118], [121, 116], [122, 525], [123, 121], [123, 122], [124, 123], [126, 121], [127, 525], [128, 127], [128, 126], [129, 128], [131, 126], [132, 525], [133, 132], [133, 131], [134, 133], [136, 131], [137, 525], [138, 137], [138, 136], [139, 138], [141, 136], [142, 525], [143, 141], [143, 142], [144, 143], [146, 141], [147, 525], [148, 147], [148, 146], [149, 148], [151, 146], [152, 525], [153, 152], [153, 151], [154, 153], [156, 151], [157, 525], [158, 157], [158, 156], [159, 158], [161, 156], [162, 525], [163, 161], [163, 162], [164, 163], [166, 161], [167, 525], [168, 167], [168, 166], [169, 168], [171, 166], [172, 525], [173, 172], [173, 171], [174, 173], [176, 171], [177, 525], [178, 177], [178, 176], [179, 178], [181, 176], [182, 525], [183, 182], [183, 181], [184, 183], [186, 181], [187, 525], [188, 187], [188, 186], [189, 188], [191, 186], [192, 525], [193, 192], [193, 191], [194, 193], [196, 191], [197, 525], [198, 197], [198, 196], [199, 198], [201, 196], [202, 525], [203, 202], [203, 201], [204, 203], [206, 201], [207, 525], [208, 207], [208, 206], [209, 208], [211, 206], [212, 525], [213, 212], [213, 211], [214, 213], [216, 211], [217, 525], [218, 217], [218, 216], [219, 218], [221, 216], [222, 525], [223, 222], [223, 221], [224, 223], [226, 221], [227, 525], [228, 226], [228, 227], [229, 228], [231, 226], [232, 525], [233, 232], [233, 231], [234, 233], [236, 231], [237, 525], [238, 237], [238, 236], [239, 238], [241, 236], [242, 525], [243, 242], [243, 241], [244, 243], [246, 241], [247, 525], [248, 247], [248, 246], [249, 248], [251, 246], [252, 525], [253, 252], [253, 251], [254, 253], [256, 251], [257, 525], [258, 257], [258, 256], [259, 258], [261, 256], [262, 525], [263, 262], [263, 261], [264, 263], [266, 261], [267, 525], [268, 266], [268, 267], [269, 268], [271, 266], [272, 525], [273, 272], [273, 271], [274, 273], [276, 271], [277, 525], [278, 277], [278, 276], [279, 278], [281, 276], [282, 525], [283, 282], [283, 281], [284, 283], [286, 281], [287, 525], [288, 286], [288, 287], [289, 288], [291, 286], [292, 525], [293, 292], [293, 291], [294, 293], [296, 291], [297, 525], [298, 297], [298, 296], [299, 298], [301, 296], [302, 525], [303, 302], [303, 301], [304, 303], [306, 301], [307, 525], [308, 306], [308, 307], [309, 308], [311, 306], [312, 525], [313, 311], [313, 312], [314, 313], [316, 311], [317, 525], [318, 317], [318, 316], [319, 318], [321, 316], [322, 525], [323, 322], [323, 321], [324, 323], [326, 321], [327, 525], [328, 327], [328, 326], [329, 328], [331, 326], [332, 525], [333, 332], [333, 331], [334, 333], [336, 331], [337, 525], [338, 337], [338, 336], [339, 338], [341, 336], [342, 525], [343, 342], [343, 341], [344, 343], [346, 341], [347, 525], [348, 346], [348, 347], [349, 348], [351, 346], [352, 525], [353, 351], [353, 352], [354, 353], [356, 351], [357, 525], [358, 357], [358, 356], [359, 358], [361, 356], [362, 525], [363, 362], [363, 361], [364, 363], [366, 361], [367, 525], [368, 367], [368, 366], [369, 368], [371, 366], [372, 525], [373, 371], [373, 372], [374, 373], [376, 371], [377, 525], [378, 377], [378, 376], [379, 378], [381, 376], [382, 525], [383, 382], [383, 381], [384, 383], [386, 381], [387, 525], [388, 387], [388, 386], [389, 388], [391, 386], [392, 525], [393, 391], [393, 392], [394, 393], [396, 391], [397, 525], [398, 397], [398, 396], [399, 398], [401, 396], [402, 525], [403, 402], [403, 401], [404, 403], [406, 401], [407, 525], [408, 407], [408, 406], [409, 408], [411, 406], [412, 525], [413, 412], [413, 411], [414, 413], [416, 411], [417, 525], [418, 417], [418, 416], [419, 418], [421, 416], [422, 525], [423, 422], [423, 421], [424, 423], [426, 421], [427, 525], [428, 427], [428, 426], [429, 428], [431, 426], [432, 525], [433, 431], [433, 432], [434, 433], [436, 431], [437, 525], [438, 436], [438, 437], [439, 438], [441, 436], [442, 525], [443, 442], [443, 441], [444, 443], [446, 441], [447, 525], [448, 447], [448, 446], [449, 448], [451, 446], [452, 525], [453, 452], [453, 451], [454, 453], [456, 451], [457, 525], [458, 456], [458, 457], [459, 458], [461, 456], [462, 525], [463, 462], [463, 461], [464, 463], [466, 461], [467, 525], [468, 467], [468, 466], [469, 468], [471, 466], [472, 525], [473, 471], [473, 472], [474, 473], [476, 471], [477, 525], [478, 477], [478, 476], [479, 478], [481, 476], [482, 525], [483, 482], [483, 481], [484, 483], [486, 481], [487, 525], [488, 487], [488, 486], [489, 488], [491, 486], [492, 525], [493, 492], [493, 491], [494, 493], [496, 491], [497, 525], [498, 496], [498, 497], [499, 498], [501, 496], [502, 525], [503, 502], [503, 501], [504, 503], [506, 501], [507, 525], [508, 507], [508, 506], [509, 508], [511, 506], [512, 525], [513, 512], [513, 511], [514, 513], [516, 511], [517, 525], [518, 516], [518, 517], [519, 518], [521, 516], [522, 525], [523, 522], [523, 521], [524, 5], [524, 526], [525, 525], [525, 17], [525, 524], [526, 525], [527, 524], [528, 527], [529, 523], [529, 14], [530, 529], [533, 4], [534, 3], [535, 2], [536, 0], [537, 531]]}
| {"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_4030ED", "query": "\n\n\n__int64 __fastcall sub_4030ED(__int64 a1, int *a2)\n{\n__int64 v2; // rbx\n__int64 i; // r12\n__int128 v4; // rt2\n__int64 v7; // [rsp+8h] [rbp-28h]\n\nv7 = a1;\nv2 = 0x100000001LL * a1;\nfor ( i = 0x100000000000001LL * *a2;\nv7--;\nv2 = i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((__int64)(i | (v4 % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i) )\n{\nv4 = i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | ((i | (v2 % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i)) % i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i))\n% i);\n}\nreturn sub_40845C((unsigned int)v2);\n}\n\n\n\nQ:[a1,a2,v7,sub_4030ED,sub_40845C,]", "hints": "[]", "response": "{'a1': 'iterations', 'a2': 'cookie', 'v7': 'iterationsa', 'sub_4030ED': 'do_int64_mod', 'sub_40845C': 'use_int'}"} | [
[
0.7702044248580933,
0.7601108551025391,
0.7556979656219482,
0.724968433380127,
0.719110906124115,
0.7059000730514526,
0.6996343731880188,
0.6994544267654419,
0.6987780928611755,
0.6978597640991211,
0.6971319913864136,
0.6963804960250854,
0.6962416172027588,
0.6936488151550293,
0.693438708782196,
0.6921697854995728,
0.6899529099464417,
0.6847955584526062,
0.684544026851654,
0.6844867467880249
],
[
1697,
201634,
247758,
242102,
649,
193341,
153138,
72564,
136831,
150259,
46531,
202670,
175210,
83260,
191122,
218651,
205631,
3345,
150379,
170467
]
] |
|
scan | ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af | sergev | vak-opensource | NA | void scan (char *dir)
{
DIR *d;
FILE *fd;
struct dirent *e;
char path [LINESZ], info [LINESZ], *iptr;
struct stat st;
int dirflag;
struct tm *ptm;
unsigned long mod;
d = opendir (dir);
if (! d) {
perror (dir);
return;
}
while ((e = readdir (d)) != 0) {
if (e->d_name[0] == '.')
continue;
strcpy (path, dir);
strcat (path, "/");
strcat (path, e->d_name);
if (lstat (path, &st) < 0)
continue;
dirflag = 0;
switch (st.st_mode & S_IFMT) {
case S_IFDIR:
if (exclude (dir))
continue;
stack_push (path, &st);
dirflag = 1;
break;
case S_IFLNK:
if (exclude (dir))
continue;
if (stat (path, &st) < 0)
continue;
if ((st.st_mode & S_IFMT) == S_IFDIR) {
stack_push (path, &st);
dirflag = 2;
}
break;
case S_IFREG:
break;
default:
continue;
}
sprintf (info, "%s/.info/%s", dir, e->d_name);
fd = fopen (info, "r");
iptr = info;
*info = 0;
ptm = localtime (&st.st_mtime);
mod = ptm->tm_year * 10000 + (ptm->tm_mon + 1) * 100 +
ptm->tm_mday;
if (fd) {
if (fgetinfo (info, sizeof (info), fd)) {
if (ISDIGIT (info[0]) && ISDIGIT (info[1]) &&
ISDIGIT (info[2]) && ISDIGIT (info[3]) &&
ISDIGIT (info[4]) && ISDIGIT (info[5])) {
mod = atol (info);
iptr = info + 6;
while (*iptr==' ' || *iptr=='\t')
++iptr;
}
} else
*info = 0;
fclose (fd);
}
if (debug) {
fputs (path+offset, stderr);
if (dirflag) {
putc ('/', stderr);
if (dirflag > 1)
putc ('/', stderr);
} else
fprintf (stderr, " %06ld", mod);
if (*iptr) {
putc (' ', stderr);
fputs (iptr, stderr);
}
putc ('\n', stderr);
}
if (prefix)
fputs (prefix, stdout);
fputs (path+offset, stdout);
if (dirflag) {
putchar ('/');
if (dirflag > 1)
putchar ('/');
} else
printf (" %06ld", mod);
if (*iptr) {
putchar (' ');
fputs (iptr, stdout);
}
putchar ('\n');
if (dirflag && verbose) {
fputs (path+offset, stderr);
if (dirflag)
putc ('/', stderr);
if (*iptr) {
fputs (" -- ", stderr);
fputs (iptr, stderr);
}
putc ('\n', stderr);
}
}
closedir (d);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401921", "function_addr": 4200737, "binary_name": "ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 4E0h"], [3, "mov [rbp+name], rdi"], [4, "mov rax, [rbp+name]"], [5, "mov rdi, rax"], [6, "call _opendir"], [7, "mov [rbp+dirp], rax"], [8, "cmp [rbp+dirp], 0"], [9, "jnz loc_401EB7"], [10, "mov rax, [rbp+name]"], [11, "mov rdi, rax"], [12, "call _perror"], [13, "jmp locret_401EDE"], [14, "mov rax, [rbp+var_28]"], [15, "movzx eax, byte ptr [rax+13h]"], [16, "cmp al, 2Eh "], [17, "jnz short loc_401976"], [18, "jmp loc_401EB7"], [19, "mov rdx, [rbp+name]"], [20, "lea rax, [rbp+dest]"], [21, "mov rsi, rdx"], [22, "mov rdi, rax"], [23, "call _strcpy"], [24, "lea rax, [rbp+dest]"], [25, "mov rdi, rax"], [26, "call _strlen"], [27, "mov rdx, rax"], [28, "lea rax, [rbp+dest]"], [29, "add rax, rdx"], [30, "mov word ptr [rax], 2Fh "], [31, "mov rax, [rbp+var_28]"], [32, "lea rdx, [rax+13h]"], [33, "lea rax, [rbp+dest]"], [34, "mov rsi, rdx"], [35, "mov rdi, rax"], [36, "call _strcat"], [37, "lea rdx, [rbp+stat_buf]"], [38, "lea rax, [rbp+dest]"], [39, "mov rsi, rdx"], [40, "mov rdi, rax"], [41, "call sub_402890"], [42, "test eax, eax"], [43, "jns short loc_4019EC"], [44, "jmp loc_401EB7"], [45, "mov [rbp+var_C], 0"], [46, "mov eax, [rbp+stat_buf.st_mode]"], [47, "and eax, 0F000h"], [48, "cmp eax, 0A000h"], [49, "jz short loc_401A61"], [50, "cmp eax, 0A000h"], [51, "ja loc_401EB7"], [52, "cmp eax, 4000h"], [53, "jz short loc_401A27"], [54, "cmp eax, 8000h"], [55, "jz loc_401AD4"], [56, "jmp loc_401ACF"], [57, "mov rax, [rbp+name]"], [58, "mov rdi, rax"], [59, "call sub_4018B4"], [60, "test eax, eax"], [61, "jz short loc_401A3F"], [62, "jmp loc_401EB7"], [63, "lea rdx, [rbp+stat_buf]"], [64, "lea rax, [rbp+dest]"], [65, "mov rsi, rdx"], [66, "mov rdi, rax"], [67, "call sub_401F2B"], [68, "mov [rbp+var_C], 1"], [69, "jmp short loc_401AD8"], [70, "mov rax, [rbp+name]"], [71, "mov rdi, rax"], [72, "call sub_4018B4"], [73, "test eax, eax"], [74, "jz short loc_401A79"], [75, "jmp loc_401EB7"], [76, "lea rdx, [rbp+stat_buf]"], [77, "lea rax, [rbp+dest]"], [78, "mov rsi, rdx"], [79, "mov rdi, rax"], [80, "call sub_402880"], [81, "test eax, eax"], [82, "jns short loc_401A9B"], [83, "jmp loc_401EB7"], [84, "mov eax, [rbp+stat_buf.st_mode]"], [85, "and eax, 0F000h"], [86, "cmp eax, 4000h"], [87, "jnz short loc_401AD7"], [88, "lea rdx, [rbp+stat_buf]"], [89, "lea rax, [rbp+dest]"], [90, "mov rsi, rdx"], [91, "mov rdi, rax"], [92, "call sub_401F2B"], [93, "mov [rbp+var_C], 2"], [94, "jmp short loc_401AD7"], [95, "jmp loc_401EB7"], [96, "nop"], [97, "jmp short loc_401AD8"], [98, "nop"], [99, "mov rax, [rbp+var_28]"], [100, "lea rcx, [rax+13h]"], [101, "mov rdx, [rbp+name]"], [102, "lea rax, [rbp+s]"], [103, "mov esi, offset aSInfoS"], [104, "mov rdi, rax"], [105, "mov eax, 0"], [106, "call _sprintf"], [107, "lea rax, [rbp+s]"], [108, "mov esi, offset aR"], [109, "mov rdi, rax"], [110, "call _fopen"], [111, "mov [rbp+stream], rax"], [112, "lea rax, [rbp+s]"], [113, "mov [rbp+var_8], rax"], [114, "mov [rbp+s], 0"], [115, "lea rax, [rbp+stat_buf]"], [116, "add rax, 58h "], [117, "mov rdi, rax"], [118, "call _localtime"], [119, "mov [rbp+var_38], rax"], [120, "mov rax, [rbp+var_38]"], [121, "mov eax, [rax+14h]"], [122, "imul edx, eax, 2710h"], [123, "mov rax, [rbp+var_38]"], [124, "mov eax, [rax+10h]"], [125, "add eax, 1"], [126, "imul eax, 64h "], [127, "add edx, eax"], [128, "mov rax, [rbp+var_38]"], [129, "mov eax, [rax+0Ch]"], [130, "add eax, edx"], [131, "cdqe"], [132, "mov [rbp+var_18], rax"], [133, "cmp [rbp+stream], 0"], [134, "jz loc_401C87"], [135, "mov rdx, [rbp+stream]"], [136, "lea rax, [rbp+s]"], [137, "mov esi, 200h"], [138, "mov rdi, rax"], [139, "call sub_402064"], [140, "test eax, eax"], [141, "jz loc_401C74"], [142, "movzx eax, [rbp+s]"], [143, "cmp al, 2Fh "], [144, "jle loc_401C7B"], [145, "movzx eax, [rbp+s]"], [146, "cmp al, 39h "], [147, "jg loc_401C7B"], [148, "movzx eax, [rbp+var_43F]"], [149, "cmp al, 2Fh "], [150, "jle loc_401C7B"], [151, "movzx eax, [rbp+var_43F]"], [152, "cmp al, 39h "], [153, "jg loc_401C7B"], [154, "movzx eax, [rbp+var_43E]"], [155, "cmp al, 2Fh "], [156, "jle loc_401C7B"], [157, "movzx eax, [rbp+var_43E]"], [158, "cmp al, 39h "], [159, "jg loc_401C7B"], [160, "movzx eax, [rbp+var_43D]"], [161, "cmp al, 2Fh "], [162, "jle short loc_401C7B"], [163, "movzx eax, [rbp+var_43D]"], [164, "cmp al, 39h "], [165, "jg short loc_401C7B"], [166, "movzx eax, [rbp+var_43C]"], [167, "cmp al, 2Fh "], [168, "jle short loc_401C7B"], [169, "movzx eax, [rbp+var_43C]"], [170, "cmp al, 39h "], [171, "jg short loc_401C7B"], [172, "movzx eax, [rbp+var_43B]"], [173, "cmp al, 2Fh "], [174, "jle short loc_401C7B"], [175, "movzx eax, [rbp+var_43B]"], [176, "cmp al, 39h "], [177, "jg short loc_401C7B"], [178, "lea rax, [rbp+s]"], [179, "mov rdi, rax"], [180, "call _atol"], [181, "mov [rbp+var_18], rax"], [182, "lea rax, [rbp+s]"], [183, "add rax, 6"], [184, "mov [rbp+var_8], rax"], [185, "jmp short loc_401C5C"], [186, "add [rbp+var_8], 1"], [187, "mov rax, [rbp+var_8]"], [188, "movzx eax, byte ptr [rax]"], [189, "cmp al, 20h "], [190, "jz short loc_401C57"], [191, "mov rax, [rbp+var_8]"], [192, "movzx eax, byte ptr [rax]"], [193, "cmp al, 9"], [194, "jz short loc_401C57"], [195, "jmp short loc_401C7B"], [196, "mov [rbp+s], 0"], [197, "mov rax, [rbp+stream]"], [198, "mov rdi, rax"], [199, "call _fclose"], [200, "mov eax, cs:dword_4051D4"], [201, "test eax, eax"], [202, "jz loc_401D56"], [203, "mov rax, cs:stderr"], [204, "mov edx, cs:dword_4051D8"], [205, "movsxd rdx, edx"], [206, "lea rcx, [rbp+dest]"], [207, "add rdx, rcx"], [208, "mov rsi, rax"], [209, "mov rdi, rdx"], [210, "call _fputs"], [211, "cmp [rbp+var_C], 0"], [212, "jz short loc_401CF0"], [213, "mov rax, cs:stderr"], [214, "mov rsi, rax"], [215, "mov edi, 2Fh "], [216, "call _putc"], [217, "cmp [rbp+var_C], 1"], [218, "jle short loc_401D0D"], [219, "mov rax, cs:stderr"], [220, "mov rsi, rax"], [221, "mov edi, 2Fh "], [222, "call _putc"], [223, "jmp short loc_401D0D"], [224, "mov rax, cs:stderr"], [225, "mov rdx, [rbp+var_18]"], [226, "mov esi, offset a06ld"], [227, "mov rdi, rax"], [228, "mov eax, 0"], [229, "call _fprintf"], [230, "mov rax, [rbp+var_8]"], [231, "movzx eax, byte ptr [rax]"], [232, "test al, al"], [233, "jz short loc_401D42"], [234, "mov rax, cs:stderr"], [235, "mov rsi, rax"], [236, "mov edi, 20h "], [237, "call _putc"], [238, "mov rdx, cs:stderr"], [239, "mov rax, [rbp+var_8]"], [240, "mov rsi, rdx"], [241, "mov rdi, rax"], [242, "call _fputs"], [243, "mov rax, cs:stderr"], [244, "mov rsi, rax"], [245, "mov edi, 0Ah"], [246, "call _putc"], [247, "mov rax, cs:qword_4051C8"], [248, "test rax, rax"], [249, "jz short loc_401D7B"], [250, "mov rdx, cs:stdout"], [251, "mov rax, cs:qword_4051C8"], [252, "mov rsi, rdx"], [253, "mov rdi, rax"], [254, "call _fputs"], [255, "mov rax, cs:stdout"], [256, "mov edx, cs:dword_4051D8"], [257, "movsxd rdx, edx"], [258, "lea rcx, [rbp+dest]"], [259, "add rdx, rcx"], [260, "mov rsi, rax"], [261, "mov rdi, rdx"], [262, "call _fputs"], [263, "cmp [rbp+var_C], 0"], [264, "jz short loc_401DC2"], [265, "mov edi, 2Fh "], [266, "call _putchar"], [267, "cmp [rbp+var_C], 1"], [268, "jle short loc_401DD8"], [269, "mov edi, 2Fh "], [270, "call _putchar"], [271, "jmp short loc_401DD8"], [272, "mov rax, [rbp+var_18]"], [273, "mov rsi, rax"], [274, "mov edi, offset a06ld"], [275, "mov eax, 0"], [276, "call _printf"], [277, "mov rax, [rbp+var_8]"], [278, "movzx eax, byte ptr [rax]"], [279, "test al, al"], [280, "jz short loc_401E03"], [281, "mov edi, 20h "], [282, "call _putchar"], [283, "mov rdx, cs:stdout"], [284, "mov rax, [rbp+var_8]"], [285, "mov rsi, rdx"], [286, "mov rdi, rax"], [287, "call _fputs"], [288, "mov edi, 0Ah"], [289, "call _putchar"], [290, "cmp [rbp+var_C], 0"], [291, "jz loc_401EB7"], [292, "mov eax, cs:dword_4051D0"], [293, "test eax, eax"], [294, "jz loc_401EB7"], [295, "mov rax, cs:stderr"], [296, "mov edx, cs:dword_4051D8"], [297, "movsxd rdx, edx"], [298, "lea rcx, [rbp+dest]"], [299, "add rdx, rcx"], [300, "mov rsi, rax"], [301, "mov rdi, rdx"], [302, "call _fputs"], [303, "cmp [rbp+var_C], 0"], [304, "jz short loc_401E64"], [305, "mov rax, cs:stderr"], [306, "mov rsi, rax"], [307, "mov edi, 2Fh "], [308, "call _putc"], [309, "mov rax, [rbp+var_8]"], [310, "movzx eax, byte ptr [rax]"], [311, "test al, al"], [312, "jz short loc_401EA3"], [313, "mov rax, cs:stderr"], [314, "mov rcx, rax"], [315, "mov edx, 4"], [316, "mov esi, 1"], [317, "mov edi, offset asc_4031E4"], [318, "call _fwrite"], [319, "mov rdx, cs:stderr"], [320, "mov rax, [rbp+var_8]"], [321, "mov rsi, rdx"], [322, "mov rdi, rax"], [323, "call _fputs"], [324, "mov rax, cs:stderr"], [325, "mov rsi, rax"], [326, "mov edi, 0Ah"], [327, "call _putc"], [328, "mov rax, [rbp+dirp]"], [329, "mov rdi, rax"], [330, "call _readdir"], [331, "mov [rbp+var_28], rax"], [332, "cmp [rbp+var_28], 0"], [333, "jnz loc_401965"], [334, "mov rax, [rbp+dirp]"], [335, "mov rdi, rax"], [336, "call _closedir"], [337, "leave"], [338, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 8], [10, 3], [11, 10], [14, 331], [15, 30], [15, 14], [16, 15], [17, 16], [19, 3], [20, 15], [21, 19], [22, 20], [24, 23], [25, 24], [27, 26], [28, 26], [29, 27], [29, 28], [30, 29], [31, 331], [32, 30], [32, 27], [32, 31], [33, 31], [34, 32], [35, 33], [37, 32], [38, 36], [39, 37], [40, 38], [42, 41], [43, 42], [47, 46], [48, 47], [49, 48], [50, 47], [51, 50], [52, 47], [53, 52], [54, 47], [55, 54], [57, 3], [58, 57], [60, 59], [61, 60], [63, 37], [64, 60], [65, 63], [66, 64], [70, 3], [71, 70], [73, 72], [74, 73], [76, 37], [77, 73], [78, 76], [79, 77], [81, 80], [82, 81], [85, 84], [86, 85], [87, 86], [88, 76], [89, 85], [90, 88], [91, 89], [99, 331], [100, 30], [100, 258], [100, 314], [100, 298], [100, 99], [101, 3], [102, 114], [102, 196], [102, 99], [104, 102], [107, 106], [107, 114], [107, 196], [109, 107], [111, 110], [112, 114], [112, 196], [112, 110], [113, 112], [115, 112], [116, 115], [117, 116], [119, 118], [120, 119], [121, 120], [121, 30], [122, 101], [122, 121], [123, 119], [124, 30], [124, 123], [125, 124], [126, 125], [127, 122], [127, 126], [128, 119], [129, 128], [129, 30], [130, 127], [130, 129], [132, 130], [133, 111], [134, 133], [135, 111], [136, 114], [136, 130], [138, 136], [140, 139], [141, 140], [142, 114], [143, 142], [144, 143], [145, 114], [146, 145], [147, 146], [149, 148], [150, 149], [152, 151], [153, 152], [155, 154], [156, 155], [158, 157], [159, 158], [161, 160], [162, 161], [164, 163], [165, 164], [167, 166], [168, 167], [170, 169], [171, 170], [173, 172], [174, 173], [176, 175], [177, 176], [178, 175], [178, 114], [179, 178], [181, 180], [182, 114], [182, 180], [183, 182], [184, 183], [186, 184], [186, 186], [187, 184], [187, 186], [188, 187], [188, 30], [189, 188], [190, 189], [191, 184], [191, 186], [192, 30], [192, 191], [193, 192], [194, 193], [197, 111], [198, 197], [201, 200], [202, 201], [205, 204], [206, 100], [207, 206], [207, 205], [208, 203], [209, 207], [211, 45], [211, 93], [211, 68], [212, 211], [214, 213], [217, 93], [217, 68], [217, 45], [218, 217], [220, 219], [225, 132], [225, 181], [227, 224], [230, 184], [230, 113], [230, 186], [231, 230], [231, 30], [232, 231], [233, 232], [235, 234], [239, 186], [239, 113], [239, 184], [240, 238], [241, 239], [244, 243], [248, 247], [249, 248], [252, 250], [253, 251], [257, 256], [258, 206], [258, 100], [259, 258], [259, 257], [260, 255], [261, 259], [263, 45], [263, 93], [263, 68], [264, 263], [267, 93], [267, 68], [267, 45], [268, 267], [272, 132], [272, 181], [273, 272], [277, 184], [277, 113], [277, 186], [278, 30], [278, 277], [279, 278], [280, 279], [284, 184], [284, 113], [284, 186], [285, 283], [286, 284], [290, 68], [290, 45], [290, 93], [291, 290], [293, 292], [294, 293], [297, 296], [298, 258], [299, 298], [299, 297], [300, 295], [301, 299], [303, 68], [303, 45], [303, 93], [304, 303], [306, 305], [309, 184], [309, 113], [309, 186], [310, 309], [310, 30], [311, 310], [312, 311], [314, 313], [320, 184], [320, 113], [320, 186], [321, 319], [322, 320], [325, 324], [328, 7], [329, 328], [331, 330], [332, 331], [333, 332], [334, 7], [335, 334], [338, 336], [338, 12]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af_ccd2f908d3b02cb37bb4f18cf67597a14af1f9f0e5bb425ae35b09667cf816af.jsonl.gz", "strip_func_name": "sub_401921", "query": "\n\n\nvoid __fastcall sub_401921(const char *a1)\n{\nunsigned int v1; // eax\nstruct stat stat_buf; // [rsp+10h] [rbp-4D0h] BYREF\nchar s; // [rsp+A0h] [rbp-440h] BYREF\nchar v4; // [rsp+A1h] [rbp-43Fh]\nchar v5; // [rsp+A2h] [rbp-43Eh]\nchar v6; // [rsp+A3h] [rbp-43Dh]\nchar v7; // [rsp+A4h] [rbp-43Ch]\nchar v8; // [rsp+A5h] [rbp-43Bh]\n__int16 v9; // [rsp+A6h] [rbp-43Ah] BYREF\nchar dest[520]; // [rsp+2A0h] [rbp-240h] BYREF\nstruct tm *v11; // [rsp+4A8h] [rbp-38h]\nFILE *stream; // [rsp+4B0h] [rbp-30h]\nstruct dirent *v13; // [rsp+4B8h] [rbp-28h]\nDIR *dirp; // [rsp+4C0h] [rbp-20h]\n__int64 v15; // [rsp+4C8h] [rbp-18h]\nint v16; // [rsp+4D4h] [rbp-Ch]\nchar *i; // [rsp+4D8h] [rbp-8h]\n\ndirp = opendir(a1);\nif ( !dirp )\n{\nperror(a1);\nreturn;\n}\nwhile ( 1 )\n{\nv13 = readdir(dirp);\nif ( !v13 )\nbreak;\nif ( v13->d_name[0] != 46 )\n{\nstrcpy(dest, a1);\n*(_WORD *)&dest[strlen(dest)] = 47;\nstrcat(dest, v13->d_name);\nif ( (int)sub_402890(dest, &stat_buf) >= 0 )\n{\nv16 = 0;\nv1 = stat_buf.st_mode & 0xF000;\nif ( v1 == 40960 )\n{\nif ( !(unsigned int)sub_4018B4(a1) && (int)sub_402880(dest, &stat_buf) >= 0 )\n{\nif ( (stat_buf.st_mode & 0xF000) == 0x4000 )\n{\nsub_401F2B(dest, &stat_buf);\nv16 = 2;\n}\nLABEL_16:\nsprintf(&s, \"%s/.info/%s\", a1, v13->d_name);\nstream = fopen(&s, \"r\");\ni = &s;\ns = 0;\nv11 = localtime(&stat_buf.st_mtim.tv_sec);\nv15 = 100 * (v11->tm_mon + 1) + 10000 * v11->tm_year + v11->tm_mday;\nif ( stream )\n{\nif ( (unsigned int)sub_402064(&s, 512LL, stream) )\n{\nif ( s > 47\n&& s <= 57\n&& v4 > 47\n&& v4 <= 57\n&& v5 > 47\n&& v5 <= 57\n&& v6 > 47\n&& v6 <= 57\n&& v7 > 47\n&& v7 <= 57\n&& v8 > 47\n&& v8 <= 57 )\n{\nv15 = atol(&s);\nfor ( i = (char *)&v9; *i == 32 || *i == 9; ++i )\n;\n}\n}\nelse\n{\ns = 0;\n}\nfclose(stream);\n}\nif ( dword_4051D4 )\n{\nfputs(&dest[dword_4051D8], stderr);\nif ( v16 )\n{\nputc(47, stderr);\nif ( v16 > 1 )\nputc(47, stderr);\n}\nelse\n{\nfprintf(stderr, \" %06ld\", v15);\n}\nif ( *i )\n{\nputc(32, stderr);\nfputs(i, stderr);\n}\nputc(10, stderr);\n}\nif ( qword_4051C8 )\nfputs(qword_4051C8, stdout);\nfputs(&dest[dword_4051D8], stdout);\nif ( v16 )\n{\nputchar(47);\nif ( v16 > 1 )\nputchar(47);\n}\nelse\n{\nprintf(\" %06ld\", v15);\n}\nif ( *i )\n{\nputchar(32);\nfputs(i, stdout);\n}\nputchar(10);\nif ( v16 && dword_4051D0 )\n{\nfputs(&dest[dword_4051D8], stderr);\nif ( v16 )\nputc(47, stderr);\nif ( *i )\n{\nfwrite(\" -- \", 1uLL, 4uLL, stderr);\nfputs(i, stderr);\n}\nputc(10, stderr);\n}\n}\n}\nelse if ( v1 <= 0xA000 )\n{\nif ( v1 == 0x4000 )\n{\nif ( !(unsigned int)sub_4018B4(a1) )\n{\nsub_401F2B(dest, &stat_buf);\nv16 = 1;\ngoto LABEL_16;\n}\n}\nelse if ( v1 == 0x8000 )\n{\ngoto LABEL_16;\n}\n}\n}\n}\n}\nclosedir(dirp);\n}\n\n\n\nQ:[a1,stat_buf,s,dest,v11,stream,v13,dirp,v15,v16,i,sub_401921,sub_402890,sub_4018B4,sub_402880,sub_401F2B,sub_402064,]", "hints": "[]", "response": "{'a1': 'dir', 'stat_buf': 'st', 's': 'info', 'dest': 'path', 'v11': 'ptm', 'stream': 'fd', 'v13': 'e', 'dirp': 'd', 'v15': 'mod', 'v16': 'dirflag', 'i': 'iptr', 'sub_401921': 'scan', 'sub_402890': 'lstat', 'sub_4018B4': 'exclude', 'sub_402880': 'stat_0', 'sub_401F2B': 'stack_push', 'sub_402064': 'fgetinfo'}"} | [
[
0.7640953063964844,
0.7387576103210449,
0.710970401763916,
0.7058180570602417,
0.6989328265190125,
0.6956643462181091,
0.6951920986175537,
0.6949220895767212,
0.694281280040741,
0.6940521001815796,
0.6911513805389404,
0.6896652579307556,
0.6811354160308838,
0.679421067237854,
0.6767606139183044,
0.6743245124816895,
0.6739803552627563,
0.673974871635437,
0.6705400943756104,
0.6698724627494812
],
[
209261,
136897,
143480,
30466,
11561,
258949,
133413,
212478,
165194,
27577,
227865,
46892,
9601,
229104,
65820,
781,
164197,
28916,
7887,
47320
]
] |
|
UMX_Read | 3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4 | sezero | mikmod | NA | static BOOL UMX_Read(MREADER* reader,void* ptr,size_t size)
{
UMXREADER* r = (UMXREADER*)reader;
size_t ret;
if (!size || size > LONG_MAX) return 0;
if ((long)size > r->length - r->pos) /* just read to end */
size = r->length - r->pos;
ret = fread(ptr, 1, size, r->file);
r->pos += ret;
return !!ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401DA3", "function_addr": 4201891, "binary_name": "3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.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+ptr], rsi"], [5, "mov [rbp+n], rdx"], [6, "mov rax, [rbp+var_18]"], [7, "mov [rbp+var_8], rax"], [8, "cmp [rbp+n], 0"], [9, "jz short loc_401DCF"], [10, "mov rax, [rbp+n]"], [11, "test rax, rax"], [12, "jns short loc_401DD6"], [13, "mov eax, 0"], [14, "jmp short locret_401E55"], [15, "mov rax, [rbp+var_8]"], [16, "mov rdx, [rax+50h]"], [17, "mov rax, [rbp+var_8]"], [18, "mov rax, [rax+58h]"], [19, "sub rdx, rax"], [20, "mov rax, [rbp+n]"], [21, "cmp rdx, rax"], [22, "jge short loc_401E0C"], [23, "mov rax, [rbp+var_8]"], [24, "mov rdx, [rax+50h]"], [25, "mov rax, [rbp+var_8]"], [26, "mov rcx, [rax+58h]"], [27, "mov rax, rdx"], [28, "sub rax, rcx"], [29, "mov [rbp+n], rax"], [30, "mov rax, [rbp+var_8]"], [31, "mov rcx, [rax+60h]"], [32, "mov rdx, [rbp+n]"], [33, "mov rax, [rbp+ptr]"], [34, "mov esi, 1"], [35, "mov rdi, rax"], [36, "call _fread"], [37, "mov [rbp+var_10], rax"], [38, "mov rax, [rbp+var_8]"], [39, "mov rax, [rax+58h]"], [40, "mov rdx, rax"], [41, "mov rax, [rbp+var_10]"], [42, "add rax, rdx"], [43, "mov rdx, rax"], [44, "mov rax, [rbp+var_8]"], [45, "mov [rax+58h], rdx"], [46, "cmp [rbp+var_10], 0"], [47, "setnz al"], [48, "movzx eax, al"], [49, "leave"], [50, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 5], [9, 8], [10, 5], [11, 10], [12, 11], [15, 7], [16, 15], [17, 7], [18, 17], [19, 18], [19, 16], [20, 5], [21, 19], [21, 20], [22, 21], [23, 7], [24, 23], [25, 7], [26, 25], [27, 24], [28, 27], [28, 26], [29, 28], [30, 7], [31, 30], [32, 5], [32, 29], [33, 4], [35, 33], [37, 36], [38, 7], [39, 38], [40, 39], [41, 37], [42, 41], [42, 40], [43, 42], [44, 7], [45, 43], [45, 44], [46, 37], [47, 46], [47, 44], [48, 47], [50, 48], [50, 13]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4_3b4e7c8e571dbef1cc467f13d9cc9a00673bdbf51ee147e786798355742589c4.jsonl.gz", "strip_func_name": "sub_401DA3", "query": "\n\n\n_BOOL8 __fastcall sub_401DA3(__int64 a1, void *a2, __int64 a3)\n{\nsize_t v4; // rax\nsize_t n; // [rsp+8h] [rbp-28h]\n\nn = a3;\nif ( !a3 || a3 < 0 )\nreturn 0LL;\nif ( *(_QWORD *)(a1 + 80) - *(_QWORD *)(a1 + 88) < a3 )\nn = *(_QWORD *)(a1 + 80) - *(_QWORD *)(a1 + 88);\nv4 = fread(a2, 1uLL, n, *(FILE **)(a1 + 96));\n*(_QWORD *)(a1 + 88) += v4;\nreturn v4 != 0;\n}\n\n\n\nQ:[a3,a1,a2,n,sub_401DA3,]", "hints": "[]", "response": "{'a3': 'size', 'a1': 'reader', 'a2': 'ptr', 'n': 'sizea', 'sub_401DA3': 'UMX_Read'}"} | [
[
0.8198556900024414,
0.8126130700111389,
0.8064659833908081,
0.8008527159690857,
0.7893955111503601,
0.788128137588501,
0.782322883605957,
0.7773207426071167,
0.7764848470687866,
0.7731324434280396,
0.7650232911109924,
0.7537685632705688,
0.75275719165802,
0.7498537302017212,
0.7486817836761475,
0.7428227066993713,
0.7408265471458435,
0.7401225566864014,
0.7377561926841736,
0.729851245880127
],
[
41085,
248088,
190661,
76844,
199230,
254264,
55801,
131912,
10200,
55568,
159573,
248463,
159958,
235699,
241080,
164910,
131958,
198746,
231907,
19536
]
] |
|
concat | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | static void concat(char *out, char *in1, char *in2, int32_t l1, int32_t l2) {
while (l1--)
*out++ = *in1++;
while (l2--)
*out++ = *in2++;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_446BAF", "function_addr": 4484015, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.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_28], rdx"], [6, "mov [rbp+var_2C], ecx"], [7, "mov [rbp+var_30], r8d"], [8, "mov rax, fs:28h"], [9, "mov [rbp+var_8], rax"], [10, "xor eax, eax"], [11, "jmp short loc_446BF8"], [12, "mov rdx, [rbp+var_20]"], [13, "lea rax, [rdx+1]"], [14, "mov [rbp+var_20], rax"], [15, "mov rax, [rbp+var_18]"], [16, "lea rcx, [rax+1]"], [17, "mov [rbp+var_18], rcx"], [18, "movzx edx, byte ptr [rdx]"], [19, "mov [rax], dl"], [20, "mov eax, [rbp+var_2C]"], [21, "lea edx, [rax-1]"], [22, "mov [rbp+var_2C], edx"], [23, "test eax, eax"], [24, "jnz short loc_446BDB"], [25, "jmp short loc_446C24"], [26, "mov rdx, [rbp+var_28]"], [27, "lea rax, [rdx+1]"], [28, "mov [rbp+var_28], rax"], [29, "mov rax, [rbp+var_18]"], [30, "lea rcx, [rax+1]"], [31, "mov [rbp+var_18], rcx"], [32, "movzx edx, byte ptr [rdx]"], [33, "mov [rax], dl"], [34, "mov eax, [rbp+var_30]"], [35, "lea edx, [rax-1]"], [36, "mov [rbp+var_30], edx"], [37, "test eax, eax"], [38, "jnz short loc_446C07"], [39, "nop"], [40, "mov rax, [rbp+var_8]"], [41, "sub rax, fs:28h"], [42, "jz short locret_446C46"], [43, "call ___stack_chk_fail"], [44, "leave"], [45, "retn"]], "data_dep": [[9, 8], [12, 4], [12, 14], [13, 23], [13, 19], [13, 12], [14, 13], [15, 17], [15, 3], [16, 16], [16, 19], [16, 15], [17, 16], [18, 19], [18, 12], [19, 18], [19, 15], [20, 22], [20, 6], [21, 19], [21, 18], [21, 20], [22, 21], [23, 20], [24, 23], [26, 5], [26, 28], [27, 19], [27, 37], [27, 33], [27, 26], [28, 27], [29, 17], [29, 31], [29, 3], [30, 30], [30, 33], [30, 29], [30, 16], [30, 19], [31, 30], [32, 19], [32, 33], [32, 26], [33, 29], [33, 32], [34, 7], [34, 36], [35, 33], [35, 32], [35, 19], [35, 34], [35, 21], [36, 35], [37, 34], [38, 37], [40, 9], [41, 40], [42, 41], [45, 41]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40_a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.jsonl.gz", "strip_func_name": "sub_446BAF", "query": "\n\n\nunsigned __int64 __fastcall sub_446BAF(_BYTE *a1, _BYTE *a2, _BYTE *a3, int a4, int a5)\n{\n_BYTE *v5; // rdx\n_BYTE *v6; // rax\n_BYTE *v8; // rdx\n_BYTE *v9; // rax\nunsigned __int64 v17; // [rsp+28h] [rbp-8h]\n\nv17 = __readfsqword(0x28u);\nwhile ( a4-- )\n{\nv5 = a2++;\nv6 = a1++;\n*v6 = *v5;\n}\nwhile ( a5-- )\n{\nv8 = a3++;\nv9 = a1++;\n*v9 = *v8;\n}\nreturn v17 - __readfsqword(0x28u);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,sub_446BAF,]", "hints": "[]", "response": "{'a3': 'in2', 'a4': 'l1', 'a1': 'out', 'a2': 'in1', 'a5': 'l2', 'sub_446BAF': 'concat'}"} | [
[
0.8201936483383179,
0.8178738951683044,
0.7688946723937988,
0.7582588791847229,
0.7532753348350525,
0.7476432919502258,
0.7448107004165649,
0.7415664196014404,
0.7415144443511963,
0.7345209717750549,
0.7283392548561096,
0.7282688617706299,
0.7257534265518188,
0.7235720753669739,
0.7151387929916382,
0.7139456272125244,
0.7137047052383423,
0.7133119106292725,
0.7127156853675842,
0.7104631066322327
],
[
229816,
22464,
123051,
88667,
233108,
163329,
7516,
47398,
20381,
99134,
137599,
34710,
246021,
261737,
145395,
182946,
171846,
191788,
41438,
163877
]
] |
|
read_dns | 2c823d36ac173f8c57467b7034458132287e23cf51ab4ef3f7b330b6382a2027 | yarrick | iodine | NA | static int
read_dns(int fd, struct dnsfd *dns_fds, int tun_fd, struct query *q)
/* FIXME: dns_fds and tun_fd are because of raw_decode() below */
{
struct sockaddr_storage from;
socklen_t addrlen;
char packet[64*1024];
int r;
#ifndef WINDOWS32
char control[CMSG_SPACE(sizeof (struct in6_pktinfo))];
struct msghdr msg;
struct iovec iov;
struct cmsghdr *cmsg;
addrlen = sizeof(struct sockaddr_storage);
iov.iov_base = packet;
iov.iov_len = sizeof(packet);
msg.msg_name = (caddr_t) &from;
msg.msg_namelen = (unsigned) addrlen;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = control;
msg.msg_controllen = sizeof(control);
msg.msg_flags = 0;
r = recvmsg(fd, &msg, 0);
#else
addrlen = sizeof(struct sockaddr_storage);
r = recvfrom(fd, packet, sizeof(packet), 0, (struct sockaddr*)&from, &addrlen);
#endif /* !WINDOWS32 */
if (r > 0) {
memcpy((struct sockaddr*)&q->from, (struct sockaddr*)&from, addrlen);
q->fromlen = addrlen;
/* TODO do not handle raw packets here! */
if (raw_decode(packet, r, q, fd, dns_fds, tun_fd)) {
return 0;
}
if (dns_decode(NULL, 0, q, QR_QUERY, packet, r) <= 0) {
return 0;
}
#ifndef WINDOWS32
memset(&q->destination, 0, sizeof(struct sockaddr_storage));
/* Read destination IP address */
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level == IPPROTO_IP &&
cmsg->cmsg_type == DSTADDR_SOCKOPT) {
struct sockaddr_in *addr = (struct sockaddr_in *) &q->destination;
addr->sin_family = AF_INET;
addr->sin_addr = *dstaddr(cmsg);
q->dest_len = sizeof(*addr);
break;
}
if (cmsg->cmsg_level == IPPROTO_IPV6 &&
cmsg->cmsg_type == IPV6_PKTINFO) {
struct in6_pktinfo *pktinfo;
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &q->destination;
pktinfo = (struct in6_pktinfo *) CMSG_DATA(cmsg);
addr->sin6_family = AF_INET6;
memcpy(&addr->sin6_addr, &pktinfo->ipi6_addr, sizeof(struct in6_addr));
q->dest_len = sizeof(*addr);
break;
}
}
#endif
return strlen(q->name);
} else if (r < 0) {
/* Error */
warn("read dns");
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40F6B8", "function_addr": 4257464, "binary_name": "2c823d36ac173f8c57467b7034458132287e23cf51ab4ef3f7b330b6382a2027.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10150h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+var_10140], rsi"], [5, "mov [rbp+var_10138], edx"], [6, "mov [rbp+s], rcx"], [7, "mov dword ptr [rbp+n], 80h"], [8, "lea rax, [rbp+var_100B0]"], [9, "mov [rbp+var_10130], rax"], [10, "mov [rbp+var_10128], 10000h"], [11, "lea rax, [rbp+src]"], [12, "mov [rbp+message.msg_name], rax"], [13, "mov eax, dword ptr [rbp+n]"], [14, "mov [rbp+message.msg_namelen], eax"], [15, "lea rax, [rbp+var_10130]"], [16, "mov [rbp+message.msg_iov], rax"], [17, "mov [rbp+message.msg_iovlen], 1"], [18, "lea rax, [rbp+var_100E0]"], [19, "mov [rbp+message.msg_control], rax"], [20, "mov [rbp+message.msg_controllen], 28h "], [21, "mov [rbp+message.msg_flags], 0"], [22, "lea rcx, [rbp+message]"], [23, "mov eax, [rbp+fd]"], [24, "mov edx, 0"], [25, "mov rsi, rcx"], [26, "mov edi, eax"], [27, "call _recvmsg"], [28, "mov [rbp+var_10], eax"], [29, "cmp [rbp+var_10], 0"], [30, "jle loc_40F969"], [31, "mov edx, dword ptr [rbp+n]"], [32, "mov rax, [rbp+s]"], [33, "lea rcx, [rax+190h]"], [34, "lea rax, [rbp+src]"], [35, "mov rsi, rax"], [36, "mov rdi, rcx"], [37, "call _memcpy"], [38, "mov rax, [rbp+s]"], [39, "mov edx, dword ptr [rbp+n]"], [40, "mov [rax+210h], edx"], [41, "mov r8d, [rbp+var_10138]"], [42, "mov rdi, [rbp+var_10140]"], [43, "mov ecx, [rbp+fd]"], [44, "mov rdx, [rbp+s]"], [45, "mov esi, [rbp+var_10]"], [46, "lea rax, [rbp+var_100B0]"], [47, "mov r9d, r8d"], [48, "mov r8, rdi"], [49, "mov rdi, rax"], [50, "call sub_40F589"], [51, "test eax, eax"], [52, "jz short loc_40F7ED"], [53, "mov eax, 0"], [54, "jmp locret_40F983"], [55, "mov eax, [rbp+var_10]"], [56, "movsxd rcx, eax"], [57, "lea rdx, [rbp+var_100B0]"], [58, "mov rax, [rbp+s]"], [59, "mov r9, rcx"], [60, "mov r8, rdx"], [61, "mov ecx, 0"], [62, "mov rdx, rax"], [63, "mov esi, 0"], [64, "mov edi, 0"], [65, "call sub_403B0E"], [66, "test eax, eax"], [67, "jg short loc_40F82C"], [68, "mov eax, 0"], [69, "jmp locret_40F983"], [70, "mov rax, [rbp+s]"], [71, "add rax, 108h"], [72, "mov edx, 80h"], [73, "mov esi, 0"], [74, "mov rdi, rax"], [75, "call _memset"], [76, "mov rax, [rbp+message.msg_controllen]"], [77, "cmp rax, 0Fh"], [78, "jbe short loc_40F861"], [79, "mov rax, [rbp+message.msg_control]"], [80, "jmp short loc_40F866"], [81, "mov eax, 0"], [82, "mov [rbp+n+4], rax"], [83, "jmp loc_40F94D"], [84, "mov rax, [rbp+n+4]"], [85, "mov eax, [rax+8]"], [86, "test eax, eax"], [87, "jnz short loc_40F8C8"], [88, "mov rax, [rbp+n+4]"], [89, "mov eax, [rax+0Ch]"], [90, "cmp eax, 8"], [91, "jnz short loc_40F8C8"], [92, "mov rax, [rbp+s]"], [93, "add rax, 108h"], [94, "mov [rbp+var_18], rax"], [95, "mov rax, [rbp+var_18]"], [96, "mov word ptr [rax], 2"], [97, "mov rax, [rbp+n+4]"], [98, "lea rdx, [rax+10h]"], [99, "mov rax, [rbp+var_18]"], [100, "mov edx, [rdx+8]"], [101, "mov [rax+4], edx"], [102, "mov rax, [rbp+s]"], [103, "mov dword ptr [rax+188h], 10h"], [104, "jmp loc_40F958"], [105, "mov rax, [rbp+n+4]"], [106, "mov eax, [rax+8]"], [107, "cmp eax, 29h "], [108, "jnz short loc_40F933"], [109, "mov rax, [rbp+n+4]"], [110, "mov eax, [rax+0Ch]"], [111, "cmp eax, 32h "], [112, "jnz short loc_40F933"], [113, "mov rax, [rbp+s]"], [114, "add rax, 108h"], [115, "mov [rbp+var_20], rax"], [116, "mov rax, [rbp+n+4]"], [117, "add rax, 10h"], [118, "mov [rbp+var_28], rax"], [119, "mov rax, [rbp+var_20]"], [120, "mov word ptr [rax], 0Ah"], [121, "mov rax, [rbp+var_28]"], [122, "mov rdx, [rbp+var_20]"], [123, "lea rcx, [rdx+8]"], [124, "mov rdx, [rax+8]"], [125, "mov rax, [rax]"], [126, "mov [rcx], rax"], [127, "mov [rcx+8], rdx"], [128, "mov rax, [rbp+s]"], [129, "mov dword ptr [rax+188h], 1Ch"], [130, "jmp short loc_40F958"], [131, "mov rdx, [rbp+n+4]"], [132, "lea rax, [rbp+message]"], [133, "mov rsi, rdx"], [134, "mov rdi, rax"], [135, "call ___cmsg_nxthdr"], [136, "mov [rbp+n+4], rax"], [137, "cmp [rbp+n+4], 0"], [138, "jnz loc_40F86F"], [139, "mov rax, [rbp+s]"], [140, "mov rdi, rax"], [141, "call _strlen"], [142, "jmp short locret_40F983"], [143, "cmp [rbp+var_10], 0"], [144, "jns short loc_40F97E"], [145, "mov edi, offset aReadDns"], [146, "mov eax, 0"], [147, "call _warn"], [148, "mov eax, 0"], [149, "leave"], [150, "retn"]], "data_dep": [[9, 8], [11, 8], [12, 11], [13, 7], [14, 13], [15, 9], [15, 13], [16, 15], [18, 15], [19, 18], [23, 3], [25, 22], [26, 23], [28, 27], [29, 28], [30, 29], [31, 7], [32, 6], [33, 22], [33, 32], [34, 32], [35, 34], [36, 33], [38, 6], [39, 7], [40, 38], [40, 39], [41, 5], [42, 4], [43, 3], [44, 6], [45, 28], [46, 38], [47, 41], [48, 42], [49, 46], [51, 50], [52, 51], [55, 28], [56, 55], [57, 44], [58, 6], [59, 56], [60, 57], [62, 58], [66, 65], [67, 66], [70, 6], [71, 70], [74, 71], [76, 20], [77, 76], [78, 77], [79, 19], [82, 79], [82, 81], [84, 136], [84, 82], [85, 84], [85, 40], [86, 85], [87, 86], [88, 136], [88, 82], [89, 40], [89, 88], [90, 89], [91, 90], [92, 6], [93, 92], [94, 93], [95, 94], [96, 95], [97, 136], [97, 82], [98, 96], [98, 72], [98, 131], [98, 97], [99, 94], [100, 96], [100, 98], [101, 99], [101, 100], [102, 6], [103, 102], [105, 136], [105, 82], [106, 40], [106, 105], [107, 106], [108, 107], [109, 82], [109, 136], [110, 109], [110, 40], [111, 110], [112, 111], [113, 6], [114, 113], [115, 114], [116, 136], [116, 82], [117, 116], [118, 117], [119, 115], [120, 119], [121, 118], [122, 115], [123, 61], [123, 120], [123, 122], [124, 120], [124, 121], [125, 121], [125, 120], [126, 123], [126, 125], [127, 124], [127, 123], [128, 6], [129, 128], [131, 136], [131, 82], [132, 106], [132, 110], [133, 131], [134, 132], [136, 135], [137, 82], [137, 136], [138, 137], [139, 6], [140, 139], [143, 28], [144, 143], [150, 148], [150, 68], [150, 141], [150, 53]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c823d36ac173f8c57467b7034458132287e23cf51ab4ef3f7b330b6382a2027_2c823d36ac173f8c57467b7034458132287e23cf51ab4ef3f7b330b6382a2027.jsonl.gz", "strip_func_name": "sub_40F6B8", "query": "\n\n\nsize_t __fastcall sub_40F6B8(int a1, unsigned int *a2, int a3, __int64 a4)\n{\nsize_t result; // rax\nvoid *v5; // rax\n__int64 v6; // rcx\n__int64 v7; // rdx\n__int64 v10[2]; // [rsp+20h] [rbp-10130h] BYREF\nstruct msghdr message; // [rsp+30h] [rbp-10120h] BYREF\nchar v12; // [rsp+70h] [rbp-100E0h] BYREF\nchar v13[65536]; // [rsp+A0h] [rbp-100B0h] BYREF\nchar src[136]; // [rsp+100A0h] [rbp-B0h] BYREF\n_QWORD *v15; // [rsp+10128h] [rbp-28h]\n__int64 v16; // [rsp+10130h] [rbp-20h]\n__int64 v17; // [rsp+10138h] [rbp-18h]\nint v18; // [rsp+10140h] [rbp-10h]\n_DWORD n[3]; // [rsp+10144h] [rbp-Ch]\n\nn[0] = 128;\nv10[0] = (__int64)v13;\nv10[1] = 0x10000LL;\nmessage.msg_name = src;\nmessage.msg_namelen = 128;\nmessage.msg_iov = (iovec *)v10;\nmessage.msg_iovlen = 1LL;\nmessage.msg_control = &v12;\nmessage.msg_controllen = 40LL;\nmessage.msg_flags = 0;\nv18 = recvmsg(a1, &message, 0);\nif ( v18 <= 0 )\n{\nif ( v18 < 0 )\nwarn(\"read dns\");\nresult = 0LL;\n}\nelse\n{\nmemcpy((void *)(a4 + 400), src, n[0]);\n*(_DWORD *)(a4 + 528) = n[0];\nif ( (unsigned int)sub_40F589(v13, v18, (unsigned int *)a4, a1, a2, a3) )\n{\nresult = 0LL;\n}\nelse if ( (int)sub_403B0E(0LL, 0LL, a4, 0, (__int64)v13, v18) > 0 )\n{\nmemset((void *)(a4 + 264), 0, 0x80uLL);\nif ( message.msg_controllen <= 0xF )\nv5 = 0LL;\nelse\nv5 = message.msg_control;\nfor ( *(_QWORD *)&n[1] = v5; *(_QWORD *)&n[1]; *(_QWORD *)&n[1] = __cmsg_nxthdr(\n&message,\n*(struct cmsghdr **)&n[1]) )\n{\nif ( *(_QWORD *)(*(_QWORD *)&n[1] + 8LL) == 0x800000000LL )\n{\nv17 = a4 + 264;\n*(_WORD *)(a4 + 264) = 2;\n*(_DWORD *)(v17 + 4) = *(_DWORD *)(*(_QWORD *)&n[1] + 24LL);\n*(_DWORD *)(a4 + 392) = 16;\nbreak;\n}\nif ( *(_QWORD *)(*(_QWORD *)&n[1] + 8LL) == 0x3200000029LL )\n{\nv16 = a4 + 264;\nv15 = (_QWORD *)(*(_QWORD *)&n[1] + 16LL);\n*(_WORD *)(a4 + 264) = 10;\nv6 = v16 + 8;\nv7 = v15[1];\n*(_QWORD *)(v16 + 8) = *v15;\n*(_QWORD *)(v6 + 8) = v7;\n*(_DWORD *)(a4 + 392) = 28;\nbreak;\n}\n}\nresult = strlen((const char *)a4);\n}\nelse\n{\nresult = 0LL;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,v10,message,v12,v13,src,v15,v16,v17,v18,n,sub_40F6B8,sub_40F589,sub_403B0E,]", "hints": "[]", "response": "{'a3': 'tun_fd', 'a4': 'q', 'a1': 'fd', 'a2': 'dns_fds', 'v10': 'iov', 'message': 'msg', 'v12': 'control', 'v13': 'packet', 'src': 'from', 'v15': 'pktinfo', 'v16': 'addr_0', 'v17': 'addr', 'v18': 'r', 'n': 'addrlen', 'sub_40F6B8': 'read_dns', 'sub_40F589': 'raw_decode', 'sub_403B0E': 'dns_decode'}"} | [
[
0.7680693864822388,
0.7494414448738098,
0.7409489154815674,
0.705185055732727,
0.7041218280792236,
0.7005048990249634,
0.6920775175094604,
0.6846534609794617,
0.6807998418807983,
0.6802794933319092,
0.6787083148956299,
0.6779465675354004,
0.6771509051322937,
0.6767539978027344,
0.6703119277954102,
0.6683177351951599,
0.666214108467102,
0.6646800637245178,
0.6630349159240723,
0.6630057096481323
],
[
237779,
195635,
51740,
41409,
250203,
218248,
24661,
76261,
203676,
250176,
217630,
33920,
160315,
44671,
32285,
197384,
133020,
177974,
41621,
210484
]
] |
|
uv5r_print_version | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void uv5r_print_version(FILE *out, int show_version)
{
// Don't print firmware and serial number to file,
// to prevent the user to copy them from one radio to another.
if (show_version) {
// Copy the string, trim spaces.
char buf[17];
const char *version = trim_str((const char *)&radio_mem[0x1EC0 + 0x30], 14, buf);
// 3+poweron message
fprintf(out, "Firmware: %s\n", version);
// Copy the string, trim spaces.
const char *serial = trim_str((const char *)&radio_mem[0x1EC0 + 0x10], 16, buf);
// 6+poweron message
fprintf(out, "Serial: %.16s\n", serial);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_404392", "function_addr": 4211602, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+stream], rdi"], [4, "lea rax, [rbp+var_30]"], [5, "mov [rbp+dest], rax"], [6, "mov rax, [rbp+dest]"], [7, "mov edx, 10h"], [8, "mov esi, offset src"], [9, "mov rdi, rax"], [10, "call _strncpy"], [11, "mov rax, [rbp+dest]"], [12, "add rax, 10h"], [13, "mov byte ptr [rax], 0"], [14, "jmp short loc_4043CE"], [15, "add [rbp+dest], 1"], [16, "mov rax, [rbp+dest]"], [17, "movzx eax, byte ptr [rax]"], [18, "cmp al, 20h "], [19, "jz short loc_4043C9"], [20, "mov rax, [rbp+dest]"], [21, "mov rdi, rax"], [22, "call _strlen"], [23, "mov rdx, [rbp+dest]"], [24, "add rax, rdx"], [25, "mov [rbp+var_10], rax"], [26, "jmp short loc_4043FE"], [27, "sub [rbp+var_10], 1"], [28, "mov rax, [rbp+var_10]"], [29, "mov byte ptr [rax], 0"], [30, "mov rax, [rbp+var_10]"], [31, "cmp rax, [rbp+dest]"], [32, "jbe short loc_404417"], [33, "mov rax, [rbp+var_10]"], [34, "sub rax, 1"], [35, "movzx eax, byte ptr [rax]"], [36, "cmp al, 20h "], [37, "jz short loc_4043F2"], [38, "mov rax, cs:stdout"], [39, "cmp [rbp+stream], rax"], [40, "jnz short loc_404459"], [41, "mov rdx, [rbp+dest]"], [42, "mov rax, [rbp+stream]"], [43, "mov esi, offset aFirmwareS"], [44, "mov rdi, rax"], [45, "mov eax, 0"], [46, "call _fprintf"], [47, "mov rax, [rbp+stream]"], [48, "mov edx, offset unk_41C8B0"], [49, "mov esi, offset aSerial16s"], [50, "mov rdi, rax"], [51, "mov eax, 0"], [52, "call _fprintf"], [53, "nop"], [54, "leave"], [55, "retn"]], "data_dep": [[5, 4], [6, 5], [9, 6], [11, 5], [12, 11], [13, 12], [15, 5], [15, 15], [16, 15], [16, 5], [17, 16], [17, 13], [18, 17], [19, 18], [20, 5], [20, 15], [21, 20], [23, 15], [23, 5], [24, 23], [24, 22], [25, 24], [27, 25], [27, 27], [28, 27], [29, 28], [30, 27], [30, 25], [31, 5], [31, 15], [31, 30], [32, 31], [33, 25], [33, 27], [34, 33], [35, 29], [35, 13], [35, 34], [36, 35], [37, 36], [39, 38], [39, 3], [40, 39], [41, 15], [41, 5], [42, 3], [44, 42], [47, 3], [50, 47], [55, 38], [55, 52]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_404392", "query": "\n\n\nint __fastcall sub_404392(FILE *a1)\n{\nsize_t v1; // rax\nint result; // eax\nFILE *stream; // [rsp+8h] [rbp-38h]\nchar v4[32]; // [rsp+10h] [rbp-30h] BYREF\nchar *i; // [rsp+30h] [rbp-10h]\nchar *dest; // [rsp+38h] [rbp-8h]\n\nstream = a1;\ndest = v4;\nstrncpy(v4, src, 0x10uLL);\ndest[16] = 0;\nwhile ( *dest == 32 )\n++dest;\nv1 = strlen(dest);\nfor ( i = &dest[v1]; i > dest && *(i - 1) == 32; *i = 0 )\n--i;\nresult = (int)stdout;\nif ( stream == stdout )\n{\nfprintf(stream, \"Firmware: %s\\n\", dest);\nresult = fprintf(stream, \"Serial: %.16s\\n\", byte_41C8B0);\n}\nreturn result;\n}\n\n\n\nQ:[a1,stream,v4,i,dest,sub_404392,]", "hints": "[]", "response": "{'a1': 'out', 'stream': 'outa', 'v4': 'buf', 'i': 'p', 'dest': 'version', 'sub_404392': 'uv5r_print_version'}"} | [
[
0.7961058616638184,
0.790834903717041,
0.7812486886978149,
0.7790481448173523,
0.7778714299201965,
0.7760906219482422,
0.7728736400604248,
0.7621304988861084,
0.7618541717529297,
0.7550305128097534,
0.754503607749939,
0.7518683671951294,
0.7506297826766968,
0.74483323097229,
0.7430480122566223,
0.7425658106803894,
0.7425646781921387,
0.7417953014373779,
0.7402177453041077,
0.7383006811141968
],
[
225089,
23768,
110092,
192659,
34178,
217840,
134960,
242056,
68830,
213372,
224861,
39789,
223763,
259121,
222263,
228158,
250161,
193202,
21528,
238609
]
] |
|
arm_sub_f32 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_sub_f32(
const float32_t * pSrcA,
const float32_t * pSrcB,
float32_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
#if defined(ARM_MATH_NEON) && !defined(ARM_MATH_AUTOVECTORIZE)
f32x4_t vec1;
f32x4_t vec2;
f32x4_t res;
/* Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = A - B */
/* Subtract and then store the results in the destination buffer. */
vec1 = vld1q_f32(pSrcA);
vec2 = vld1q_f32(pSrcB);
res = vsubq_f32(vec1, vec2);
vst1q_f32(pDst, res);
/* Increment pointers */
pSrcA += 4;
pSrcB += 4;
pDst += 4;
/* Decrement the loop counter */
blkCnt--;
}
/* Tail */
blkCnt = blockSize & 0x3;
#else
#if defined (ARM_MATH_LOOPUNROLL) && !defined(ARM_MATH_AUTOVECTORIZE)
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = A - B */
/* Subtract and store result in destination buffer. */
*pDst++ = (*pSrcA++) - (*pSrcB++);
*pDst++ = (*pSrcA++) - (*pSrcB++);
*pDst++ = (*pSrcA++) - (*pSrcB++);
*pDst++ = (*pSrcA++) - (*pSrcB++);
/* 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) */
#endif /* #if defined(ARM_MATH_NEON) */
while (blkCnt > 0U)
{
/* C = A - B */
/* Subtract and store result in destination buffer. */
*pDst++ = (*pSrcA++) - (*pSrcB++);
/* Decrement loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_420A76", "function_addr": 4328054, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.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 [rbp+var_28], rdx"], [5, "mov [rbp+var_2C], ecx"], [6, "mov eax, [rbp+var_2C]"], [7, "mov [rbp+var_4], eax"], [8, "jmp short loc_420AC9"], [9, "mov rax, [rbp+var_18]"], [10, "lea rdx, [rax+4]"], [11, "mov [rbp+var_18], rdx"], [12, "movss xmm0, dword ptr [rax]"], [13, "mov rax, [rbp+var_20]"], [14, "lea rdx, [rax+4]"], [15, "mov [rbp+var_20], rdx"], [16, "movss xmm1, dword ptr [rax]"], [17, "mov rax, [rbp+var_28]"], [18, "lea rdx, [rax+4]"], [19, "mov [rbp+var_28], rdx"], [20, "subss xmm0, xmm1"], [21, "movss dword ptr [rax], xmm0"], [22, "sub [rbp+var_4], 1"], [23, "cmp [rbp+var_4], 0"], [24, "jnz short loc_420A91"], [25, "nop"], [26, "nop"], [27, "pop rbp"], [28, "retn"]], "data_dep": [[6, 5], [7, 6], [9, 2], [9, 11], [10, 9], [10, 18], [10, 21], [11, 10], [12, 9], [12, 21], [13, 3], [13, 15], [14, 10], [14, 13], [14, 21], [15, 14], [16, 13], [16, 21], [17, 4], [17, 19], [18, 17], [18, 21], [18, 14], [19, 18], [20, 16], [20, 12], [21, 17], [21, 20], [22, 7], [22, 22], [23, 7], [23, 22], [24, 23], [27, 0], [28, 6], [28, 17]]}
| {"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_420A76", "query": "\n\n\nunsigned __int64 __fastcall sub_420A76(float *a1, float *a2, float *a3, unsigned int a4)\n{\nunsigned __int64 result; // rax\nfloat *v5; // rax\nfloat v6; // xmm0_4\nfloat *v7; // rax\nfloat v8; // xmm1_4\nunsigned int i; // [rsp+28h] [rbp-4h]\n\nresult = a4;\nfor ( i = a4; i; --i )\n{\nv5 = a1++;\nv6 = *v5;\nv7 = a2++;\nv8 = *v7;\nresult = (unsigned __int64)a3++;\n*(float *)result = v6 - v8;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_420A76,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'blockSize', 'a1': 'pSrcA', 'a2': 'pSrcB', 'sub_420A76': 'arm_sub_f32'}"} | [
[
0.7691798210144043,
0.765672504901886,
0.7627675533294678,
0.7623918056488037,
0.7584398984909058,
0.7574172616004944,
0.7543853521347046,
0.7533656358718872,
0.752607524394989,
0.7515603303909302,
0.747228741645813,
0.7467907667160034,
0.7412093281745911,
0.7390316128730774,
0.7388182282447815,
0.7363081574440002,
0.7356630563735962,
0.7343901991844177,
0.7321048974990845,
0.7300819158554077
],
[
21595,
114099,
104107,
43842,
236238,
262851,
7516,
125659,
199963,
34710,
88667,
233108,
41438,
154538,
201384,
22464,
105898,
230915,
229816,
86703
]
] |
|
arm_sub_q15 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_sub_q15(
const q15_t * pSrcA,
const q15_t * pSrcB,
q15_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
#if defined (ARM_MATH_LOOPUNROLL)
#if defined (ARM_MATH_DSP)
q31_t inA1, inA2;
q31_t inB1, inB2;
#endif
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = A - B */
#if defined (ARM_MATH_DSP)
/* read 2 times 2 samples at a time from sourceA */
inA1 = read_q15x2_ia ((q15_t **) &pSrcA);
inA2 = read_q15x2_ia ((q15_t **) &pSrcA);
/* read 2 times 2 samples at a time from sourceB */
inB1 = read_q15x2_ia ((q15_t **) &pSrcB);
inB2 = read_q15x2_ia ((q15_t **) &pSrcB);
/* Subtract and store 2 times 2 samples at a time */
write_q15x2_ia (&pDst, __QSUB16(inA1, inB1));
write_q15x2_ia (&pDst, __QSUB16(inA2, inB2));
#else
*pDst++ = (q15_t) __SSAT(((q31_t) *pSrcA++ - *pSrcB++), 16);
*pDst++ = (q15_t) __SSAT(((q31_t) *pSrcA++ - *pSrcB++), 16);
*pDst++ = (q15_t) __SSAT(((q31_t) *pSrcA++ - *pSrcB++), 16);
*pDst++ = (q15_t) __SSAT(((q31_t) *pSrcA++ - *pSrcB++), 16);
#endif
/* 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 */
/* Subtract and store result in destination buffer. */
#if defined (ARM_MATH_DSP)
*pDst++ = (q15_t) __QSUB16(*pSrcA++, *pSrcB++);
#else
*pDst++ = (q15_t) __SSAT(((q31_t) *pSrcA++ - *pSrcB++), 16);
#endif
/* Decrement loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_420AD3", "function_addr": 4328147, "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_420B7E"], [9, "mov rax, [rbp+var_28]"], [10, "lea rdx, [rax+2]"], [11, "mov [rbp+var_28], rdx"], [12, "movzx eax, word ptr [rax]"], [13, "movsx ecx, ax"], [14, "mov rax, [rbp+var_30]"], [15, "lea rdx, [rax+2]"], [16, "mov [rbp+var_30], rdx"], [17, "movzx eax, word ptr [rax]"], [18, "movsx edx, ax"], [19, "mov eax, ecx"], [20, "sub eax, edx"], [21, "mov [rbp+var_8], eax"], [22, "mov [rbp+var_C], 10h"], [23, "cmp [rbp+var_C], 0"], [24, "jz short loc_420B68"], [25, "cmp [rbp+var_C], 20h "], [26, "ja short loc_420B68"], [27, "mov eax, [rbp+var_C]"], [28, "sub eax, 1"], [29, "mov edx, 1"], [30, "mov ecx, eax"], [31, "shl edx, cl"], [32, "mov eax, edx"], [33, "sub eax, 1"], [34, "mov [rbp+var_10], eax"], [35, "mov eax, [rbp+var_10]"], [36, "not eax"], [37, "mov [rbp+var_14], eax"], [38, "mov eax, [rbp+var_8]"], [39, "cmp eax, [rbp+var_10]"], [40, "jle short loc_420B5B"], [41, "mov eax, [rbp+var_10]"], [42, "jmp short loc_420B6B"], [43, "mov eax, [rbp+var_8]"], [44, "cmp eax, [rbp+var_14]"], [45, "jge short loc_420B68"], [46, "mov eax, [rbp+var_14]"], [47, "jmp short loc_420B6B"], [48, "mov eax, [rbp+var_8]"], [49, "mov rdx, [rbp+var_38]"], [50, "lea rcx, [rdx+2]"], [51, "mov [rbp+var_38], rcx"], [52, "mov [rdx], ax"], [53, "sub [rbp+var_4], 1"], [54, "cmp [rbp+var_4], 0"], [55, "jnz loc_420AF1"], [56, "nop"], [57, "nop"], [58, "pop rbp"], [59, "retn"]], "data_dep": [[6, 5], [7, 6], [9, 2], [9, 11], [10, 49], [10, 52], [10, 9], [11, 10], [12, 52], [12, 9], [13, 12], [14, 16], [14, 3], [15, 14], [15, 10], [15, 52], [16, 15], [17, 52], [17, 14], [18, 17], [19, 13], [20, 19], [20, 18], [21, 20], [23, 22], [24, 23], [25, 22], [26, 25], [27, 22], [28, 27], [30, 28], [31, 29], [31, 30], [32, 31], [33, 32], [34, 33], [35, 34], [36, 35], [37, 36], [38, 21], [39, 38], [39, 34], [40, 39], [41, 34], [43, 21], [44, 37], [44, 43], [45, 44], [46, 37], [48, 21], [49, 4], [49, 51], [50, 49], [50, 52], [50, 30], [50, 13], [51, 50], [52, 49], [52, 46], [52, 48], [52, 41], [53, 53], [53, 7], [54, 7], [54, 53], [55, 54], [58, 0], [59, 6], [59, 48], [59, 41], [59, 46]]}
| {"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_420AD3", "query": "\n\n\n__int64 __fastcall sub_420AD3(__int16 *a1, __int16 *a2, _WORD *a3, unsigned int a4)\n{\n__int64 result; // rax\n__int16 *v5; // rax\nint v6; // ecx\n__int16 *v7; // rax\n_WORD *v8; // rdx\nint v12; // [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 = v6 - *v7;\nif ( v12 <= 0x7FFF )\n{\nif ( v12 >= -32768 )\nresult = (unsigned int)v12;\nelse\nresult = 4294934528LL;\n}\nelse\n{\nresult = 0x7FFFLL;\n}\nv8 = a3++;\n*v8 = result;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_420AD3,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'blockSize', 'a1': 'pSrcA', 'a2': 'pSrcB', 'sub_420AD3': 'arm_sub_q15'}"} | [
[
0.7804759740829468,
0.7700895667076111,
0.7303394079208374,
0.7173275351524353,
0.7151665091514587,
0.7138969302177429,
0.7120121121406555,
0.7119272947311401,
0.7037228345870972,
0.7019847631454468,
0.6983575820922852,
0.6971371173858643,
0.6965185403823853,
0.6933766603469849,
0.6919198036193848,
0.6918086409568787,
0.6877902746200562,
0.6857894062995911,
0.68421870470047,
0.6841299533843994
],
[
178629,
219565,
130331,
89719,
31104,
173802,
8723,
195528,
49146,
45839,
172592,
729,
57536,
205548,
208893,
26336,
87976,
239991,
206681,
33479
]
] |
|
histo_find_bucket_idx | ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9 | google | neper | NA | static int histo_find_bucket_idx(struct histo_impl *impl, int ticks)
{
int l_idx = 0;
int r_idx = impl->num_buckets - 1;
if (ticks > impl->ceil[r_idx])
return r_idx;
while (l_idx <= r_idx) {
int idx = (l_idx + r_idx) / 2;
if (impl->ceil[idx] < ticks) {
l_idx = idx + 1;
} else {
if (idx == 0)
return idx;
else if (impl->ceil[idx -1] < ticks)
return idx;
else
r_idx = idx - 1;
}
}
return -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40C482", "function_addr": 4244610, "binary_name": "ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.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 rax, [rbp+var_18]"], [6, "mov eax, [rax+60h]"], [7, "sub eax, 1"], [8, "mov [rbp+var_8], eax"], [9, "mov rax, [rbp+var_18]"], [10, "mov rdx, [rax+68h]"], [11, "mov eax, [rbp+var_8]"], [12, "cdqe"], [13, "shl rax, 2"], [14, "add rax, rdx"], [15, "mov eax, [rax]"], [16, "cmp [rbp+var_1C], eax"], [17, "jle short loc_40C533"], [18, "mov eax, [rbp+var_8]"], [19, "jmp short loc_40C540"], [20, "mov edx, [rbp+var_4]"], [21, "mov eax, [rbp+var_8]"], [22, "add eax, edx"], [23, "mov edx, eax"], [24, "shr edx, 1Fh"], [25, "add eax, edx"], [26, "sar eax, 1"], [27, "mov [rbp+var_C], eax"], [28, "mov rax, [rbp+var_18]"], [29, "mov rdx, [rax+68h]"], [30, "mov eax, [rbp+var_C]"], [31, "cdqe"], [32, "shl rax, 2"], [33, "add rax, rdx"], [34, "mov eax, [rax]"], [35, "cmp [rbp+var_1C], eax"], [36, "jle short loc_40C4FB"], [37, "mov eax, [rbp+var_C]"], [38, "add eax, 1"], [39, "mov [rbp+var_4], eax"], [40, "jmp short loc_40C533"], [41, "cmp [rbp+var_C], 0"], [42, "jnz short loc_40C506"], [43, "mov eax, [rbp+var_C]"], [44, "jmp short loc_40C540"], [45, "mov rax, [rbp+var_18]"], [46, "mov rdx, [rax+68h]"], [47, "mov eax, [rbp+var_C]"], [48, "cdqe"], [49, "shl rax, 2"], [50, "sub rax, 4"], [51, "add rax, rdx"], [52, "mov eax, [rax]"], [53, "cmp [rbp+var_1C], eax"], [54, "jle short loc_40C52A"], [55, "mov eax, [rbp+var_C]"], [56, "jmp short loc_40C540"], [57, "mov eax, [rbp+var_C]"], [58, "sub eax, 1"], [59, "mov [rbp+var_8], eax"], [60, "mov eax, [rbp+var_4]"], [61, "cmp eax, [rbp+var_8]"], [62, "jle short loc_40C4C1"], [63, "mov eax, 0FFFFFFFFh"], [64, "pop rbp"], [65, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 7], [9, 2], [10, 9], [11, 8], [13, 11], [14, 10], [14, 13], [15, 14], [16, 3], [16, 15], [17, 16], [18, 8], [20, 4], [20, 39], [21, 8], [21, 59], [22, 20], [22, 21], [23, 22], [24, 23], [25, 22], [25, 24], [26, 25], [27, 26], [28, 2], [29, 28], [30, 27], [32, 30], [33, 29], [33, 32], [34, 33], [35, 34], [35, 3], [36, 35], [37, 27], [38, 37], [39, 38], [41, 27], [42, 41], [43, 27], [45, 2], [46, 45], [47, 27], [49, 47], [50, 49], [51, 50], [51, 46], [52, 51], [53, 52], [53, 3], [54, 53], [55, 27], [57, 27], [58, 57], [59, 58], [60, 4], [60, 39], [61, 60], [61, 8], [61, 59], [62, 61], [64, 0], [65, 43], [65, 55], [65, 18], [65, 63]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9_ea3bd53d96d062503f598c950b2c1cf5a92a7d52c2415be8506bc4bcf620e6a9.jsonl.gz", "strip_func_name": "sub_40C482", "query": "\n\n\n__int64 __fastcall sub_40C482(__int64 a1, int a2)\n{\nint v3; // [rsp+10h] [rbp-Ch]\nint v4; // [rsp+14h] [rbp-8h]\nint v5; // [rsp+18h] [rbp-4h]\n\nv5 = 0;\nv4 = *(_DWORD *)(a1 + 96) - 1;\nif ( a2 > *(_DWORD *)(*(_QWORD *)(a1 + 104) + 4LL * v4) )\nreturn (unsigned int)v4;\nwhile ( v5 <= v4 )\n{\nv3 = (v5 + v4) / 2;\nif ( a2 <= *(_DWORD *)(*(_QWORD *)(a1 + 104) + 4LL * v3) )\n{\nif ( !v3 )\nreturn 0LL;\nif ( a2 > *(_DWORD *)(*(_QWORD *)(a1 + 104) + 4LL * v3 - 4) )\nreturn (unsigned int)v3;\nv4 = v3 - 1;\n}\nelse\n{\nv5 = v3 + 1;\n}\n}\nreturn 0xFFFFFFFFLL;\n}\n\n\n\nQ:[a1,a2,v3,v4,v5,sub_40C482,]", "hints": "[]", "response": "{'a1': 'impl', 'a2': 'ticks', 'v3': 'idx', 'v4': 'r_idx', 'v5': 'l_idx', 'sub_40C482': 'histo_find_bucket_idx'}"} | [
[
0.8734809160232544,
0.8614526987075806,
0.8451868295669556,
0.8247798681259155,
0.8092940449714661,
0.796556830406189,
0.7877495288848877,
0.7848204374313354,
0.7836653590202332,
0.777230978012085,
0.7725976705551147,
0.7709851264953613,
0.7676447629928589,
0.7673496007919312,
0.7597293257713318,
0.7588586807250977,
0.7540934681892395,
0.7502279877662659,
0.7476697564125061,
0.7468887567520142
],
[
77221,
91551,
158020,
260159,
81339,
107220,
122957,
205943,
64308,
143648,
73334,
88951,
140500,
150961,
29761,
42967,
51189,
169918,
244132,
22416
]
] |
|
initevents | 3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa | xenogenesi | hidclient | NA | int initevents ( int useonlyone, int mutex11 )
{
int i, j, k;
char buf[sizeof(EVDEVNAME)+8];
char *xinlist = NULL;
FILE *pf;
char *p, *q;
if ( mutex11 )
{
if ( NULL == ( xinlist = malloc ( 4096 ) ) )
{
printf ( "Memory alloc error\n" );
return 0;
}
bzero ( xinlist, 4096 );
if ( NULL != ( pf = popen ("xinput --list --short", "r" ) ) )
{
if ( 1 > fread ( xinlist, 1, 3800, pf ) )
{
printf ( "\tx11-mutable information not available.\n" );
free ( xinlist );
xinlist = NULL;
}
}
fclose ( pf );
}
for ( i = 0; i < MAXEVDEVS; ++i )
{
eventdevs[i] = -1;
x11handles[i] = -1;
}
for ( i = j = 0; j < MAXEVDEVS; ++j )
{
if ( ( useonlyone >= 0 ) && ( useonlyone != j ) ) { continue; }
sprintf ( buf, EVDEVNAME, j );
eventdevs[i] = open ( buf, O_RDONLY );
if ( 0 <= eventdevs[i] )
{
fprintf ( stdout, "Opened %s as event device [counter %d]\n", buf, i );
if ( ( mutex11 > 0 ) && ( xinlist != NULL ) )
{
k = -1;
xinlist[3801] = 0;
if ( ioctl(eventdevs[i], EVIOCGNAME(256),xinlist+3801) >= 0 )
{
p = xinlist;
xinlist[4056] = 0;
if ( strlen(xinlist+3801) < 4 ) // min lenght for name
p = xinlist + 4056;
while ( (*p != 0) &&
( NULL != ( p = strstr ( p, xinlist+3801 ) ) ) )
{
q = p + strlen(xinlist+3801);
while ( *q == ' ' ) ++q;
if ( strncmp ( q, "\tid=", 4 ) == 0 )
{
k = atoi ( q + 4 );
p = xinlist + 4056;
} else {
p = q;
}
}
}
if ( k >= 0 ) {
sprintf ( xinlist+3801, "xinput set-int-prop %d \"Device "\
"Enabled\" 8 0", k );
if ( system ( xinlist + 3801 ) )
{
fprintf ( stderr, "Failed to x11-mute.\n" );
}
x11handles[i] = k;
}
}
++i;
}
}
if ( xinlist != NULL ) { free ( xinlist ); }
return i;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403096", "function_addr": 4206742, "binary_name": "3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_54], edi"], [4, "mov [rbp+var_58], esi"], [5, "mov [rbp+ptr], 0"], [6, "cmp [rbp+var_58], 0"], [7, "jz loc_403183"], [8, "mov edi, 1000h"], [9, "call _malloc"], [10, "mov [rbp+ptr], rax"], [11, "cmp [rbp+ptr], 0"], [12, "jnz short loc_4030DF"], [13, "mov edi, offset s"], [14, "call _puts"], [15, "mov eax, 0"], [16, "jmp locret_403422"], [17, "mov rax, [rbp+ptr]"], [18, "mov ecx, 1000h"], [19, "mov esi, 0"], [20, "mov [rax], rsi"], [21, "mov edx, ecx"], [22, "add rdx, rax"], [23, "add rdx, 8"], [24, "mov [rdx-10h], rsi"], [25, "lea rdx, [rax+8]"], [26, "and rdx, 0FFFFFFFFFFFFFFF8h"], [27, "sub rax, rdx"], [28, "add ecx, eax"], [29, "and ecx, 0FFFFFFF8h"], [30, "mov eax, ecx"], [31, "shr eax, 3"], [32, "mov ecx, eax"], [33, "mov rdi, rdx"], [34, "mov rax, rsi"], [35, "rep stosq"], [36, "mov esi, offset modes"], [37, "mov edi, offset command"], [38, "call _popen"], [39, "mov [rbp+stream], rax"], [40, "cmp [rbp+stream], 0"], [41, "jz short loc_403177"], [42, "mov rdx, [rbp+stream]"], [43, "mov rax, [rbp+ptr]"], [44, "mov rcx, rdx"], [45, "mov edx, 0ED8h"], [46, "mov esi, 1"], [47, "mov rdi, rax"], [48, "call _fread"], [49, "test rax, rax"], [50, "jnz short loc_403177"], [51, "mov edi, offset aX11MutableInfo"], [52, "call _puts"], [53, "mov rax, [rbp+ptr]"], [54, "mov rdi, rax"], [55, "call _free"], [56, "mov [rbp+ptr], 0"], [57, "mov rax, [rbp+stream]"], [58, "mov rdi, rax"], [59, "call _fclose"], [60, "mov [rbp+var_4], 0"], [61, "jmp short loc_4031B0"], [62, "mov eax, [rbp+var_4]"], [63, "cdqe"], [64, "mov ds:fd[rax*4], 0FFFFFFFFh"], [65, "mov eax, [rbp+var_4]"], [66, "cdqe"], [67, "mov ds:dword_4082A0[rax*4], 0FFFFFFFFh"], [68, "add [rbp+var_4], 1"], [69, "cmp [rbp+var_4], 0Fh"], [70, "jle short loc_40318C"], [71, "mov [rbp+var_8], 0"], [72, "mov eax, [rbp+var_8]"], [73, "mov [rbp+var_4], eax"], [74, "jmp loc_403402"], [75, "cmp [rbp+var_54], 0"], [76, "js short loc_4031DA"], [77, "mov eax, [rbp+var_54]"], [78, "cmp eax, [rbp+var_8]"], [79, "jnz loc_4033FD"], [80, "mov edx, [rbp+var_8]"], [81, "lea rax, [rbp+s]"], [82, "mov esi, offset aDevInputEventD"], [83, "mov rdi, rax"], [84, "mov eax, 0"], [85, "call _sprintf"], [86, "lea rax, [rbp+s]"], [87, "mov esi, 0"], [88, "mov rdi, rax"], [89, "mov eax, 0"], [90, "call _open"], [91, "mov edx, [rbp+var_4]"], [92, "movsxd rdx, edx"], [93, "mov ds:fd[rdx*4], eax"], [94, "mov eax, [rbp+var_4]"], [95, "cdqe"], [96, "mov eax, ds:fd[rax*4]"], [97, "test eax, eax"], [98, "js loc_4033FE"], [99, "mov rax, cs:stdout"], [100, "mov ecx, [rbp+var_4]"], [101, "lea rdx, [rbp+s]"], [102, "mov esi, offset aOpenedSAsEvent"], [103, "mov rdi, rax"], [104, "mov eax, 0"], [105, "call _fprintf"], [106, "cmp [rbp+var_58], 0"], [107, "jle loc_4033F7"], [108, "cmp [rbp+ptr], 0"], [109, "jz loc_4033F7"], [110, "mov [rbp+var_C], 0FFFFFFFFh"], [111, "mov rax, [rbp+ptr]"], [112, "add rax, 0ED9h"], [113, "mov byte ptr [rax], 0"], [114, "mov rax, [rbp+ptr]"], [115, "lea rdx, [rax+0ED9h]"], [116, "mov eax, [rbp+var_4]"], [117, "cdqe"], [118, "mov eax, ds:fd[rax*4]"], [119, "mov esi, 81004506h"], [120, "mov edi, eax"], [121, "mov eax, 0"], [122, "call _ioctl"], [123, "test eax, eax"], [124, "js loc_40338C"], [125, "mov rax, [rbp+ptr]"], [126, "mov [rbp+haystack], rax"], [127, "mov rax, [rbp+ptr]"], [128, "add rax, 0FD8h"], [129, "mov byte ptr [rax], 0"], [130, "mov rax, [rbp+ptr]"], [131, "add rax, 0ED9h"], [132, "mov rdi, rax"], [133, "call _strlen"], [134, "cmp rax, 3"], [135, "ja loc_403358"], [136, "mov rax, [rbp+ptr]"], [137, "add rax, 0FD8h"], [138, "mov [rbp+haystack], rax"], [139, "jmp short loc_403358"], [140, "mov rax, [rbp+ptr]"], [141, "add rax, 0ED9h"], [142, "mov rdi, rax"], [143, "call _strlen"], [144, "mov rdx, [rbp+haystack]"], [145, "add rax, rdx"], [146, "mov [rbp+s1], rax"], [147, "jmp short loc_403308"], [148, "add [rbp+s1], 1"], [149, "mov rax, [rbp+s1]"], [150, "movzx eax, byte ptr [rax]"], [151, "cmp al, 20h "], [152, "jz short loc_403303"], [153, "mov rax, [rbp+s1]"], [154, "mov edx, 4"], [155, "mov esi, offset s2"], [156, "mov rdi, rax"], [157, "call _strncmp"], [158, "test eax, eax"], [159, "jnz short loc_403350"], [160, "mov rax, [rbp+s1]"], [161, "add rax, 4"], [162, "mov rdi, rax"], [163, "call _atoi"], [164, "mov [rbp+var_C], eax"], [165, "mov rax, [rbp+ptr]"], [166, "add rax, 0FD8h"], [167, "mov [rbp+haystack], rax"], [168, "jmp short loc_403358"], [169, "mov rax, [rbp+s1]"], [170, "mov [rbp+haystack], rax"], [171, "mov rax, [rbp+haystack]"], [172, "movzx eax, byte ptr [rax]"], [173, "test al, al"], [174, "jz short loc_40338C"], [175, "mov rax, [rbp+ptr]"], [176, "lea rdx, [rax+0ED9h]"], [177, "mov rax, [rbp+haystack]"], [178, "mov rsi, rdx"], [179, "mov rdi, rax"], [180, "call _strstr"], [181, "mov [rbp+haystack], rax"], [182, "cmp [rbp+haystack], 0"], [183, "jnz loc_4032E4"], [184, "cmp [rbp+var_C], 0"], [185, "js short loc_4033F7"], [186, "mov rax, [rbp+ptr]"], [187, "lea rcx, [rax+0ED9h]"], [188, "mov eax, [rbp+var_C]"], [189, "mov edx, eax"], [190, "mov esi, offset aXinputSetIntPr"], [191, "mov rdi, rcx"], [192, "mov eax, 0"], [193, "call _sprintf"], [194, "mov rax, [rbp+ptr]"], [195, "add rax, 0ED9h"], [196, "mov rdi, rax"], [197, "call _system"], [198, "test eax, eax"], [199, "jz short loc_4033E8"], [200, "mov rax, cs:stderr"], [201, "mov rcx, rax"], [202, "mov edx, 14h"], [203, "mov esi, 1"], [204, "mov edi, offset aFailedToX11Mut"], [205, "call _fwrite"], [206, "mov eax, [rbp+var_4]"], [207, "cdqe"], [208, "mov edx, [rbp+var_C]"], [209, "mov ds:dword_4082A0[rax*4], edx"], [210, "add [rbp+var_4], 1"], [211, "jmp short loc_4033FE"], [212, "nop"], [213, "add [rbp+var_8], 1"], [214, "cmp [rbp+var_8], 0Fh"], [215, "jle loc_4031C8"], [216, "cmp [rbp+ptr], 0"], [217, "jz short loc_40341F"], [218, "mov rax, [rbp+ptr]"], [219, "mov rdi, rax"], [220, "call _free"], [221, "mov eax, [rbp+var_4]"], [222, "leave"], [223, "retn"]], "data_dep": [[6, 4], [7, 6], [10, 9], [11, 10], [12, 11], [17, 10], [20, 17], [20, 19], [21, 18], [22, 17], [22, 21], [23, 22], [24, 19], [24, 23], [25, 23], [25, 24], [25, 17], [26, 25], [27, 17], [27, 26], [28, 18], [28, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 26], [34, 19], [39, 38], [40, 39], [41, 40], [42, 39], [43, 10], [44, 42], [47, 43], [49, 48], [50, 49], [53, 10], [54, 53], [57, 39], [58, 57], [62, 60], [62, 68], [65, 60], [65, 68], [68, 68], [68, 60], [69, 60], [69, 68], [70, 69], [72, 71], [73, 72], [75, 3], [76, 75], [77, 3], [78, 77], [78, 213], [78, 71], [79, 78], [80, 213], [80, 71], [81, 206], [81, 105], [81, 123], [81, 77], [81, 180], [81, 173], [81, 72], [81, 97], [83, 81], [86, 85], [88, 86], [91, 73], [91, 210], [92, 91], [93, 90], [94, 73], [94, 210], [96, 64], [97, 96], [98, 97], [100, 73], [100, 210], [101, 92], [103, 99], [106, 4], [107, 106], [108, 56], [108, 10], [108, 5], [109, 108], [111, 10], [111, 5], [111, 56], [112, 111], [113, 112], [114, 56], [114, 10], [114, 5], [115, 114], [115, 113], [115, 101], [116, 73], [116, 210], [118, 64], [120, 118], [123, 122], [124, 123], [125, 56], [125, 10], [125, 5], [126, 125], [127, 56], [127, 10], [127, 5], [128, 127], [129, 128], [130, 10], [130, 5], [130, 56], [131, 130], [132, 131], [134, 133], [135, 134], [136, 56], [136, 10], [136, 5], [137, 136], [138, 137], [140, 56], [140, 10], [140, 5], [141, 140], [142, 141], [144, 181], [145, 144], [145, 143], [146, 145], [148, 146], [148, 148], [149, 146], [149, 148], [150, 20], [150, 24], [150, 129], [150, 113], [150, 149], [151, 150], [152, 151], [153, 146], [153, 148], [156, 153], [158, 157], [159, 158], [160, 146], [160, 148], [161, 160], [162, 161], [164, 163], [165, 56], [165, 10], [165, 5], [166, 165], [167, 166], [169, 146], [169, 148], [170, 169], [171, 138], [171, 170], [171, 126], [171, 167], [172, 20], [172, 24], [172, 129], [172, 113], [172, 171], [173, 172], [174, 173], [175, 10], [175, 5], [175, 56], [176, 20], [176, 24], [176, 175], [176, 129], [176, 113], [176, 115], [176, 154], [177, 126], [177, 167], [177, 138], [177, 170], [178, 176], [179, 177], [181, 180], [182, 181], [183, 182], [184, 110], [184, 164], [185, 184], [186, 56], [186, 10], [186, 5], [187, 100], [187, 20], [187, 24], [187, 129], [187, 113], [187, 186], [188, 110], [188, 164], [189, 188], [191, 187], [194, 56], [194, 10], [194, 5], [195, 194], [196, 195], [198, 197], [199, 198], [201, 200], [206, 210], [206, 73], [208, 164], [208, 110], [209, 208], [210, 73], [210, 210], [213, 71], [213, 213], [214, 213], [214, 71], [215, 214], [216, 56], [216, 10], [216, 5], [217, 216], [218, 56], [218, 10], [218, 5], [219, 218], [221, 73], [221, 210], [223, 221], [223, 15]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa_3e6d13dd7503206dfa7eb466b607f34667ccefb11e3d89949740bcacba75a9aa.jsonl.gz", "strip_func_name": "sub_403096", "query": "\n\n\n__int64 __fastcall sub_403096(int a1, int a2)\n{\n_QWORD *v3; // rax\nint v4; // eax\nsize_t v5; // rax\nchar s[32]; // [rsp+10h] [rbp-50h] BYREF\nFILE *stream; // [rsp+30h] [rbp-30h]\nchar *s1; // [rsp+38h] [rbp-28h]\nchar *haystack; // [rsp+40h] [rbp-20h]\nvoid *ptr; // [rsp+48h] [rbp-18h]\nint v11; // [rsp+54h] [rbp-Ch]\nunsigned int v12; // [rsp+58h] [rbp-8h]\nunsigned int i; // [rsp+5Ch] [rbp-4h]\n\nptr = 0LL;\nif ( a2 )\n{\nptr = malloc(0x1000uLL);\nif ( !ptr )\n{\nputs(\"Memory alloc error\");\nreturn 0LL;\n}\nv3 = ptr;\n*(_QWORD *)ptr = 0LL;\nv3[511] = 0LL;\nmemset(\n(void *)((unsigned __int64)(v3 + 1) & 0xFFFFFFFFFFFFFFF8LL),\n0,\n8LL * ((((_DWORD)v3 - (((_DWORD)v3 + 8) & 0xFFFFFFF8) + 4096) & 0xFFFFFFF8) >> 3));\nstream = popen(\"xinput --list --short\", \"r\");\nif ( stream && !fread(ptr, 1uLL, 0xED8uLL, stream) )\n{\nputs(\"\\tx11-mutable information not available.\");\nfree(ptr);\nptr = 0LL;\n}\nfclose(stream);\n}\nfor ( i = 0; (int)i <= 15; ++i )\n{\nfd[i] = -1;\ndword_4082A0[i] = -1;\n}\nv12 = 0;\ni = 0;\nwhile ( (int)v12 <= 15 )\n{\nif ( a1 < 0 || a1 == v12 )\n{\nsprintf(s, \"/dev/input/event%d\", v12);\nv4 = open(s, 0);\nfd[i] = v4;\nif ( fd[i] >= 0 )\n{\nfprintf(stdout, \"Opened %s as event device [counter %d]\\n\", s, i);\nif ( a2 > 0 && ptr )\n{\nv11 = -1;\n*((_BYTE *)ptr + 3801) = 0;\nif ( ioctl(fd[i], 0x81004506uLL, (char *)ptr + 3801) >= 0 )\n{\nhaystack = (char *)ptr;\n*((_BYTE *)ptr + 4056) = 0;\nif ( strlen((const char *)ptr + 3801) <= 3 )\nhaystack = (char *)ptr + 4056;\nwhile ( *haystack )\n{\nhaystack = strstr(haystack, (const char *)ptr + 3801);\nif ( !haystack )\nbreak;\nv5 = strlen((const char *)ptr + 3801);\nfor ( s1 = &haystack[v5]; *s1 == 32; ++s1 )\n;\nif ( !strncmp(s1, \"\\tid=\", 4uLL) )\n{\nv11 = atoi(s1 + 4);\nhaystack = (char *)ptr + 4056;\n}\nelse\n{\nhaystack = s1;\n}\n}\n}\nif ( v11 >= 0 )\n{\nsprintf((char *)ptr + 3801, \"xinput set-int-prop %d \\\"Device Enabled\\\" 8 0\", (unsigned int)v11);\nif ( system((const char *)ptr + 3801) )\nfwrite(\"Failed to x11-mute.\\n\", 1uLL, 0x14uLL, stderr);\ndword_4082A0[i] = v11;\n}\n}\n++i;\n}\n}\n++v12;\n}\nif ( ptr )\nfree(ptr);\nreturn i;\n}\n\n\n\nQ:[a1,a2,s,stream,s1,haystack,ptr,sub_403096,]", "hints": "[]", "response": "{'a1': 'useonlyone', 'a2': 'mutex11', 's': 'buf', 'stream': 'pf_0', 's1': 'q', 'haystack': 'p', 'ptr': 'xinlist', 'sub_403096': 'initevents'}"} | [
[
0.7809255719184875,
0.7783210873603821,
0.7714917659759521,
0.7676299810409546,
0.7619891166687012,
0.7590961456298828,
0.7491586208343506,
0.7475439310073853,
0.7396841049194336,
0.7396841049194336,
0.7393079996109009,
0.7393079996109009,
0.7393079996109009,
0.7370177507400513,
0.7323188781738281,
0.7321153879165649,
0.7317014932632446,
0.7256676554679871,
0.7235344648361206,
0.7211822867393494
],
[
106698,
23644,
221562,
249030,
110140,
104354,
258410,
248781,
174246,
185126,
220822,
174281,
43768,
104563,
253615,
197131,
238775,
179497,
120809,
373
]
] |
|
m_floor | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static int m_floor(bvm *vm)
{
if (be_top(vm) >= 1 && be_isnumber(vm, 1)) {
breal x = be_toreal(vm, 1);
be_pushreal(vm, mathfunc(floor)(x));
} else {
be_pushreal(vm, (breal)0.0);
}
be_return(vm);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_427700", "function_addr": 4355840, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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 rdi, rax"], [6, "call be_top"], [7, "test eax, eax"], [8, "jle short loc_42776B"], [9, "mov rax, [rbp+var_18]"], [10, "mov esi, 1"], [11, "mov rdi, rax"], [12, "call be_isnumber"], [13, "test al, al"], [14, "jz short loc_42776B"], [15, "mov rax, [rbp+var_18]"], [16, "mov esi, 1"], [17, "mov rdi, rax"], [18, "call be_toreal"], [19, "movd eax, xmm0"], [20, "mov [rbp+x], eax"], [21, "mov eax, [rbp+x]"], [22, "movd xmm0, eax"], [23, "call _floorf"], [24, "movd eax, xmm0"], [25, "mov rdx, [rbp+var_18]"], [26, "movd xmm0, eax"], [27, "mov rdi, rdx"], [28, "call be_pushreal"], [29, "jmp short loc_42777B"], [30, "mov rax, [rbp+var_18]"], [31, "pxor xmm0, xmm0"], [32, "mov rdi, rax"], [33, "call be_pushreal"], [34, "mov rax, [rbp+var_18]"], [35, "mov rdi, rax"], [36, "call be_returnvalue"], [37, "leave"], [38, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 3], [11, 9], [13, 12], [14, 13], [15, 3], [17, 15], [20, 19], [21, 20], [22, 21], [24, 22], [25, 3], [26, 24], [27, 25], [30, 3], [32, 30], [34, 3], [35, 34], [38, 36]]}
| {"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_427700", "query": "\n\n\n__int64 __fastcall sub_427700(__int64 a1, __m128i a2)\n{\n__m128i v2; // xmm0\n\nif ( (int)be_top(a1) > 0 && be_isnumber(a1, 1u) )\n{\na2.m128i_u64[0] = (unsigned __int64)be_toreal(a1, 1u);\nv2 = _mm_cvtsi32_si128(_mm_cvtsi128_si32(a2));\n*(float *)v2.m128i_i32 = floorf(*(float *)v2.m128i_i32);\nbe_pushreal(a1, COERCE_FLOAT(_mm_cvtsi128_si32(v2)));\n}\nelse\n{\nbe_pushreal(a1, 0.0);\n}\nreturn be_returnvalue(a1);\n}\n\n\n\nQ:[a1,sub_427700,]", "hints": "[]", "response": "{'a1': 'vm', 'sub_427700': 'm_floor'}"} | [
[
0.7720024585723877,
0.7705456614494324,
0.7692242860794067,
0.7600740194320679,
0.754504919052124,
0.7544683814048767,
0.7526131272315979,
0.7502527236938477,
0.7501891255378723,
0.7492421865463257,
0.7489977478981018,
0.7484240531921387,
0.7442959547042847,
0.7438368797302246,
0.7427234649658203,
0.7411249279975891,
0.7392889261245728,
0.7389208674430847,
0.7370860576629639,
0.7361831665039062
],
[
47277,
243776,
119522,
29063,
233921,
188973,
127430,
247074,
215476,
137038,
258100,
104708,
123404,
7804,
21993,
241351,
77905,
14015,
259240,
256290
]
] |
|
arm_shift_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_shift_q31(
const q31_t * pSrc,
int8_t shiftBits,
q31_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
uint8_t sign = (shiftBits & 0x80); /* Sign of shiftBits */
#if defined (ARM_MATH_LOOPUNROLL)
q31_t in, out; /* Temporary variables */
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
/* If the shift value is positive then do right shift else left shift */
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A << shiftBits */
/* Shift input and store result in destination buffer. */
in = *pSrc++;
out = in << shiftBits;
if (in != (out >> shiftBits))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
in = *pSrc++;
out = in << shiftBits;
if (in != (out >> shiftBits))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
in = *pSrc++;
out = in << shiftBits;
if (in != (out >> shiftBits))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
in = *pSrc++;
out = in << shiftBits;
if (in != (out >> shiftBits))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A >> shiftBits */
/* Shift input and store results in destination buffer. */
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
/* 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) */
/* If the shift value is positive then do right shift else left shift */
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A << shiftBits */
/* Shift input and store result in destination buffer. */
*pDst++ = clip_q63_to_q31((q63_t) *pSrc++ << shiftBits);
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A >> shiftBits */
/* Shift input and store result in destination buffer. */
*pDst++ = (*pSrc++ >> -shiftBits);
/* Decrement loop counter */
blkCnt--;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4208B3", "function_addr": 4327603, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov eax, esi"], [4, "mov [rbp+var_28], rdx"], [5, "mov [rbp+var_20], ecx"], [6, "mov [rbp+var_1C], al"], [7, "movzx eax, [rbp+var_1C]"], [8, "and eax, 0FFFFFF80h"], [9, "mov [rbp+var_5], al"], [10, "mov eax, [rbp+var_20]"], [11, "mov [rbp+var_4], eax"], [12, "cmp [rbp+var_5], 0"], [13, "jnz loc_420973"], [14, "jmp short loc_42093F"], [15, "mov rax, [rbp+var_18]"], [16, "lea rdx, [rax+4]"], [17, "mov [rbp+var_18], rdx"], [18, "mov eax, [rax]"], [19, "movsxd rdx, eax"], [20, "movsx eax, [rbp+var_1C]"], [21, "mov ecx, eax"], [22, "shl rdx, cl"], [23, "mov rcx, rdx"], [24, "mov rax, [rbp+var_28]"], [25, "lea rdx, [rax+4]"], [26, "mov [rbp+var_28], rdx"], [27, "mov [rbp+var_10], rcx"], [28, "mov rdx, [rbp+var_10]"], [29, "sar rdx, 20h"], [30, "mov ecx, edx"], [31, "mov rdx, [rbp+var_10]"], [32, "sar edx, 1Fh"], [33, "cmp ecx, edx"], [34, "jz short loc_420935"], [35, "mov rdx, [rbp+var_10]"], [36, "sar rdx, 3Fh"], [37, "xor edx, 7FFFFFFFh"], [38, "jmp short loc_420939"], [39, "mov rdx, [rbp+var_10]"], [40, "mov [rax], edx"], [41, "sub [rbp+var_4], 1"], [42, "cmp [rbp+var_4], 0"], [43, "jnz short loc_4208E3"], [44, "jmp short loc_420979"], [45, "mov rax, [rbp+var_18]"], [46, "lea rdx, [rax+4]"], [47, "mov [rbp+var_18], rdx"], [48, "mov esi, [rax]"], [49, "movsx eax, [rbp+var_1C]"], [50, "neg eax"], [51, "mov ecx, eax"], [52, "mov rax, [rbp+var_28]"], [53, "lea rdx, [rax+4]"], [54, "mov [rbp+var_28], rdx"], [55, "sar esi, cl"], [56, "mov edx, esi"], [57, "mov [rax], edx"], [58, "sub [rbp+var_4], 1"], [59, "cmp [rbp+var_4], 0"], [60, "jnz short loc_420947"], [61, "nop"], [62, "pop rbp"], [63, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 5], [11, 10], [12, 9], [13, 12], [15, 2], [15, 17], [16, 40], [16, 15], [16, 37], [16, 39], [17, 16], [18, 40], [18, 15], [19, 18], [20, 6], [21, 20], [22, 19], [22, 21], [23, 22], [24, 26], [24, 4], [25, 22], [25, 40], [25, 24], [26, 25], [27, 23], [28, 27], [29, 28], [30, 29], [31, 27], [32, 31], [33, 30], [33, 32], [34, 33], [35, 27], [36, 35], [37, 36], [39, 27], [40, 24], [40, 37], [40, 39], [41, 11], [41, 41], [42, 11], [42, 41], [43, 42], [45, 2], [45, 47], [46, 57], [46, 45], [46, 56], [47, 46], [48, 45], [48, 57], [49, 6], [50, 49], [51, 50], [52, 4], [52, 54], [53, 57], [53, 52], [53, 46], [54, 53], [55, 51], [55, 48], [56, 55], [57, 52], [57, 56], [58, 58], [58, 11], [59, 11], [59, 58], [60, 59], [62, 0], [63, 52], [63, 24], [63, 10]]}
| {"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_4208B3", "query": "\n\n\nint *__fastcall sub_4208B3(int *a1, char a2, int *a3, unsigned int a4)\n{\nint *result; // rax\nint *v5; // rax\n__int64 v6; // rcx\nint v7; // edx\nint *v8; // rax\nint v9; // esi\nunsigned int v13; // [rsp+24h] [rbp-4h]\n\nresult = (int *)a4;\nv13 = a4;\nif ( a2 < 0 )\n{\nwhile ( v13 )\n{\nv8 = a1++;\nv9 = *v8;\nresult = a3++;\n*result = v9 >> -a2;\n--v13;\n}\n}\nelse\n{\nwhile ( v13 )\n{\nv5 = a1++;\nv6 = (__int64)*v5 << a2;\nresult = a3++;\nif ( HIDWORD(v6) == (int)v6 >> 31 )\nv7 = v6;\nelse\nv7 = (v6 >> 63) ^ 0x7FFFFFFF;\n*result = v7;\n--v13;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_4208B3,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'blockSize', 'a1': 'pSrc', 'a2': 'shiftBits', 'sub_4208B3': 'arm_shift_q31'}"} | [
[
0.7848107814788818,
0.7774169445037842,
0.7767605781555176,
0.7727305293083191,
0.7691549062728882,
0.7524033188819885,
0.7484210133552551,
0.7444512844085693,
0.7444254755973816,
0.7442307472229004,
0.7407383918762207,
0.7398311495780945,
0.7368437051773071,
0.7347360253334045,
0.7347168326377869,
0.7338364720344543,
0.7321130633354187,
0.7320061326026917,
0.7278441190719604,
0.7272427678108215
],
[
124693,
68407,
249276,
125098,
183541,
21251,
34826,
206995,
228553,
93701,
114330,
151505,
14103,
152979,
114037,
198916,
246259,
137599,
255306,
68972
]
] |
|
ConvertInt64 | b076f0bb06e40e2fe065406d56d85693a7c9c8682f0f249bacedec3ccebf055f | InfiniTimeOrg | InfiniTime | NA | static QCBORError
ConvertInt64(const QCBORItem *pItem, uint32_t uConvertTypes, int64_t *pnValue)
{
switch(pItem->uDataType) {
case QCBOR_TYPE_FLOAT:
case QCBOR_TYPE_DOUBLE:
#ifndef QCBOR_DISABLE_FLOAT_HW_USE
if(uConvertTypes & QCBOR_CONVERT_TYPE_FLOAT) {
/* https://pubs.opengroup.org/onlinepubs/009695399/functions/llround.html
http://www.cplusplus.com/reference/cmath/llround/
*/
// Not interested in FE_INEXACT
feclearexcept(FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW|FE_DIVBYZERO);
if(pItem->uDataType == QCBOR_TYPE_DOUBLE) {
*pnValue = llround(pItem->val.dfnum);
} else {
*pnValue = lroundf(pItem->val.fnum);
}
if(fetestexcept(FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW|FE_DIVBYZERO)) {
// llround() shouldn't result in divide by zero, but catch
// it here in case it unexpectedly does. Don't try to
// distinguish between the various exceptions because it seems
// they vary by CPU, compiler and OS.
return QCBOR_ERR_FLOAT_EXCEPTION;
}
} else {
return QCBOR_ERR_UNEXPECTED_TYPE;
}
#else
return QCBOR_ERR_HW_FLOAT_DISABLED;
#endif /* QCBOR_DISABLE_FLOAT_HW_USE */
break;
case QCBOR_TYPE_INT64:
if(uConvertTypes & QCBOR_CONVERT_TYPE_XINT64) {
*pnValue = pItem->val.int64;
} else {
return QCBOR_ERR_UNEXPECTED_TYPE;
}
break;
case QCBOR_TYPE_UINT64:
if(uConvertTypes & QCBOR_CONVERT_TYPE_XINT64) {
if(pItem->val.uint64 < INT64_MAX) {
*pnValue = pItem->val.int64;
} else {
return QCBOR_ERR_CONVERSION_UNDER_OVER_FLOW;
}
} else {
return QCBOR_ERR_UNEXPECTED_TYPE;
}
break;
default:
return QCBOR_ERR_UNEXPECTED_TYPE;
}
return QCBOR_SUCCESS;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_423061", "function_addr": 4337761, "binary_name": "b076f0bb06e40e2fe065406d56d85693a7c9c8682f0f249bacedec3ccebf055f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov [rbp+var_C], esi"], [5, "mov [rbp+var_18], rdx"], [6, "mov rax, [rbp+var_8]"], [7, "movzx eax, byte ptr [rax]"], [8, "movzx eax, al"], [9, "cmp eax, 1Bh"], [10, "jg loc_42316E"], [11, "cmp eax, 1Ah"], [12, "jge short loc_42309F"], [13, "cmp eax, 2"], [14, "jz short loc_42310C"], [15, "cmp eax, 3"], [16, "jz loc_42312E"], [17, "jmp loc_42316E"], [18, "mov eax, [rbp+var_C]"], [19, "and eax, 2"], [20, "test eax, eax"], [21, "jz short loc_423105"], [22, "mov edi, 1Dh"], [23, "call _feclearexcept"], [24, "mov rax, [rbp+var_8]"], [25, "movzx eax, byte ptr [rax]"], [26, "cmp al, 1Bh"], [27, "jnz short loc_4230D9"], [28, "mov rax, [rbp+var_8]"], [29, "mov rax, [rax+8]"], [30, "movq xmm0, rax"], [31, "call _llround"], [32, "mov rdx, [rbp+var_18]"], [33, "mov [rdx], rax"], [34, "jmp short loc_4230F0"], [35, "mov rax, [rbp+var_8]"], [36, "mov eax, [rax+8]"], [37, "movd xmm0, eax"], [38, "call _lroundf"], [39, "mov rdx, [rbp+var_18]"], [40, "mov [rdx], rax"], [41, "mov edi, 1Dh"], [42, "call _fetestexcept"], [43, "test eax, eax"], [44, "jz short loc_423175"], [45, "mov eax, 2Ah "], [46, "jmp short locret_42317B"], [47, "mov eax, 1Ah"], [48, "jmp short locret_42317B"], [49, "mov eax, [rbp+var_C]"], [50, "and eax, 1"], [51, "test eax, eax"], [52, "jz short loc_423127"], [53, "mov rax, [rbp+var_8]"], [54, "mov rdx, [rax+8]"], [55, "mov rax, [rbp+var_18]"], [56, "mov [rax], rdx"], [57, "jmp short loc_423176"], [58, "mov eax, 1Ah"], [59, "jmp short locret_42317B"], [60, "mov eax, [rbp+var_C]"], [61, "and eax, 1"], [62, "test eax, eax"], [63, "jz short loc_423167"], [64, "mov rax, [rbp+var_8]"], [65, "mov rax, [rax+8]"], [66, "mov rdx, 7FFFFFFFFFFFFFFEh"], [67, "cmp rax, rdx"], [68, "ja short loc_423160"], [69, "mov rax, [rbp+var_8]"], [70, "mov rdx, [rax+8]"], [71, "mov rax, [rbp+var_18]"], [72, "mov [rax], rdx"], [73, "jmp short loc_423176"], [74, "mov eax, 24h "], [75, "jmp short locret_42317B"], [76, "mov eax, 1Ah"], [77, "jmp short locret_42317B"], [78, "mov eax, 1Ah"], [79, "jmp short locret_42317B"], [80, "nop"], [81, "mov eax, 0"], [82, "leave"], [83, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 9], [11, 8], [12, 11], [13, 8], [14, 13], [15, 8], [16, 15], [18, 4], [19, 18], [20, 19], [21, 20], [24, 3], [25, 24], [26, 25], [27, 26], [28, 3], [29, 28], [30, 29], [32, 5], [33, 32], [33, 31], [35, 3], [36, 35], [37, 36], [39, 5], [40, 38], [40, 39], [43, 42], [44, 43], [49, 4], [50, 49], [51, 50], [52, 51], [53, 3], [54, 53], [55, 5], [56, 55], [56, 54], [60, 4], [61, 60], [62, 61], [63, 62], [64, 3], [65, 64], [67, 65], [67, 66], [68, 67], [69, 3], [70, 69], [71, 5], [72, 71], [72, 70], [83, 58], [83, 76], [83, 45], [83, 78], [83, 81], [83, 47], [83, 74]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b076f0bb06e40e2fe065406d56d85693a7c9c8682f0f249bacedec3ccebf055f_b076f0bb06e40e2fe065406d56d85693a7c9c8682f0f249bacedec3ccebf055f.jsonl.gz", "strip_func_name": "sub_423061", "query": "\n\n\n__int64 __fastcall sub_423061(double *a1, char a2, __int64 *a3)\n{\nunsigned int v3; // eax\n__int64 v4; // rax\n\nv3 = *(unsigned __int8 *)a1;\nif ( v3 > 0x1B )\nreturn 26LL;\nif ( *(unsigned __int8 *)a1 >= 0x1Au )\n{\nif ( (a2 & 2) == 0 )\nreturn 26LL;\nfeclearexcept(29);\nif ( *(_BYTE *)a1 == 27 )\nv4 = llround(a1[1]);\nelse\nv4 = lroundf(*((float *)a1 + 2));\n*a3 = v4;\nif ( fetestexcept(29) )\nreturn 42LL;\n}\nelse if ( v3 == 2 )\n{\nif ( (a2 & 1) == 0 )\nreturn 26LL;\n*a3 = *((_QWORD *)a1 + 1);\n}\nelse\n{\nif ( v3 != 3 )\nreturn 26LL;\nif ( (a2 & 1) == 0 )\nreturn 26LL;\nif ( *((_QWORD *)a1 + 1) > 0x7FFFFFFFFFFFFFFEuLL )\nreturn 36LL;\n*a3 = *((_QWORD *)a1 + 1);\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,sub_423061,]", "hints": "[]", "response": "{'a3': 'pnValue', 'a1': 'pItem', 'a2': 'uConvertTypes', 'sub_423061': 'ConvertInt64'}"} | [
[
0.742625892162323,
0.7360439300537109,
0.7236381769180298,
0.7039607763290405,
0.7024605870246887,
0.6981692910194397,
0.6976306438446045,
0.6934143304824829,
0.6931326985359192,
0.6925926804542542,
0.6920459866523743,
0.6898818016052246,
0.6843640804290771,
0.6840168237686157,
0.6813465356826782,
0.6806613802909851,
0.6800045967102051,
0.678413987159729,
0.6624560356140137,
0.6610006093978882
],
[
251775,
199708,
227173,
129851,
7640,
36090,
143392,
199852,
222558,
223026,
224205,
104326,
234107,
255246,
168777,
91969,
189506,
5831,
11908,
52760
]
] |
|
ros_sentence_add | 163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad | haakonnessjoen | librouteros-api | NA | void ros_sentence_add(struct ros_sentence *sentence, char *word) {
if ((sentence->words+1) / 100 > sentence->words / 100) {
sentence->word = realloc(sentence->word, sizeof(char *) * ((((sentence->words+1)/100) + 1)*100));
if (sentence->word == NULL) {
fprintf(stderr, "Error allocating memory\n");
exit(1);
}
}
sentence->word[sentence->words] = strdup(word);
if (sentence->word[sentence->words] == NULL) {
fprintf(stderr, "Error allocating memory\n");
exit(1);
}
sentence->words++;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40284A", "function_addr": 4204618, "binary_name": "163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 18h"], [4, "mov [rbp+var_18], rdi"], [5, "mov [rbp+s], rsi"], [6, "mov rax, [rbp+var_18]"], [7, "mov eax, [rax+8]"], [8, "add eax, 1"], [9, "movsxd rdx, eax"], [10, "imul rdx, 51EB851Fh"], [11, "shr rdx, 20h"], [12, "sar edx, 5"], [13, "sar eax, 1Fh"], [14, "mov ecx, edx"], [15, "sub ecx, eax"], [16, "mov rax, [rbp+var_18]"], [17, "mov eax, [rax+8]"], [18, "movsxd rdx, eax"], [19, "imul rdx, 51EB851Fh"], [20, "shr rdx, 20h"], [21, "sar edx, 5"], [22, "sar eax, 1Fh"], [23, "mov esi, eax"], [24, "mov eax, edx"], [25, "sub eax, esi"], [26, "cmp ecx, eax"], [27, "jle loc_402927"], [28, "mov rax, [rbp+var_18]"], [29, "mov eax, [rax+8]"], [30, "add eax, 1"], [31, "movsxd rdx, eax"], [32, "imul rdx, 51EB851Fh"], [33, "shr rdx, 20h"], [34, "sar edx, 5"], [35, "sar eax, 1Fh"], [36, "mov ecx, eax"], [37, "mov eax, edx"], [38, "sub eax, ecx"], [39, "add eax, 1"], [40, "imul eax, 64h "], [41, "cdqe"], [42, "lea rdx, ds:0[rax*8]"], [43, "mov rax, [rbp+var_18]"], [44, "mov rax, [rax]"], [45, "mov rsi, rdx"], [46, "mov rdi, rax"], [47, "call _realloc"], [48, "mov rdx, [rbp+var_18]"], [49, "mov [rdx], rax"], [50, "mov rax, [rbp+var_18]"], [51, "mov rax, [rax]"], [52, "test rax, rax"], [53, "jnz short loc_402927"], [54, "mov rax, cs:stderr"], [55, "mov rcx, rax"], [56, "mov edx, 18h"], [57, "mov esi, 1"], [58, "mov edi, offset aErrorAllocatin_0"], [59, "call _fwrite"], [60, "mov edi, 1"], [61, "call _exit"], [62, "mov rax, [rbp+var_18]"], [63, "mov rdx, [rax]"], [64, "mov rax, [rbp+var_18]"], [65, "mov eax, [rax+8]"], [66, "cdqe"], [67, "shl rax, 3"], [68, "lea rbx, [rdx+rax]"], [69, "mov rax, [rbp+s]"], [70, "mov rdi, rax"], [71, "call _strdup"], [72, "mov [rbx], rax"], [73, "mov rax, [rbp+var_18]"], [74, "mov rdx, [rax]"], [75, "mov rax, [rbp+var_18]"], [76, "mov eax, [rax+8]"], [77, "cdqe"], [78, "shl rax, 3"], [79, "add rax, rdx"], [80, "mov rax, [rax]"], [81, "test rax, rax"], [82, "jnz short loc_402995"], [83, "mov rax, cs:stderr"], [84, "mov rcx, rax"], [85, "mov edx, 18h"], [86, "mov esi, 1"], [87, "mov edi, offset aErrorAllocatin_0"], [88, "call _fwrite"], [89, "mov edi, 1"], [90, "call _exit"], [91, "mov rax, [rbp+var_18]"], [92, "mov eax, [rax+8]"], [93, "lea edx, [rax+1]"], [94, "mov rax, [rbp+var_18]"], [95, "mov [rax+8], edx"], [96, "nop"], [97, "mov rbx, [rbp+var_8]"], [98, "leave"], [99, "retn"]], "data_dep": [[6, 4], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 8], [14, 12], [15, 14], [15, 13], [16, 4], [17, 16], [18, 17], [19, 18], [20, 19], [21, 20], [22, 17], [23, 22], [24, 21], [25, 23], [25, 24], [26, 25], [26, 15], [27, 26], [28, 4], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [34, 33], [35, 30], [36, 35], [37, 34], [38, 36], [38, 37], [39, 38], [40, 39], [42, 34], [43, 4], [44, 43], [45, 42], [46, 44], [48, 4], [49, 48], [49, 47], [50, 4], [51, 50], [51, 49], [52, 51], [53, 52], [55, 54], [62, 4], [63, 49], [63, 72], [63, 62], [64, 4], [65, 72], [65, 49], [65, 64], [67, 65], [68, 72], [68, 49], [68, 67], [69, 5], [70, 69], [72, 68], [72, 71], [73, 4], [74, 73], [74, 72], [75, 4], [76, 72], [76, 75], [78, 76], [79, 74], [79, 78], [80, 79], [80, 72], [81, 80], [82, 81], [84, 83], [91, 4], [92, 72], [92, 91], [92, 95], [92, 49], [93, 72], [93, 74], [93, 95], [93, 49], [93, 92], [94, 4], [95, 93], [95, 94], [99, 94]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad_163ae97d33eec22b47ee6ffb39d267f44b312fa1a7ee6c73b807e64d10b38cad.jsonl.gz", "strip_func_name": "sub_40284A", "query": "\n\n\n__int64 __fastcall sub_40284A(__int64 a1, const char *a2)\n{\nchar **v2; // rbx\n__int64 result; // rax\n\nif ( (*(_DWORD *)(a1 + 8) + 1) / 100 > *(_DWORD *)(a1 + 8) / 100 )\n{\n*(_QWORD *)a1 = realloc(*(void **)a1, 800LL * ((*(_DWORD *)(a1 + 8) + 1) / 100 + 1));\nif ( !*(_QWORD *)a1 )\n{\nfwrite(\"Error allocating memory\\n\", 1uLL, 0x18uLL, stderr);\nexit(1);\n}\n}\nv2 = (char **)(*(_QWORD *)a1 + 8LL * *(int *)(a1 + 8));\n*v2 = strdup(a2);\nif ( !*(_QWORD *)(*(_QWORD *)a1 + 8LL * *(int *)(a1 + 8)) )\n{\nfwrite(\"Error allocating memory\\n\", 1uLL, 0x18uLL, stderr);\nexit(1);\n}\nresult = a1;\n++*(_DWORD *)(a1 + 8);\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_40284A,]", "hints": "[]", "response": "{'a1': 'sentence', 'a2': 'word', 'sub_40284A': 'ros_sentence_add'}"} | [
[
0.7341817021369934,
0.7312861680984497,
0.730244517326355,
0.7249330878257751,
0.7090755701065063,
0.6998739838600159,
0.6972489953041077,
0.6897023916244507,
0.6833217740058899,
0.6810281276702881,
0.6801174879074097,
0.6760389804840088,
0.67508864402771,
0.6750216484069824,
0.6705141067504883,
0.6703362464904785,
0.6644332408905029,
0.6639088988304138,
0.6619390249252319,
0.6606332063674927
],
[
100564,
246026,
21928,
263977,
131603,
203457,
20869,
191772,
39870,
201925,
25707,
213313,
180052,
49976,
208176,
204932,
28466,
99430,
12469,
239004
]
] |
|
is_valid_directory_entry | 0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6 | kieselsteini | cgo | NA | int is_valid_directory_entry(const char *line)
{
switch (line[0]) {
case 'i':
case '3':
case '.': /* some gopher servers use this */
case '0':
case '1':
case '5':
case '7':
case '8':
case '9':
case 'g':
case 'I':
case 'p':
case 'h':
case 's':
return 1;
default:
return 0;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4023B9", "function_addr": 4203449, "binary_name": "0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov rax, [rbp+var_8]"], [4, "movzx eax, byte ptr [rax]"], [5, "movsx eax, al"], [6, "sub eax, 2Eh "], [7, "cmp eax, 45h"], [8, "ja short def_4023DD"], [9, "mov eax, eax"], [10, "mov rax, ds:jpt_4023DD[rax*8]"], [11, "jmp rax"], [12, "mov eax, 1"], [13, "jmp short loc_4023EB"], [14, "mov eax, 0"], [15, "pop rbp"], [16, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 6], [11, 10], [15, 0], [16, 12], [16, 14]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6_0fbc58241bca249679cdd25995b125d62bcff539de5a54707f26ed6c17c31db6.jsonl.gz", "strip_func_name": "sub_4023B9", "query": "\n\n\n__int64 __fastcall sub_4023B9(_BYTE *a1)\n{\n__int64 result; // rax\n\nswitch ( *a1 )\n{\ncase '.':\ncase '0':\ncase '1':\ncase '3':\ncase '5':\ncase '7':\ncase '8':\ncase '9':\ncase 'I':\ncase 'g':\ncase 'h':\ncase 'i':\ncase 'p':\ncase 's':\nresult = 1LL;\nbreak;\ndefault:\nresult = 0LL;\nbreak;\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_4023B9,]", "hints": "[]", "response": "{'a1': 'line', 'sub_4023B9': 'is_valid_directory_entry'}"} | [
[
0.8622004985809326,
0.7873725295066833,
0.7707428932189941,
0.7692387700080872,
0.7683282494544983,
0.7681896686553955,
0.7674379348754883,
0.7646094560623169,
0.7581081390380859,
0.7570550441741943,
0.7532904148101807,
0.748279333114624,
0.7477996349334717,
0.7475619316101074,
0.7473249435424805,
0.7468361854553223,
0.7428734302520752,
0.7426214218139648,
0.740524172782898,
0.735532820224762
],
[
123276,
40973,
21536,
59822,
194125,
240699,
55899,
45320,
191938,
15845,
151053,
60805,
120679,
228410,
251080,
61907,
56055,
222027,
252567,
142336
]
] |
|
arm_shift_q15 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_shift_q15(
const q15_t * pSrc,
int8_t shiftBits,
q15_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
uint8_t sign = (shiftBits & 0x80); /* Sign of shiftBits */
#if defined (ARM_MATH_LOOPUNROLL)
#if defined (ARM_MATH_DSP)
q15_t in1, in2; /* Temporary input variables */
#endif
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
/* If the shift value is positive then do right shift else left shift */
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A << shiftBits */
#if defined (ARM_MATH_DSP)
/* read 2 samples from source */
in1 = *pSrc++;
in2 = *pSrc++;
/* Shift the inputs and then store the results in the destination buffer. */
#ifndef ARM_MATH_BIG_ENDIAN
write_q15x2_ia (&pDst, __PKHBT(__SSAT((in1 << shiftBits), 16),
__SSAT((in2 << shiftBits), 16), 16));
#else
write_q15x2_ia (&pDst, __PKHBT(__SSAT((in2 << shiftBits), 16),
__SSAT((in1 << shiftBits), 16), 16));
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
/* read 2 samples from source */
in1 = *pSrc++;
in2 = *pSrc++;
#ifndef ARM_MATH_BIG_ENDIAN
write_q15x2_ia (&pDst, __PKHBT(__SSAT((in1 << shiftBits), 16),
__SSAT((in2 << shiftBits), 16), 16));
#else
write_q15x2_ia (&pDst, __PKHBT(__SSAT((in2 << shiftBits), 16),
__SSAT((in1 << shiftBits), 16), 16));
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
#else
*pDst++ = __SSAT(((q31_t) *pSrc++ << shiftBits), 16);
*pDst++ = __SSAT(((q31_t) *pSrc++ << shiftBits), 16);
*pDst++ = __SSAT(((q31_t) *pSrc++ << shiftBits), 16);
*pDst++ = __SSAT(((q31_t) *pSrc++ << shiftBits), 16);
#endif
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A >> shiftBits */
#if defined (ARM_MATH_DSP)
/* read 2 samples from source */
in1 = *pSrc++;
in2 = *pSrc++;
/* Shift the inputs and then store the results in the destination buffer. */
#ifndef ARM_MATH_BIG_ENDIAN
write_q15x2_ia (&pDst, __PKHBT((in1 >> -shiftBits),
(in2 >> -shiftBits), 16));
#else
write_q15x2_ia (&pDst, __PKHBT((in2 >> -shiftBits),
(in1 >> -shiftBits), 16));
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
/* read 2 samples from source */
in1 = *pSrc++;
in2 = *pSrc++;
#ifndef ARM_MATH_BIG_ENDIAN
write_q15x2_ia (&pDst, __PKHBT((in1 >> -shiftBits),
(in2 >> -shiftBits), 16));
#else
write_q15x2_ia (&pDst, __PKHBT((in2 >> -shiftBits),
(in1 >> -shiftBits), 16));
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
#else
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
*pDst++ = (*pSrc++ >> -shiftBits);
#endif
/* 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) */
/* If the shift value is positive then do right shift else left shift */
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A << shiftBits */
/* Shift input and store result in destination buffer. */
*pDst++ = __SSAT(((q31_t) *pSrc++ << shiftBits), 16);
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A >> shiftBits */
/* Shift input and store result in destination buffer. */
*pDst++ = (*pSrc++ >> -shiftBits);
/* Decrement loop counter */
blkCnt--;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4207B7", "function_addr": 4327351, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov eax, esi"], [4, "mov [rbp+var_38], rdx"], [5, "mov [rbp+var_30], ecx"], [6, "mov [rbp+var_2C], al"], [7, "movzx eax, [rbp+var_2C]"], [8, "and eax, 0FFFFFF80h"], [9, "mov [rbp+var_5], al"], [10, "mov eax, [rbp+var_30]"], [11, "mov [rbp+var_4], eax"], [12, "cmp [rbp+var_5], 0"], [13, "jnz loc_4208AA"], [14, "jmp loc_42086B"], [15, "mov rax, [rbp+var_28]"], [16, "lea rdx, [rax+2]"], [17, "mov [rbp+var_28], rdx"], [18, "movzx eax, word ptr [rax]"], [19, "movsx edx, ax"], [20, "movsx eax, [rbp+var_2C]"], [21, "mov ecx, eax"], [22, "shl edx, cl"], [23, "mov eax, edx"], [24, "mov [rbp+var_C], eax"], [25, "mov [rbp+var_10], 10h"], [26, "cmp [rbp+var_10], 0"], [27, "jz short loc_420855"], [28, "cmp [rbp+var_10], 20h "], [29, "ja short loc_420855"], [30, "mov eax, [rbp+var_10]"], [31, "sub eax, 1"], [32, "mov edx, 1"], [33, "mov ecx, eax"], [34, "shl edx, cl"], [35, "mov eax, edx"], [36, "sub eax, 1"], [37, "mov [rbp+var_14], eax"], [38, "mov eax, [rbp+var_14]"], [39, "not eax"], [40, "mov [rbp+var_18], eax"], [41, "mov eax, [rbp+var_C]"], [42, "cmp eax, [rbp+var_14]"], [43, "jle short loc_420848"], [44, "mov eax, [rbp+var_14]"], [45, "jmp short loc_420858"], [46, "mov eax, [rbp+var_C]"], [47, "cmp eax, [rbp+var_18]"], [48, "jge short loc_420855"], [49, "mov eax, [rbp+var_18]"], [50, "jmp short loc_420858"], [51, "mov eax, [rbp+var_C]"], [52, "mov rdx, [rbp+var_38]"], [53, "lea rcx, [rdx+2]"], [54, "mov [rbp+var_38], rcx"], [55, "mov [rdx], ax"], [56, "sub [rbp+var_4], 1"], [57, "cmp [rbp+var_4], 0"], [58, "jnz loc_4207EA"], [59, "jmp short loc_4208B0"], [60, "mov rax, [rbp+var_28]"], [61, "lea rdx, [rax+2]"], [62, "mov [rbp+var_28], rdx"], [63, "movzx eax, word ptr [rax]"], [64, "movsx edx, ax"], [65, "movsx eax, [rbp+var_2C]"], [66, "neg eax"], [67, "mov ecx, eax"], [68, "sar edx, cl"], [69, "mov ecx, edx"], [70, "mov rax, [rbp+var_38]"], [71, "lea rdx, [rax+2]"], [72, "mov [rbp+var_38], rdx"], [73, "mov edx, ecx"], [74, "mov [rax], dx"], [75, "sub [rbp+var_4], 1"], [76, "cmp [rbp+var_4], 0"], [77, "jnz short loc_420877"], [78, "nop"], [79, "pop rbp"], [80, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 5], [11, 10], [12, 9], [13, 12], [15, 2], [15, 17], [16, 15], [16, 55], [16, 52], [17, 16], [18, 55], [18, 15], [19, 18], [20, 6], [21, 20], [22, 19], [22, 21], [23, 22], [24, 23], [26, 25], [27, 26], [28, 25], [29, 28], [30, 25], [31, 30], [33, 31], [34, 32], [34, 33], [35, 34], [36, 35], [37, 36], [38, 37], [39, 38], [40, 39], [41, 24], [42, 41], [42, 37], [43, 42], [44, 37], [46, 24], [47, 40], [47, 46], [48, 47], [49, 40], [51, 24], [52, 4], [52, 54], [53, 55], [53, 52], [53, 33], [53, 21], [54, 53], [55, 52], [55, 49], [55, 51], [55, 44], [56, 11], [56, 56], [57, 11], [57, 56], [58, 57], [60, 62], [60, 2], [61, 74], [61, 60], [61, 73], [62, 61], [63, 74], [63, 60], [64, 63], [65, 6], [66, 65], [67, 66], [68, 67], [68, 64], [69, 68], [70, 4], [70, 72], [71, 74], [71, 68], [71, 70], [72, 71], [73, 69], [74, 73], [74, 70], [75, 11], [75, 75], [76, 11], [76, 75], [77, 76], [79, 0], [80, 49], [80, 51], [80, 44], [80, 10], [80, 70]]}
| {"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_4207B7", "query": "\n\n\n__int64 __fastcall sub_4207B7(__int16 *a1, char a2, _WORD *a3, unsigned int a4)\n{\n__int64 result; // rax\n__int16 *v5; // rax\n_WORD *v6; // rdx\n__int16 *v7; // rax\nint v8; // ecx\nint v11; // [rsp+2Ch] [rbp-Ch]\nunsigned int v12; // [rsp+34h] [rbp-4h]\n\nresult = a4;\nv12 = a4;\nif ( a2 < 0 )\n{\nwhile ( v12 )\n{\nv7 = a1++;\nv8 = *v7 >> -a2;\nresult = (__int64)a3++;\n*(_WORD *)result = v8;\n--v12;\n}\n}\nelse\n{\nwhile ( v12 )\n{\nv5 = a1++;\nv11 = *v5 << a2;\nif ( v11 <= 0x7FFF )\n{\nif ( v11 >= -32768 )\nresult = (unsigned int)v11;\nelse\nresult = 4294934528LL;\n}\nelse\n{\nresult = 0x7FFFLL;\n}\nv6 = a3++;\n*v6 = result;\n--v12;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,sub_4207B7,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'blockSize', 'a1': 'pSrc', 'a2': 'shiftBits', 'sub_4207B7': 'arm_shift_q15'}"} | [
[
0.7484661936759949,
0.7455031871795654,
0.7454971075057983,
0.743773341178894,
0.7398550510406494,
0.7388415932655334,
0.7386411428451538,
0.7375640869140625,
0.7371333837509155,
0.736396849155426,
0.7283397316932678,
0.7283010482788086,
0.7249398231506348,
0.7238661050796509,
0.7234216928482056,
0.7231517434120178,
0.7227308750152588,
0.7218503952026367,
0.7215309143066406,
0.7199310064315796
],
[
229167,
208295,
54595,
124693,
180174,
34826,
206995,
177496,
63813,
228553,
21251,
181941,
224292,
223079,
221884,
68407,
249276,
233952,
119225,
93701
]
] |
|
sync_erase_chunk | a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0 | sysml | minipython | NA | int sync_erase_chunk(struct storage *s, chk_t start, chk_t len) {
off_t startb;
unsigned int m;
strp_t start_s;
strp_t end_s;
strp_t strp;
void *strp0 = calloc(1, s->stripesize);
uint64_t p = 0; /* progress in promille */
if (!strp0)
goto err_out;
if (start == 0) {
errno = EINVAL;
goto err_free_strp0;
}
if (s->stripemode == SHFS_SM_COMBINED) {
start_s = (strp_t) start * (strp_t) s->nb_members;
end_s = (strp_t) (start + len) * (strp_t) s->nb_members;
} else { /* SHFS_SM_INTERLEAVED (chunksize == stripesize) */
start_s = (strp_t) start + (strp_t) (s->nb_members - 1);
end_s = (strp_t) (start_s + len);
}
for (strp = start_s; strp < end_s; ++strp) {
m = strp % s->nb_members;
startb = (strp / s->nb_members) * s->stripesize;
if (verbosity >= D_L0) {
p = (strp - start_s + 1) * 1000 / (end_s - start_s);
dprintf(D_L0, "\r Erasing chunk %"PRIstrp" on member %u (%"PRIu64".%01"PRIu64" %%)... ",
s->stripemode == SHFS_SM_COMBINED ?
strp / s->nb_members : strp - (s->nb_members - 1),
m, p / 10, p % 10);
}
if (s->member[m].d->discard) {
/* device supports discard */
/* TODO: DISCARD NOT IMPLEMENTED YET */
errno = ENOTSUP;
goto err_free_strp0;
} else {
/* device does not support discard:
* overwrite area with zero's */
if (lseek(s->member[m].d->fd, startb, SEEK_SET) < 0) {
eprintf("Could not seek on %s: %s\n", s->member[m].d->path, strerror(errno));
goto err_free_strp0;
}
if (write(s->member[m].d->fd, strp0, s->stripesize) < 0) {
eprintf("Could not write to %s: %s\n", s->member[m].d->path, strerror(errno));
goto err_free_strp0;
}
}
}
dprintf(D_L0, "\n");
free(strp0);
return 0;
err_free_strp0:
free(strp0);
err_out:
return -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403094", "function_addr": 4206740, "binary_name": "a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_48], rdi"], [4, "mov [rbp+var_50], rsi"], [5, "mov [rbp+var_58], rdx"], [6, "mov rax, [rbp+var_48]"], [7, "mov eax, [rax+184h]"], [8, "mov eax, eax"], [9, "mov rsi, rax"], [10, "mov edi, 1"], [11, "call _calloc"], [12, "mov [rbp+buf], rax"], [13, "mov [rbp+var_28], 0"], [14, "cmp [rbp+buf], 0"], [15, "jz loc_40344F"], [16, "cmp [rbp+var_50], 0"], [17, "jnz short loc_4030EF"], [18, "call ___errno_location"], [19, "mov dword ptr [rax], 16h"], [20, "jmp loc_403441"], [21, "mov rax, [rbp+var_48]"], [22, "movzx eax, byte ptr [rax+188h]"], [23, "cmp al, 1"], [24, "jnz short loc_40313B"], [25, "mov rax, [rbp+var_48]"], [26, "movzx eax, byte ptr [rax+180h]"], [27, "movzx eax, al"], [28, "mov rdx, [rbp+var_50]"], [29, "imul rax, rdx"], [30, "mov [rbp+var_8], rax"], [31, "mov rdx, [rbp+var_50]"], [32, "mov rax, [rbp+var_58]"], [33, "add rdx, rax"], [34, "mov rax, [rbp+var_48]"], [35, "movzx eax, byte ptr [rax+180h]"], [36, "movzx eax, al"], [37, "imul rax, rdx"], [38, "mov [rbp+var_10], rax"], [39, "jmp short loc_403169"], [40, "mov rax, [rbp+var_48]"], [41, "movzx eax, byte ptr [rax+180h]"], [42, "movzx eax, al"], [43, "sub eax, 1"], [44, "movsxd rdx, eax"], [45, "mov rax, [rbp+var_50]"], [46, "add rax, rdx"], [47, "mov [rbp+var_8], rax"], [48, "mov rdx, [rbp+var_8]"], [49, "mov rax, [rbp+var_58]"], [50, "add rax, rdx"], [51, "mov [rbp+var_10], rax"], [52, "mov rax, [rbp+var_8]"], [53, "mov [rbp+var_18], rax"], [54, "jmp loc_403402"], [55, "mov rax, [rbp+var_48]"], [56, "movzx eax, byte ptr [rax+180h]"], [57, "movzx ecx, al"], [58, "mov rax, [rbp+var_18]"], [59, "mov edx, 0"], [60, "div rcx"], [61, "mov rax, rdx"], [62, "mov [rbp+var_2C], eax"], [63, "mov rax, [rbp+var_48]"], [64, "movzx eax, byte ptr [rax+180h]"], [65, "movzx edi, al"], [66, "mov rax, [rbp+var_18]"], [67, "mov edx, 0"], [68, "div rdi"], [69, "mov rdx, rax"], [70, "mov rax, [rbp+var_48]"], [71, "mov eax, [rax+184h]"], [72, "mov eax, eax"], [73, "imul rax, rdx"], [74, "mov [rbp+offset], rax"], [75, "mov eax, cs:dword_40734C"], [76, "test eax, eax"], [77, "jz loc_4032C3"], [78, "mov rax, [rbp+var_18]"], [79, "sub rax, [rbp+var_8]"], [80, "add rax, 1"], [81, "imul rax, 3E8h"], [82, "mov rdx, [rbp+var_10]"], [83, "mov rdi, rdx"], [84, "sub rdi, [rbp+var_8]"], [85, "mov edx, 0"], [86, "div rdi"], [87, "mov [rbp+var_28], rax"], [88, "mov eax, cs:dword_40734C"], [89, "test eax, eax"], [90, "jz loc_4032C3"], [91, "mov rsi, [rbp+var_28]"], [92, "mov rdx, 0CCCCCCCCCCCCCCCDh"], [93, "mov rax, rsi"], [94, "mul rdx"], [95, "mov rcx, rdx"], [96, "shr rcx, 3"], [97, "mov rax, rcx"], [98, "shl rax, 2"], [99, "add rax, rcx"], [100, "add rax, rax"], [101, "sub rsi, rax"], [102, "mov rcx, rsi"], [103, "mov rax, [rbp+var_28]"], [104, "mov rdx, 0CCCCCCCCCCCCCCCDh"], [105, "mul rdx"], [106, "mov rdi, rdx"], [107, "shr rdi, 3"], [108, "mov rax, [rbp+var_48]"], [109, "movzx eax, byte ptr [rax+188h]"], [110, "cmp al, 1"], [111, "jnz short loc_403281"], [112, "mov rax, [rbp+var_48]"], [113, "movzx eax, byte ptr [rax+180h]"], [114, "movzx esi, al"], [115, "mov rax, [rbp+var_18]"], [116, "mov edx, 0"], [117, "div rsi"], [118, "mov rdx, rax"], [119, "jmp short loc_40329F"], [120, "mov rax, [rbp+var_48]"], [121, "movzx eax, byte ptr [rax+180h]"], [122, "movzx eax, al"], [123, "sub eax, 1"], [124, "movsxd rsi, eax"], [125, "mov rax, [rbp+var_18]"], [126, "sub rax, rsi"], [127, "mov rdx, rax"], [128, "mov rax, cs:stderr"], [129, "mov esi, [rbp+var_2C]"], [130, "mov r9, rcx"], [131, "mov r8, rdi"], [132, "mov ecx, esi"], [133, "mov esi, offset aErasingChunkLu"], [134, "mov rdi, rax"], [135, "mov eax, 0"], [136, "call _fprintf"], [137, "mov rcx, [rbp+var_48]"], [138, "mov edx, [rbp+var_2C]"], [139, "mov rax, rdx"], [140, "add rax, rax"], [141, "add rax, rdx"], [142, "shl rax, 3"], [143, "add rax, rcx"], [144, "mov rax, [rax]"], [145, "mov eax, [rax+1Ch]"], [146, "test eax, eax"], [147, "jz short loc_4032F4"], [148, "call ___errno_location"], [149, "mov dword ptr [rax], 5Fh "], [150, "jmp loc_403441"], [151, "mov rcx, [rbp+var_48]"], [152, "mov edx, [rbp+var_2C]"], [153, "mov rax, rdx"], [154, "add rax, rax"], [155, "add rax, rdx"], [156, "shl rax, 3"], [157, "add rax, rcx"], [158, "mov rax, [rax]"], [159, "mov eax, [rax]"], [160, "mov rcx, [rbp+offset]"], [161, "mov edx, 0"], [162, "mov rsi, rcx"], [163, "mov edi, eax"], [164, "call _lseek"], [165, "test rax, rax"], [166, "jns short loc_403375"], [167, "call ___errno_location"], [168, "mov eax, [rax]"], [169, "mov edi, eax"], [170, "call _strerror"], [171, "mov rcx, rax"], [172, "mov rsi, [rbp+var_48]"], [173, "mov edx, [rbp+var_2C]"], [174, "mov rax, rdx"], [175, "add rax, rax"], [176, "add rax, rdx"], [177, "shl rax, 3"], [178, "add rax, rsi"], [179, "mov rax, [rax]"], [180, "mov rdx, [rax+8]"], [181, "mov rax, cs:stderr"], [182, "mov esi, offset aCouldNotSeekOn"], [183, "mov rdi, rax"], [184, "mov eax, 0"], [185, "call _fprintf"], [186, "jmp loc_403441"], [187, "mov rax, [rbp+var_48]"], [188, "mov eax, [rax+184h]"], [189, "mov esi, eax"], [190, "mov rcx, [rbp+var_48]"], [191, "mov edx, [rbp+var_2C]"], [192, "mov rax, rdx"], [193, "add rax, rax"], [194, "add rax, rdx"], [195, "shl rax, 3"], [196, "add rax, rcx"], [197, "mov rax, [rax]"], [198, "mov eax, [rax]"], [199, "mov rcx, [rbp+buf]"], [200, "mov rdx, rsi"], [201, "mov rsi, rcx"], [202, "mov edi, eax"], [203, "call _write"], [204, "test rax, rax"], [205, "jns short loc_4033FD"], [206, "call ___errno_location"], [207, "mov eax, [rax]"], [208, "mov edi, eax"], [209, "call _strerror"], [210, "mov rcx, rax"], [211, "mov rsi, [rbp+var_48]"], [212, "mov edx, [rbp+var_2C]"], [213, "mov rax, rdx"], [214, "add rax, rax"], [215, "add rax, rdx"], [216, "shl rax, 3"], [217, "add rax, rsi"], [218, "mov rax, [rax]"], [219, "mov rdx, [rax+8]"], [220, "mov rax, cs:stderr"], [221, "mov esi, offset aCouldNotWriteT"], [222, "mov rdi, rax"], [223, "mov eax, 0"], [224, "call _fprintf"], [225, "jmp short loc_403441"], [226, "add [rbp+var_18], 1"], [227, "mov rax, [rbp+var_18]"], [228, "cmp rax, [rbp+var_10]"], [229, "jb loc_403176"], [230, "mov eax, cs:dword_40734C"], [231, "test eax, eax"], [232, "jz short loc_40342E"], [233, "mov rax, cs:stderr"], [234, "mov rsi, rax"], [235, "mov edi, 0Ah"], [236, "call _fputc"], [237, "mov rax, [rbp+buf]"], [238, "mov rdi, rax"], [239, "call _free"], [240, "mov eax, 0"], [241, "jmp short locret_403455"], [242, "mov rax, [rbp+buf]"], [243, "mov rdi, rax"], [244, "call _free"], [245, "jmp short loc_403450"], [246, "nop"], [247, "mov eax, 0FFFFFFFFh"], [248, "leave"], [249, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [12, 11], [14, 12], [15, 14], [16, 4], [17, 16], [19, 18], [21, 3], [22, 21], [23, 22], [24, 23], [25, 3], [26, 25], [27, 26], [28, 4], [29, 27], [29, 28], [30, 29], [31, 4], [32, 5], [33, 31], [33, 32], [34, 3], [35, 34], [36, 35], [37, 33], [37, 36], [38, 37], [40, 3], [41, 40], [42, 41], [43, 42], [44, 43], [45, 4], [46, 45], [46, 44], [47, 46], [48, 47], [49, 5], [50, 49], [50, 48], [51, 50], [52, 30], [52, 47], [53, 52], [55, 3], [56, 55], [57, 56], [58, 53], [58, 226], [60, 57], [61, 59], [62, 61], [63, 3], [64, 63], [65, 64], [66, 53], [66, 226], [68, 65], [69, 66], [70, 3], [71, 70], [72, 71], [73, 69], [73, 72], [74, 73], [76, 75], [77, 76], [77, 74], [78, 53], [78, 226], [79, 30], [79, 78], [79, 47], [80, 79], [81, 80], [82, 38], [82, 51], [83, 82], [84, 47], [84, 83], [84, 30], [86, 84], [87, 81], [89, 88], [90, 89], [91, 87], [93, 91], [94, 92], [95, 94], [96, 95], [97, 96], [98, 97], [99, 96], [99, 98], [100, 99], [101, 91], [101, 100], [102, 101], [103, 87], [105, 104], [106, 105], [107, 106], [108, 3], [109, 108], [110, 109], [111, 110], [112, 3], [113, 112], [114, 113], [115, 226], [115, 53], [117, 114], [118, 115], [120, 3], [121, 120], [122, 121], [123, 122], [124, 123], [125, 53], [125, 226], [126, 125], [126, 124], [127, 126], [129, 62], [130, 102], [131, 107], [132, 129], [134, 128], [137, 3], [138, 62], [139, 138], [140, 139], [141, 138], [141, 140], [142, 141], [143, 142], [143, 137], [144, 143], [145, 144], [146, 145], [147, 146], [149, 148], [151, 3], [152, 62], [153, 152], [154, 153], [155, 152], [155, 154], [156, 155], [157, 156], [157, 151], [158, 157], [159, 158], [162, 160], [163, 159], [165, 164], [166, 165], [168, 167], [169, 168], [171, 170], [172, 3], [173, 62], [174, 173], [175, 174], [176, 173], [176, 175], [177, 176], [178, 177], [178, 172], [179, 178], [180, 179], [183, 181], [187, 3], [188, 187], [189, 188], [190, 3], [191, 62], [192, 191], [193, 192], [194, 191], [194, 193], [195, 194], [196, 190], [196, 195], [197, 196], [198, 197], [199, 12], [200, 189], [201, 199], [202, 198], [204, 203], [205, 204], [207, 206], [208, 207], [210, 209], [211, 3], [212, 62], [213, 212], [214, 213], [215, 212], [215, 214], [216, 215], [217, 216], [217, 211], [218, 217], [219, 218], [222, 220], [226, 53], [226, 226], [227, 53], [227, 226], [228, 51], [228, 38], [228, 227], [229, 228], [231, 230], [232, 231], [234, 233], [237, 12], [238, 237], [242, 12], [243, 242], [249, 247], [249, 240]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0_a7b05dcb1e84abd87c043a3e4a23ff8d0cfea42386f393c62eb625ddee6115a0.jsonl.gz", "strip_func_name": "sub_403094", "query": "\n\n\n__int64 __fastcall sub_403094(__int64 a1, __int64 a2, __int64 a3)\n{\nunsigned __int64 v3; // rdx\nint *v4; // rax\nchar *v5; // rax\nint *v6; // rax\nchar *v7; // rax\nunsigned __int64 offset; // [rsp+28h] [rbp-38h]\nunsigned int v11; // [rsp+34h] [rbp-2Ch]\nunsigned __int64 v12; // [rsp+38h] [rbp-28h]\nvoid *buf; // [rsp+40h] [rbp-20h]\nunsigned __int64 i; // [rsp+48h] [rbp-18h]\nunsigned __int64 v15; // [rsp+50h] [rbp-10h]\n__int64 v16; // [rsp+58h] [rbp-8h]\n\nbuf = calloc(1uLL, *(unsigned int *)(a1 + 388));\nif ( !buf )\nreturn 0xFFFFFFFFLL;\nif ( !a2 )\n{\n*__errno_location() = 22;\nLABEL_24:\nfree(buf);\nreturn 0xFFFFFFFFLL;\n}\nif ( *(_BYTE *)(a1 + 392) == 1 )\n{\nv16 = a2 * *(unsigned __int8 *)(a1 + 384);\nv15 = (a3 + a2) * *(unsigned __int8 *)(a1 + 384);\n}\nelse\n{\nv16 = *(unsigned __int8 *)(a1 + 384) - 1 + a2;\nv15 = v16 + a3;\n}\nfor ( i = v16; i < v15; ++i )\n{\nv11 = i % *(unsigned __int8 *)(a1 + 384);\noffset = i / *(unsigned __int8 *)(a1 + 384) * *(unsigned int *)(a1 + 388);\nif ( dword_40734C )\n{\nif ( *(_BYTE *)(a1 + 392) == 1 )\nv3 = i / *(unsigned __int8 *)(a1 + 384);\nelse\nv3 = i - (*(unsigned __int8 *)(a1 + 384) - 1);\nv12 = 1000 * (i - v16 + 1) / (v15 - v16);\nfprintf(stderr, \"\\r Erasing chunk %lu on member %u (%lu.%01lu %%)... \", v3, v11, v12 / 0xA, v12 % 0xA);\n}\nif ( *(_DWORD *)(*(_QWORD *)(a1 + 24LL * v11) + 28LL) )\n{\n*__errno_location() = 95;\ngoto LABEL_24;\n}\nif ( lseek(**(_DWORD **)(a1 + 24LL * v11), offset, 0) < 0 )\n{\nv4 = __errno_location();\nv5 = strerror(*v4);\nfprintf(stderr, \"Could not seek on %s: %s\\n\", *(const char **)(*(_QWORD *)(a1 + 24LL * v11) + 8LL), v5);\ngoto LABEL_24;\n}\nif ( write(**(_DWORD **)(a1 + 24LL * v11), buf, *(unsigned int *)(a1 + 388)) < 0 )\n{\nv6 = __errno_location();\nv7 = strerror(*v6);\nfprintf(stderr, \"Could not write to %s: %s\\n\", *(const char **)(*(_QWORD *)(a1 + 24LL * v11) + 8LL), v7);\ngoto LABEL_24;\n}\n}\nif ( dword_40734C )\nfputc(10, stderr);\nfree(buf);\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,offset,v11,v12,buf,i,v15,v16,sub_403094,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 's', 'a2': 'start', 'offset': 'startb', 'v11': 'm', 'v12': 'p', 'buf': 'strp0', 'i': 'strp', 'v15': 'end_s', 'v16': 'start_s', 'sub_403094': 'sync_erase_chunk'}"} | [
[
0.7006415128707886,
0.6972065567970276,
0.6860135197639465,
0.6721916198730469,
0.6708756685256958,
0.6619292497634888,
0.6583799719810486,
0.6575418710708618,
0.6526376605033875,
0.6515432000160217,
0.6507662534713745,
0.6492509245872498,
0.6452469825744629,
0.6430989503860474,
0.6428020000457764,
0.6393793225288391,
0.6386316418647766,
0.6368215084075928,
0.6367325782775879,
0.6362825036048889
],
[
85790,
38266,
31622,
139698,
261018,
94439,
168389,
40560,
238264,
248161,
75359,
141160,
88197,
182827,
229847,
75008,
206755,
68691,
28573,
139039
]
] |
|
pg_strong_random | bb985a62ed7929754afd4971b60a3dca2bab1970142c80a5a749e8ccaac5bb93 | sraoss | pgsql-ivm | NA | bool
pg_strong_random(void *buf, size_t len)
{
int f;
char *p = buf;
ssize_t res;
f = open("/dev/urandom", O_RDONLY, 0);
if (f == -1)
return false;
while (len)
{
res = read(f, p, len);
if (res <= 0)
{
if (errno == EINTR)
continue; /* interrupted by signal, just retry */
close(f);
return false;
}
p += res;
len -= res;
}
close(f);
return true;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41ED3B", "function_addr": 4320571, "binary_name": "bb985a62ed7929754afd4971b60a3dca2bab1970142c80a5a749e8ccaac5bb93.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+nbytes], rsi"], [5, "mov rax, [rbp+var_28]"], [6, "mov [rbp+buf], rax"], [7, "mov edx, 0"], [8, "mov esi, 0"], [9, "mov edi, offset file"], [10, "mov eax, 0"], [11, "call _open"], [12, "mov [rbp+fd], eax"], [13, "cmp [rbp+fd], 0FFFFFFFFh"], [14, "jnz short loc_41EDCB"], [15, "mov eax, 0"], [16, "jmp short locret_41EDE1"], [17, "mov rdx, [rbp+nbytes]"], [18, "mov rcx, [rbp+buf]"], [19, "mov eax, [rbp+fd]"], [20, "mov rsi, rcx"], [21, "mov edi, eax"], [22, "call _read"], [23, "mov [rbp+var_18], rax"], [24, "cmp [rbp+var_18], 0"], [25, "jg short loc_41EDBB"], [26, "call ___errno_location"], [27, "mov eax, [rax]"], [28, "cmp eax, 4"], [29, "jnz short loc_41EDAA"], [30, "jmp short loc_41EDCB"], [31, "mov eax, [rbp+fd]"], [32, "mov edi, eax"], [33, "call _close"], [34, "mov eax, 0"], [35, "jmp short locret_41EDE1"], [36, "mov rax, [rbp+var_18]"], [37, "add [rbp+buf], rax"], [38, "mov rax, [rbp+var_18]"], [39, "sub [rbp+nbytes], rax"], [40, "cmp [rbp+nbytes], 0"], [41, "jnz short loc_41ED7C"], [42, "mov eax, [rbp+fd]"], [43, "mov edi, eax"], [44, "call _close"], [45, "mov eax, 1"], [46, "leave"], [47, "retn"]], "data_dep": [[5, 3], [6, 5], [12, 11], [13, 12], [14, 13], [17, 39], [17, 4], [18, 37], [18, 6], [19, 12], [20, 18], [21, 19], [23, 22], [24, 23], [25, 24], [27, 26], [28, 27], [29, 28], [31, 12], [32, 31], [36, 23], [37, 6], [37, 36], [37, 37], [38, 23], [39, 39], [39, 38], [39, 4], [40, 4], [40, 39], [41, 40], [42, 12], [43, 42], [47, 34], [47, 15], [47, 45]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bb985a62ed7929754afd4971b60a3dca2bab1970142c80a5a749e8ccaac5bb93_bb985a62ed7929754afd4971b60a3dca2bab1970142c80a5a749e8ccaac5bb93.jsonl.gz", "strip_func_name": "sub_41ED3B", "query": "\n\n\n__int64 __fastcall sub_41ED3B(char *a1, size_t a2)\n{\nssize_t v4; // [rsp+18h] [rbp-18h]\nint fd; // [rsp+24h] [rbp-Ch]\n\nfd = open(\"/dev/urandom\", 0, 0LL);\nif ( fd == -1 )\nreturn 0LL;\nwhile ( a2 )\n{\nv4 = read(fd, a1, a2);\nif ( v4 > 0 )\n{\na1 += v4;\na2 -= v4;\n}\nelse if ( *__errno_location() != 4 )\n{\nclose(fd);\nreturn 0LL;\n}\n}\nclose(fd);\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v4,fd,sub_41ED3B,]", "hints": "[]", "response": "{'a1': 'buf', 'a2': 'len', 'v4': 'res', 'fd': 'f', 'sub_41ED3B': 'pg_strong_random'}"} | [
[
0.8675341606140137,
0.8516858220100403,
0.8480016589164734,
0.8262787461280823,
0.8215198516845703,
0.8115928769111633,
0.8071129322052002,
0.8033937811851501,
0.8010292053222656,
0.7912020683288574,
0.7869592905044556,
0.7841790318489075,
0.7826962471008301,
0.780742883682251,
0.7800393104553223,
0.7777596116065979,
0.7775154709815979,
0.7774569988250732,
0.774871826171875,
0.7720209360122681
],
[
101151,
186171,
224286,
57003,
236950,
76844,
172338,
254264,
98430,
104682,
8731,
210407,
67183,
48560,
40334,
185987,
191610,
40107,
68898,
44350
]
] |
|
utf8proc_iterate | 2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7 | 0x09 | hfsfuse | NA | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate(
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_int32_t *dst
) {
utf8proc_int32_t uc;
const utf8proc_uint8_t *end;
*dst = -1;
if (!strlen) return 0;
end = str + ((strlen < 0) ? 4 : strlen);
uc = *str++;
if (uc < 0x80) {
*dst = uc;
return 1;
}
// Must be between 0xc2 and 0xf4 inclusive to be valid
if ((utf8proc_uint32_t)(uc - 0xc2) > (0xf4-0xc2)) return UTF8PROC_ERROR_INVALIDUTF8;
if (uc < 0xe0) { // 2-byte sequence
// Must have valid continuation character
if (str >= end || !utf_cont(*str)) return UTF8PROC_ERROR_INVALIDUTF8;
*dst = ((uc & 0x1f)<<6) | (*str & 0x3f);
return 2;
}
if (uc < 0xf0) { // 3-byte sequence
if ((str + 1 >= end) || !utf_cont(*str) || !utf_cont(str[1]))
return UTF8PROC_ERROR_INVALIDUTF8;
// Check for surrogate chars
if (uc == 0xed && *str > 0x9f)
return UTF8PROC_ERROR_INVALIDUTF8;
uc = ((uc & 0xf)<<12) | ((*str & 0x3f)<<6) | (str[1] & 0x3f);
if (uc < 0x800)
return UTF8PROC_ERROR_INVALIDUTF8;
*dst = uc;
return 3;
}
// 4-byte sequence
// Must have 3 valid continuation characters
if ((str + 2 >= end) || !utf_cont(*str) || !utf_cont(str[1]) || !utf_cont(str[2]))
return UTF8PROC_ERROR_INVALIDUTF8;
// Make sure in correct range (0x10000 - 0x10ffff)
if (uc == 0xf0) {
if (*str < 0x90) return UTF8PROC_ERROR_INVALIDUTF8;
} else if (uc == 0xf4) {
if (*str > 0x8f) return UTF8PROC_ERROR_INVALIDUTF8;
}
*dst = ((uc & 7)<<18) | ((*str & 0x3f)<<12) | ((str[1] & 0x3f)<<6) | (str[2] & 0x3f);
return 4;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401664", "function_addr": 4200036, "binary_name": "2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7.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 [rbp+var_28], rdx"], [5, "mov rax, [rbp+var_28]"], [6, "mov dword ptr [rax], 0FFFFFFFFh"], [7, "cmp [rbp+var_20], 0"], [8, "jnz short loc_40168F"], [9, "mov eax, 0"], [10, "jmp loc_40191B"], [11, "cmp [rbp+var_20], 0"], [12, "js short loc_40169C"], [13, "mov rax, [rbp+var_20]"], [14, "jmp short loc_4016A1"], [15, "mov eax, 4"], [16, "mov rdx, [rbp+var_18]"], [17, "add rax, rdx"], [18, "mov [rbp+var_8], rax"], [19, "mov rax, [rbp+var_18]"], [20, "lea rdx, [rax+1]"], [21, "mov [rbp+var_18], rdx"], [22, "movzx eax, byte ptr [rax]"], [23, "movzx eax, al"], [24, "mov [rbp+var_C], eax"], [25, "cmp [rbp+var_C], 7Fh"], [26, "jg short loc_4016DA"], [27, "mov rax, [rbp+var_28]"], [28, "mov edx, [rbp+var_C]"], [29, "mov [rax], edx"], [30, "mov eax, 1"], [31, "jmp loc_40191B"], [32, "mov eax, [rbp+var_C]"], [33, "sub eax, 0C2h"], [34, "cmp eax, 32h "], [35, "jbe short loc_4016F3"], [36, "mov rax, 0FFFFFFFFFFFFFFFDh"], [37, "jmp loc_40191B"], [38, "cmp [rbp+var_C], 0DFh"], [39, "jg short loc_401754"], [40, "mov rax, [rbp+var_18]"], [41, "cmp rax, [rbp+var_8]"], [42, "jnb short loc_40171C"], [43, "mov rax, [rbp+var_18]"], [44, "movzx eax, byte ptr [rax]"], [45, "movzx eax, al"], [46, "and eax, 0C0h"], [47, "cmp eax, 80h"], [48, "jz short loc_401728"], [49, "mov rax, 0FFFFFFFFFFFFFFFDh"], [50, "jmp loc_40191B"], [51, "mov eax, [rbp+var_C]"], [52, "shl eax, 6"], [53, "and eax, 7C0h"], [54, "mov edx, eax"], [55, "mov rax, [rbp+var_18]"], [56, "movzx eax, byte ptr [rax]"], [57, "movzx eax, al"], [58, "and eax, 3Fh"], [59, "or edx, eax"], [60, "mov rax, [rbp+var_28]"], [61, "mov [rax], edx"], [62, "mov eax, 2"], [63, "jmp loc_40191B"], [64, "cmp [rbp+var_C], 0EFh"], [65, "jg loc_401826"], [66, "mov rax, [rbp+var_18]"], [67, "add rax, 1"], [68, "cmp [rbp+var_8], rax"], [69, "jbe short loc_40179F"], [70, "mov rax, [rbp+var_18]"], [71, "movzx eax, byte ptr [rax]"], [72, "movzx eax, al"], [73, "and eax, 0C0h"], [74, "cmp eax, 80h"], [75, "jnz short loc_40179F"], [76, "mov rax, [rbp+var_18]"], [77, "add rax, 1"], [78, "movzx eax, byte ptr [rax]"], [79, "movzx eax, al"], [80, "and eax, 0C0h"], [81, "cmp eax, 80h"], [82, "jz short loc_4017AB"], [83, "mov rax, 0FFFFFFFFFFFFFFFDh"], [84, "jmp loc_40191B"], [85, "cmp [rbp+var_C], 0EDh"], [86, "jnz short loc_4017CB"], [87, "mov rax, [rbp+var_18]"], [88, "movzx eax, byte ptr [rax]"], [89, "cmp al, 9Fh"], [90, "jbe short loc_4017CB"], [91, "mov rax, 0FFFFFFFFFFFFFFFDh"], [92, "jmp loc_40191B"], [93, "mov eax, [rbp+var_C]"], [94, "shl eax, 0Ch"], [95, "movzx edx, ax"], [96, "mov rax, [rbp+var_18]"], [97, "movzx eax, byte ptr [rax]"], [98, "movzx eax, al"], [99, "shl eax, 6"], [100, "and eax, 0FC0h"], [101, "or edx, eax"], [102, "mov rax, [rbp+var_18]"], [103, "add rax, 1"], [104, "movzx eax, byte ptr [rax]"], [105, "movzx eax, al"], [106, "and eax, 3Fh"], [107, "or eax, edx"], [108, "mov [rbp+var_C], eax"], [109, "cmp [rbp+var_C], 7FFh"], [110, "jg short loc_401813"], [111, "mov rax, 0FFFFFFFFFFFFFFFDh"], [112, "jmp loc_40191B"], [113, "mov rax, [rbp+var_28]"], [114, "mov edx, [rbp+var_C]"], [115, "mov [rax], edx"], [116, "mov eax, 3"], [117, "jmp loc_40191B"], [118, "mov rax, [rbp+var_18]"], [119, "add rax, 2"], [120, "cmp [rbp+var_8], rax"], [121, "jbe short loc_40187E"], [122, "mov rax, [rbp+var_18]"], [123, "movzx eax, byte ptr [rax]"], [124, "movzx eax, al"], [125, "and eax, 0C0h"], [126, "cmp eax, 80h"], [127, "jnz short loc_40187E"], [128, "mov rax, [rbp+var_18]"], [129, "add rax, 1"], [130, "movzx eax, byte ptr [rax]"], [131, "movzx eax, al"], [132, "and eax, 0C0h"], [133, "cmp eax, 80h"], [134, "jnz short loc_40187E"], [135, "mov rax, [rbp+var_18]"], [136, "add rax, 2"], [137, "movzx eax, byte ptr [rax]"], [138, "movzx eax, al"], [139, "and eax, 0C0h"], [140, "cmp eax, 80h"], [141, "jz short loc_40188A"], [142, "mov rax, 0FFFFFFFFFFFFFFFDh"], [143, "jmp loc_40191B"], [144, "cmp [rbp+var_C], 0F0h"], [145, "jnz short loc_4018A7"], [146, "mov rax, [rbp+var_18]"], [147, "movzx eax, byte ptr [rax]"], [148, "cmp al, 8Fh"], [149, "ja short loc_4018C4"], [150, "mov rax, 0FFFFFFFFFFFFFFFDh"], [151, "jmp short loc_40191B"], [152, "cmp [rbp+var_C], 0F4h"], [153, "jnz short loc_4018C4"], [154, "mov rax, [rbp+var_18]"], [155, "movzx eax, byte ptr [rax]"], [156, "cmp al, 8Fh"], [157, "jbe short loc_4018C4"], [158, "mov rax, 0FFFFFFFFFFFFFFFDh"], [159, "jmp short loc_40191B"], [160, "mov eax, [rbp+var_C]"], [161, "shl eax, 12h"], [162, "and eax, 1C0000h"], [163, "mov edx, eax"], [164, "mov rax, [rbp+var_18]"], [165, "movzx eax, byte ptr [rax]"], [166, "movzx eax, al"], [167, "shl eax, 0Ch"], [168, "and eax, 3F000h"], [169, "or edx, eax"], [170, "mov rax, [rbp+var_18]"], [171, "add rax, 1"], [172, "movzx eax, byte ptr [rax]"], [173, "movzx eax, al"], [174, "shl eax, 6"], [175, "and eax, 0FC0h"], [176, "or edx, eax"], [177, "mov rax, [rbp+var_18]"], [178, "add rax, 2"], [179, "movzx eax, byte ptr [rax]"], [180, "movzx eax, al"], [181, "and eax, 3Fh"], [182, "or edx, eax"], [183, "mov rax, [rbp+var_28]"], [184, "mov [rax], edx"], [185, "mov eax, 4"], [186, "pop rbp"], [187, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [8, 7], [11, 3], [12, 11], [13, 3], [16, 2], [17, 16], [17, 13], [17, 15], [18, 17], [19, 2], [20, 19], [20, 16], [20, 6], [21, 20], [22, 19], [22, 6], [23, 22], [24, 23], [25, 24], [26, 25], [27, 4], [28, 24], [29, 27], [29, 28], [32, 24], [33, 32], [34, 33], [35, 34], [38, 24], [39, 38], [40, 21], [41, 40], [41, 18], [42, 41], [43, 21], [44, 43], [44, 6], [45, 44], [46, 45], [47, 46], [48, 47], [51, 24], [52, 51], [53, 52], [54, 53], [55, 21], [56, 55], [56, 61], [56, 6], [57, 56], [58, 57], [59, 54], [59, 58], [60, 4], [61, 60], [61, 59], [64, 24], [65, 64], [66, 21], [67, 66], [68, 67], [68, 18], [69, 68], [70, 21], [71, 6], [71, 70], [72, 71], [73, 72], [74, 73], [75, 74], [76, 21], [77, 76], [78, 77], [78, 6], [79, 78], [80, 79], [81, 80], [82, 81], [85, 24], [86, 85], [87, 21], [88, 87], [88, 6], [89, 88], [90, 89], [93, 24], [94, 93], [95, 94], [96, 21], [97, 96], [97, 6], [98, 97], [99, 98], [100, 99], [101, 100], [101, 95], [102, 21], [103, 102], [104, 6], [104, 103], [105, 104], [106, 105], [107, 106], [107, 101], [108, 107], [109, 108], [110, 109], [113, 4], [114, 108], [115, 114], [115, 113], [118, 21], [119, 118], [120, 119], [120, 18], [121, 120], [122, 21], [123, 6], [123, 122], [124, 123], [125, 124], [126, 125], [127, 126], [128, 21], [129, 128], [130, 6], [130, 129], [131, 130], [132, 131], [133, 132], [134, 133], [135, 21], [136, 135], [137, 6], [137, 136], [138, 137], [139, 138], [140, 139], [141, 140], [144, 24], [145, 144], [146, 21], [147, 146], [147, 6], [148, 147], [149, 148], [152, 24], [153, 152], [154, 21], [155, 6], [155, 154], [156, 155], [157, 156], [160, 24], [161, 160], [162, 161], [163, 162], [164, 21], [165, 184], [165, 164], [165, 6], [166, 165], [167, 166], [168, 167], [169, 163], [169, 168], [170, 21], [171, 170], [172, 6], [172, 184], [172, 171], [173, 172], [174, 173], [175, 174], [176, 169], [176, 175], [177, 21], [178, 177], [179, 178], [179, 6], [179, 184], [180, 179], [181, 180], [182, 181], [182, 176], [183, 4], [184, 182], [184, 183], [186, 0], [187, 30], [187, 158], [187, 185], [187, 142], [187, 9], [187, 91], [187, 36], [187, 150], [187, 116], [187, 111], [187, 83], [187, 49], [187, 62]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7_2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7.jsonl.gz", "strip_func_name": "sub_401664", "query": "\n\n\n__int64 __fastcall sub_401664(unsigned __int8 *a1, __int64 a2, _DWORD *a3)\n{\n__int64 result; // rax\n__int64 v4; // rax\n_BYTE *v5; // [rsp+10h] [rbp-18h]\nunsigned int v6; // [rsp+1Ch] [rbp-Ch]\nint v7; // [rsp+1Ch] [rbp-Ch]\nunsigned __int64 v8; // [rsp+20h] [rbp-8h]\n\n*a3 = -1;\nif ( !a2 )\nreturn 0LL;\nif ( a2 < 0 )\nv4 = 4LL;\nelse\nv4 = a2;\nv8 = (unsigned __int64)&a1[v4];\nv5 = a1 + 1;\nv6 = *a1;\nif ( v6 <= 0x7F )\n{\n*a3 = v6;\nreturn 1LL;\n}\nif ( v6 - 194 > 0x32 )\nreturn -3LL;\nif ( *a1 > 0xDFu )\n{\nif ( *a1 > 0xEFu )\n{\nif ( v8 <= (unsigned __int64)(a1 + 3) || (*v5 & 0xC0) != 128 || (a1[2] & 0xC0) != 128 || (a1[3] & 0xC0) != 128 )\nreturn -3LL;\nif ( v6 == 240 )\n{\nif ( *v5 <= 0x8Fu )\nreturn -3LL;\n}\nelse if ( v6 == 244 && *v5 > 0x8Fu )\n{\nreturn -3LL;\n}\n*a3 = a1[3] & 0x3F | (a1[2] << 6) & 0xFC0 | (a1[1] << 12) & 0x3F000 | (v6 << 18) & 0x1C0000;\nresult = 4LL;\n}\nelse if ( v8 > (unsigned __int64)(a1 + 2) && (*v5 & 0xC0) == 128 && (a1[2] & 0xC0) == 128 )\n{\nif ( v6 == 237 && *v5 > 0x9Fu )\n{\nresult = -3LL;\n}\nelse\n{\nv7 = (a1[1] << 6) & 0xFC0 | (unsigned __int16)((_WORD)v6 << 12) | a1[2] & 0x3F;\nif ( v7 > 2047 )\n{\n*a3 = v7;\nresult = 3LL;\n}\nelse\n{\nresult = -3LL;\n}\n}\n}\nelse\n{\nresult = -3LL;\n}\n}\nelse if ( (unsigned __int64)v5 < v8 && (*v5 & 0xC0) == 128 )\n{\n*a3 = *v5 & 0x3F | ((_WORD)v6 << 6) & 0x7C0;\nresult = 2LL;\n}\nelse\n{\nresult = -3LL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,v7,v8,sub_401664,]", "hints": "[]", "response": "{'a3': 'dst', 'a1': 'str', 'a2': 'strlen', 'v5': 'stra', 'v7': 'uc', 'v8': 'end', 'sub_401664': 'utf8proc_iterate'}"} | [
[
0.823203444480896,
0.8137696981430054,
0.8108470439910889,
0.7883727550506592,
0.7797585725784302,
0.7750361561775208,
0.7722740173339844,
0.7721309661865234,
0.7702057957649231,
0.768750011920929,
0.7683934569358826,
0.7663221955299377,
0.7618498802185059,
0.7519484162330627,
0.7510433793067932,
0.7479702830314636,
0.745437502861023,
0.745010256767273,
0.744916558265686,
0.7442426681518555
],
[
257247,
104703,
97044,
147120,
95120,
240312,
150257,
129751,
188953,
234163,
166544,
225664,
64200,
93839,
39353,
254793,
9968,
77891,
105591,
18790
]
] |
|
smb2_run_test | a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40 | vanhauser-thc | thc-hydra | NA | bool smb2_run_test(creds_t *cr, const char *server, uint16_t port) {
SMBCCTX *ctx = smbc_new_context();
if (ctx == NULL) {
hydra_report(stderr, "[ERROR] failed to create context\n");
EXIT_PROTOCOL_ERROR;
}
// samba internal debugging will be dumped to stderr
smbc_setDebug(ctx, debug ? 7 : 0);
smbc_setOptionDebugToStderr(ctx, true);
smbc_setFunctionAuthDataWithContext(ctx, smb2_auth_provider);
smbc_setOptionUserData(ctx, cr);
// 0 will use default port
smbc_setPort(ctx, port);
smbc_setOptionNoAutoAnonymousLogin(ctx, false);
smbc_setOptionUseNTHash(ctx, use_nt_hash);
if (netbios_name) {
smbc_setNetbiosName(ctx, (char *)netbios_name);
}
ctx = smbc_init_context(ctx);
if (!ctx) {
hydra_report(stderr, "[ERROR] smbc_init_context fail\n");
smbc_free_context(ctx, 1);
EXIT_PROTOCOL_ERROR;
}
char uri[2048];
snprintf(uri, sizeof(uri) - 1, "smb://%s/IPC$", server);
uri[sizeof(uri) - 1] = 0;
if (verbose) {
printf("[INFO] Connecting to: %s with %s\\%s%%%s\n", uri, cr->workgroup, cr->user, cr->pass);
}
SMBCFILE *fd = smbc_getFunctionOpendir(ctx)(ctx, uri);
if (fd) {
hydra_report(stderr, "[WARNING] Unexpected open on IPC$\n");
smbc_getFunctionClosedir(ctx)(ctx, fd);
smbc_free_context(ctx, 1);
fd = NULL;
return true;
}
/*
errno is set to 22 (EINVAL) when IPC$ as been opened but can not
be opened like a normal share. This corresponds to samba error
NT_STATUS_INVALID_INFO_CLASS, however this precise error code is
not available outside of the library. Thus, instead the library
sets a generic error (EINVAL) which can also correspond to other
cases (see below test).
This is not ideal, but appears to be the best that the
libsmbclient library offers as detailed state information is
internalised and not available. Further, it is also not possible
from the api to separate the connection, authentication and
authorisation.
The following text is taken from the libsmbclient header file for
the return value of the smbc_getFunctionOpendir function:
Valid directory handle. < 0 on error with errno set:
- EACCES Permission denied.
- EINVAL A NULL file/URL was passed, or the URL would
not parse, or was of incorrect form or smbc_init not
called.
- ENOENT durl does not exist, or name is an
- ENOMEM Insufficient memory to complete the
operation.
- ENOTDIR name is not a directory.
- EPERM the workgroup could not be found.
- ENODEV the workgroup or server could not be found.
*/
switch (errno) {
case 0:
// maybe false positive? unclear ... :( ... needs more testing
smbc_free_context(ctx, 1);
return true;
break;
case ENOENT:
// Noticed this when connecting to older samba servers on linux
// where any credentials are accepted.
hydra_report(stderr, "[WARNING] %s might accept any credential\n", server);
case EINVAL: // 22
// probably password ok, nominal case when connecting to a windows
// smb server with good credentials.
smbc_free_context(ctx, 1);
return true;
break;
case EPERM:
// Probably this means access denied inspite of mention above
// about being related to wrong workgroup. I have observed
// libsmbclient emitting this when connecting to a vanilla install
// of Windows 2019 server (non-domain) with wrong credentials. It
// appears related to a fallback null session being rejected after
// the library tries with provided credentials. If the null
// session is accepted, EACCES is returned.
case EACCES:
// 100% access denied
break;
case EHOSTUNREACH:
case ETIMEDOUT:
case ECONNREFUSED:
// there are probably more codes that could be added here to
// indicate connection errors.
hydra_report(stderr, "[ERROR] Error %s (%d) while connecting to %s\n", strerror(errno), errno, server);
smbc_free_context(ctx, 1);
EXIT_CONNECTION_ERROR;
break;
default:
// unexpected error
hydra_report(stderr, "[ERROR] %s (%d)\n", strerror(errno), errno);
smbc_free_context(ctx, 1);
EXIT_PROTOCOL_ERROR;
}
smbc_free_context(ctx, 1);
return false;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_451A49", "function_addr": 4528713, "binary_name": "a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 848h"], [4, "mov [rbp+var_838], rdi"], [5, "mov [rbp+var_840], rsi"], [6, "mov eax, edx"], [7, "mov [rbp+var_844], ax"], [8, "mov rax, fs:28h"], [9, "mov [rbp+var_18], rax"], [10, "xor eax, eax"], [11, "call _smbc_new_context"], [12, "mov [rbp+var_830], rax"], [13, "cmp [rbp+var_830], 0"], [14, "jnz short loc_451AB9"], [15, "mov rax, cs:stderr"], [16, "mov rcx, rax"], [17, "mov edx, 21h "], [18, "mov esi, 1"], [19, "mov edi, offset aErrorFailedToC_0"], [20, "call _fwrite"], [21, "mov edi, 2"], [22, "call sub_44F259"], [23, "mov eax, cs:dword_47AA00"], [24, "test eax, eax"], [25, "jz short loc_451ACA"], [26, "mov edx, 7"], [27, "jmp short loc_451ACF"], [28, "mov edx, 0"], [29, "mov rax, [rbp+var_830]"], [30, "mov esi, edx"], [31, "mov rdi, rax"], [32, "call _smbc_setDebug"], [33, "mov rax, [rbp+var_830]"], [34, "mov esi, 1"], [35, "mov rdi, rax"], [36, "call _smbc_setOptionDebugToStderr"], [37, "mov rax, [rbp+var_830]"], [38, "mov esi, offset sub_451950"], [39, "mov rdi, rax"], [40, "call _smbc_setFunctionAuthDataWithContext"], [41, "mov rdx, [rbp+var_838]"], [42, "mov rax, [rbp+var_830]"], [43, "mov rsi, rdx"], [44, "mov rdi, rax"], [45, "call _smbc_setOptionUserData"], [46, "movzx edx, [rbp+var_844]"], [47, "mov rax, [rbp+var_830]"], [48, "mov esi, edx"], [49, "mov rdi, rax"], [50, "call _smbc_setPort"], [51, "mov rax, [rbp+var_830]"], [52, "mov esi, 0"], [53, "mov rdi, rax"], [54, "call _smbc_setOptionNoAutoAnonymousLogin"], [55, "movzx eax, cs:byte_479790"], [56, "movzx edx, al"], [57, "mov rax, [rbp+var_830]"], [58, "mov esi, edx"], [59, "mov rdi, rax"], [60, "call _smbc_setOptionUseNTHash"], [61, "mov rax, cs:qword_479798"], [62, "test rax, rax"], [63, "jz short loc_451B8D"], [64, "mov rdx, cs:qword_479798"], [65, "mov rax, [rbp+var_830]"], [66, "mov rsi, rdx"], [67, "mov rdi, rax"], [68, "call _smbc_setNetbiosName"], [69, "mov rax, [rbp+var_830]"], [70, "mov rdi, rax"], [71, "call _smbc_init_context"], [72, "mov [rbp+var_830], rax"], [73, "cmp [rbp+var_830], 0"], [74, "jnz short loc_451BE9"], [75, "mov rax, cs:stderr"], [76, "mov rcx, rax"], [77, "mov edx, 1Fh"], [78, "mov esi, 1"], [79, "mov edi, offset aErrorSmbcInitC"], [80, "call _fwrite"], [81, "mov rax, [rbp+var_830]"], [82, "mov esi, 1"], [83, "mov rdi, rax"], [84, "call _smbc_free_context"], [85, "mov edi, 2"], [86, "call sub_44F259"], [87, "mov rdx, [rbp+var_840]"], [88, "lea rax, [rbp+s]"], [89, "mov rcx, rdx"], [90, "mov edx, offset aSmbSIpc"], [91, "mov esi, 7FFh"], [92, "mov rdi, rax"], [93, "mov eax, 0"], [94, "call _snprintf"], [95, "mov [rbp+var_21], 0"], [96, "mov eax, cs:dword_479B24"], [97, "test eax, eax"], [98, "jz short loc_451C5B"], [99, "mov rax, [rbp+var_838]"], [100, "mov rsi, [rax+10h]"], [101, "mov rax, [rbp+var_838]"], [102, "mov rcx, [rax+8]"], [103, "mov rax, [rbp+var_838]"], [104, "mov rdx, [rax]"], [105, "lea rax, [rbp+s]"], [106, "mov r8, rsi"], [107, "mov rsi, rax"], [108, "mov edi, offset aInfoConnecting"], [109, "mov eax, 0"], [110, "call _printf"], [111, "mov rax, [rbp+var_830]"], [112, "mov rdi, rax"], [113, "call _smbc_getFunctionOpendir"], [114, "lea rcx, [rbp+s]"], [115, "mov rdx, [rbp+var_830]"], [116, "mov rsi, rcx"], [117, "mov rdi, rdx"], [118, "call rax"], [119, "mov [rbp+var_828], rax"], [120, "cmp [rbp+var_828], 0"], [121, "jz short loc_451CFD"], [122, "mov rax, cs:stderr"], [123, "mov rcx, rax"], [124, "mov edx, 22h "], [125, "mov esi, 1"], [126, "mov edi, offset aWarningUnexpec"], [127, "call _fwrite"], [128, "mov rax, [rbp+var_830]"], [129, "mov rdi, rax"], [130, "call _smbc_getFunctionClosedir"], [131, "mov rcx, [rbp+var_828]"], [132, "mov rdx, [rbp+var_830]"], [133, "mov rsi, rcx"], [134, "mov rdi, rdx"], [135, "call rax"], [136, "mov rax, [rbp+var_830]"], [137, "mov esi, 1"], [138, "mov rdi, rax"], [139, "call _smbc_free_context"], [140, "mov [rbp+var_828], 0"], [141, "mov eax, 1"], [142, "jmp loc_451E6C"], [143, "call ___errno_location"], [144, "mov eax, [rax]"], [145, "cmp eax, 71h "], [146, "jz loc_451DA2"], [147, "cmp eax, 71h "], [148, "jg def_451D36"], [149, "cmp eax, 16h"], [150, "jg short loc_451D38"], [151, "test eax, eax"], [152, "js def_451D36"], [153, "cmp eax, 16h"], [154, "ja def_451D36"], [155, "mov eax, eax"], [156, "mov rax, ds:jpt_451D36[rax*8]"], [157, "jmp rax"], [158, "sub eax, 6Eh "], [159, "cmp eax, 1"], [160, "ja def_451D36"], [161, "jmp short loc_451DA2"], [162, "mov rax, [rbp+var_830]"], [163, "mov esi, 1"], [164, "mov rdi, rax"], [165, "call _smbc_free_context"], [166, "mov eax, 1"], [167, "jmp loc_451E6C"], [168, "mov rax, cs:stderr"], [169, "mov rdx, [rbp+var_840]"], [170, "mov esi, offset aWarningSMightA"], [171, "mov rdi, rax"], [172, "mov eax, 0"], [173, "call _fprintf"], [174, "mov rax, [rbp+var_830]"], [175, "mov esi, 1"], [176, "mov rdi, rax"], [177, "call _smbc_free_context"], [178, "mov eax, 1"], [179, "jmp loc_451E6C"], [180, "call ___errno_location"], [181, "mov ebx, [rax]"], [182, "call ___errno_location"], [183, "mov eax, [rax]"], [184, "mov edi, eax"], [185, "call _strerror"], [186, "mov rdx, rax"], [187, "mov rax, cs:stderr"], [188, "mov rcx, [rbp+var_840]"], [189, "mov r8, rcx"], [190, "mov ecx, ebx"], [191, "mov esi, offset aErrorErrorSDWh"], [192, "mov rdi, rax"], [193, "mov eax, 0"], [194, "call _fprintf"], [195, "mov rax, [rbp+var_830]"], [196, "mov esi, 1"], [197, "mov rdi, rax"], [198, "call _smbc_free_context"], [199, "mov edi, 1"], [200, "call sub_44F259"], [201, "jmp short loc_451E53"], [202, "call ___errno_location"], [203, "mov ebx, [rax]"], [204, "call ___errno_location"], [205, "mov eax, [rax]"], [206, "mov edi, eax"], [207, "call _strerror"], [208, "mov rdx, rax"], [209, "mov rax, cs:stderr"], [210, "mov ecx, ebx"], [211, "mov esi, offset aErrorSD"], [212, "mov rdi, rax"], [213, "mov eax, 0"], [214, "call _fprintf"], [215, "mov rax, [rbp+var_830]"], [216, "mov esi, 1"], [217, "mov rdi, rax"], [218, "call _smbc_free_context"], [219, "mov edi, 2"], [220, "call sub_44F259"], [221, "jmp short loc_451E53"], [222, "nop"], [223, "mov rax, [rbp+var_830]"], [224, "mov esi, 1"], [225, "mov rdi, rax"], [226, "call _smbc_free_context"], [227, "mov eax, 0"], [228, "mov rbx, [rbp+var_18]"], [229, "sub rbx, fs:28h"], [230, "jz short loc_451E80"], [231, "call ___stack_chk_fail"], [232, "mov rbx, [rbp+var_8]"], [233, "leave"], [234, "retn"]], "data_dep": [[7, 6], [9, 8], [12, 11], [13, 12], [14, 13], [16, 15], [24, 23], [25, 24], [29, 12], [30, 26], [30, 28], [31, 29], [33, 12], [35, 33], [37, 12], [39, 37], [41, 4], [42, 12], [43, 41], [44, 42], [46, 7], [47, 12], [48, 46], [49, 47], [51, 12], [53, 51], [56, 55], [57, 12], [58, 56], [59, 57], [62, 61], [63, 62], [65, 12], [66, 64], [67, 65], [69, 12], [70, 69], [72, 71], [73, 72], [74, 73], [76, 75], [81, 72], [83, 81], [87, 5], [88, 71], [89, 87], [92, 88], [97, 96], [98, 97], [99, 4], [100, 99], [101, 4], [102, 101], [103, 4], [104, 103], [105, 103], [106, 100], [107, 105], [111, 72], [112, 111], [114, 102], [114, 89], [115, 72], [116, 114], [117, 115], [118, 113], [119, 118], [120, 119], [121, 120], [123, 122], [128, 72], [129, 128], [131, 119], [132, 72], [133, 131], [134, 132], [135, 130], [136, 72], [138, 136], [144, 143], [145, 144], [146, 145], [147, 144], [148, 147], [149, 144], [150, 149], [151, 144], [152, 151], [153, 151], [154, 153], [155, 151], [157, 156], [158, 144], [159, 158], [160, 159], [162, 72], [164, 162], [169, 5], [171, 168], [174, 72], [176, 174], [181, 180], [183, 182], [184, 183], [186, 185], [188, 5], [189, 188], [190, 181], [192, 187], [195, 72], [197, 195], [203, 202], [205, 204], [206, 205], [208, 207], [210, 203], [212, 209], [215, 72], [217, 215], [223, 72], [225, 223], [228, 9], [229, 228], [230, 229], [234, 227], [234, 178], [234, 166], [234, 141]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40_a8fb2edbd6bde6f75d208a747818d072741a3159e43047c86a6c260940123f40.jsonl.gz", "strip_func_name": "sub_451A49", "query": "\n\n\n__int64 __fastcall sub_451A49(const char **a1, const char *a2)\n{\n__int64 (__fastcall *v2)(__int64, char *); // rax\nvoid (__fastcall *v3)(__int64, __int64); // rax\nint v5; // eax\nunsigned int v6; // ebx\nint *v7; // rax\nchar *v8; // rax\nunsigned int v9; // ebx\nint *v10; // rax\nchar *v11; // rax\n__int64 v12; // [rsp+20h] [rbp-830h]\n__int64 v13; // [rsp+28h] [rbp-828h]\nchar s[2056]; // [rsp+30h] [rbp-820h] BYREF\nunsigned __int64 v15; // [rsp+838h] [rbp-18h]\n\nv15 = __readfsqword(0x28u);\nif ( !smbc_new_context() )\n{\nfwrite(\"[ERROR] failed to create context\\n\", 1uLL, 0x21uLL, stderr);\nsub_44F259(2);\n}\nsmbc_setDebug();\nsmbc_setOptionDebugToStderr();\nsmbc_setFunctionAuthDataWithContext();\nsmbc_setOptionUserData();\nsmbc_setPort();\nsmbc_setOptionNoAutoAnonymousLogin();\nsmbc_setOptionUseNTHash();\nif ( qword_479798 )\nsmbc_setNetbiosName();\nv12 = smbc_init_context();\nif ( !v12 )\n{\nfwrite(\"[ERROR] smbc_init_context fail\\n\", 1uLL, 0x1FuLL, stderr);\nsmbc_free_context();\nsub_44F259(2);\n}\nsnprintf(s, 0x7FFuLL, \"smb://%s/IPC$\", a2);\ns[2047] = 0;\nif ( dword_479B24 )\nprintf(\"[INFO] Connecting to: %s with %s\\\\%s%%%s\\n\", s, *a1, a1[1], a1[2]);\nv2 = (__int64 (__fastcall *)(__int64, char *))smbc_getFunctionOpendir();\nv13 = v2(v12, s);\nif ( !v13 )\n{\nv5 = *__errno_location();\nif ( v5 != 113 )\n{\nif ( v5 > 113 )\ngoto LABEL_21;\nif ( v5 <= 22 )\n{\nif ( v5 >= 0 )\n{\nswitch ( v5 )\n{\ncase 0:\ncase 22:\ngoto LABEL_19;\ncase 1:\ncase 13:\nsmbc_free_context();\nreturn 0LL;\ncase 2:\nfprintf(stderr, \"[WARNING] %s might accept any credential\\n\", a2);\nLABEL_19:\nsmbc_free_context();\nreturn 1LL;\ndefault:\nbreak;\n}\n}\nLABEL_21:\nv9 = *__errno_location();\nv10 = __errno_location();\nv11 = strerror(*v10);\nfprintf(stderr, \"[ERROR] %s (%d)\\n\", v11, v9);\nsmbc_free_context();\nsub_44F259(2);\n}\nif ( (unsigned int)(v5 - 110) > 1 )\ngoto LABEL_21;\n}\nv6 = *__errno_location();\nv7 = __errno_location();\nv8 = strerror(*v7);\nfprintf(stderr, \"[ERROR] Error %s (%d) while connecting to %s\\n\", v8, v6, a2);\nsmbc_free_context();\nsub_44F259(1);\n}\nfwrite(\"[WARNING] Unexpected open on IPC$\\n\", 1uLL, 0x22uLL, stderr);\nv3 = (void (__fastcall *)(__int64, __int64))smbc_getFunctionClosedir();\nv3(v12, v13);\nsmbc_free_context();\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v12,v13,s,sub_451A49,sub_44F259,]", "hints": "[]", "response": "{'a1': 'cr', 'a2': 'server', 'v12': 'ctx', 'v13': 'fd', 's': 'uri', 'sub_451A49': 'smb2_run_test', 'sub_44F259': 'hydra_child_exit'}"} | [
[
0.7572686672210693,
0.7304514646530151,
0.7098554372787476,
0.7024185061454773,
0.7012474536895752,
0.7007142305374146,
0.6990711092948914,
0.696062445640564,
0.6939951181411743,
0.6933979988098145,
0.6922916173934937,
0.6907199621200562,
0.6903574466705322,
0.6890552639961243,
0.6882899403572083,
0.6865350604057312,
0.6857986450195312,
0.6849442720413208,
0.6829757690429688,
0.6805657148361206
],
[
249897,
118452,
176765,
21947,
246763,
262520,
18734,
186215,
9201,
47321,
135607,
222843,
129754,
39052,
202807,
153297,
150613,
201466,
79816,
92037
]
] |
|
test_checksum | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | void test_checksum()
{
char payload[1000] = "GET /search?q=%E6%B3%95%E8%BD%AE%E5%8A%9F HTTP/1.1\r\nHOST: www.douban.com\r\nUser-Agent: Chrome\r\n\r\n";
printf("Testing checksum\n");
struct send_tcp_vars vars;
strcpy(vars.src_ip, "192.168.1.9");
strcpy(vars.dst_ip, "74.125.196.156");
vars.src_port = 38324;
vars.dst_port = 80;
vars.seq_num = htonl(345678);
vars.flags = TCP_SYN;
vars.win_size = 0;
vars.ttl = 128;
vars.tcp_opt[0] = 0xfe;
vars.tcp_opt[1] = 0x04;
vars.tcp_opt[2] = 0xf9;
vars.tcp_opt[3] = 0x89;
vars.tcp_opt_len = 4;
vars.payload[0] = 0;
strncat(vars.payload, payload, 1000);
vars.payload_len = strlen(payload);
send_tcp(&vars);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40D2F7", "function_addr": 4248311, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1460h"], [3, "mov rax, 6165732F20544547h"], [4, "mov rdx, 45253D713F686372h"], [5, "mov qword ptr [rbp+src], rax"], [6, "mov [rbp+var_3E8], rdx"], [7, "mov rax, 2535392533422536h"], [8, "mov rdx, 4541254442253845h"], [9, "mov [rbp+var_3E0], rax"], [10, "mov [rbp+var_3D8], rdx"], [11, "mov rax, 3925413825354525h"], [12, "mov rdx, 312F505454482046h"], [13, "mov [rbp+var_3D0], rax"], [14, "mov [rbp+var_3C8], rdx"], [15, "mov rax, 54534F480A0D312Eh"], [16, "mov rdx, 6F642E777777203Ah"], [17, "mov [rbp+var_3C0], rax"], [18, "mov [rbp+var_3B8], rdx"], [19, "mov rax, 6D6F632E6E616275h"], [20, "mov rdx, 412D726573550A0Dh"], [21, "mov [rbp+var_3B0], rax"], [22, "mov [rbp+var_3A8], rdx"], [23, "mov rax, 6843203A746E6567h"], [24, "mov rdx, 0A0D0A0D656D6F72h"], [25, "mov [rbp+var_3A0], rax"], [26, "mov [rbp+var_398], rdx"], [27, "mov [rbp+var_390], 0"], [28, "mov [rbp+var_388], 0"], [29, "lea rdx, [rbp+var_380]"], [30, "mov eax, 0"], [31, "mov ecx, 6Fh "], [32, "mov rdi, rdx"], [33, "rep stosq"], [34, "mov edi, offset aTestingChecksu"], [35, "call _puts"], [36, "lea rax, [rbp+var_1460]"], [37, "mov rsi, 2E3836312E323931h"], [38, "mov [rax], rsi"], [39, "mov dword ptr [rax+8], 392E31h"], [40, "lea rax, [rbp+var_1460]"], [41, "add rax, 10h"], [42, "mov rsi, 312E3532312E3437h"], [43, "mov [rax], rsi"], [44, "mov dword ptr [rax+8], 312E3639h"], [45, "mov word ptr [rax+0Ch], 3635h"], [46, "mov byte ptr [rax+0Eh], 0"], [47, "mov [rbp+var_143C], 95B4h"], [48, "mov [rbp+var_143A], 50h "], [49, "mov edi, 5464Eh"], [50, "call _htonl"], [51, "mov [rbp+var_1438], eax"], [52, "mov [rbp+var_142D], 2"], [53, "mov [rbp+var_142C], 0"], [54, "mov [rbp+var_1440], 80h"], [55, "mov [rbp+var_1429], 0FEh"], [56, "mov [rbp+var_1428], 4"], [57, "mov [rbp+var_1427], 0F9h"], [58, "mov [rbp+var_1426], 89h"], [59, "mov [rbp+var_1401], 4"], [60, "mov [rbp+var_1400], 0"], [61, "lea rax, [rbp+src]"], [62, "lea rdx, [rbp+var_1460]"], [63, "lea rcx, [rdx+60h]"], [64, "mov edx, 3E8h"], [65, "mov rsi, rax"], [66, "mov rdi, rcx"], [67, "call _strncat"], [68, "lea rax, [rbp+src]"], [69, "mov rdi, rax"], [70, "call _strlen"], [71, "mov [rbp+var_400], ax"], [72, "lea rax, [rbp+var_1460]"], [73, "mov rdi, rax"], [74, "call sub_407CE9"], [75, "nop"], [76, "leave"], [77, "retn"]], "data_dep": [[5, 3], [6, 4], [9, 7], [10, 8], [13, 11], [14, 12], [17, 15], [18, 16], [21, 19], [22, 20], [25, 23], [26, 24], [29, 24], [32, 29], [36, 35], [38, 37], [38, 36], [39, 36], [40, 36], [41, 40], [43, 42], [43, 41], [44, 41], [45, 41], [46, 41], [51, 50], [61, 5], [61, 50], [62, 29], [63, 31], [63, 46], [63, 62], [65, 61], [66, 63], [68, 5], [68, 67], [69, 68], [71, 70], [72, 70], [73, 72], [77, 74]]}
| {"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_40D2F7", "query": "\n\n\nint sub_40D2F7()\n{\nchar v1[16]; // [rsp+0h] [rbp-1460h] BYREF\nchar v2[20]; // [rsp+10h] [rbp-1450h] BYREF\n__int16 v3; // [rsp+24h] [rbp-143Ch]\n__int16 v4; // [rsp+26h] [rbp-143Ah]\nuint32_t v5; // [rsp+28h] [rbp-1438h]\nchar v6; // [rsp+33h] [rbp-142Dh]\n__int16 v7; // [rsp+34h] [rbp-142Ch]\nchar v8; // [rsp+37h] [rbp-1429h]\nchar v9; // [rsp+38h] [rbp-1428h]\nchar v10; // [rsp+39h] [rbp-1427h]\nchar v11; // [rsp+3Ah] [rbp-1426h]\nchar v12; // [rsp+5Fh] [rbp-1401h]\nchar v13[4096]; // [rsp+60h] [rbp-1400h] BYREF\n__int16 v14; // [rsp+1060h] [rbp-400h]\nchar src[8]; // [rsp+1070h] [rbp-3F0h] BYREF\n__int64 v16; // [rsp+10D8h] [rbp-388h]\nchar v17[888]; // [rsp+10E0h] [rbp-380h] BYREF\n\nstrcpy(\nsrc,\n\"GET /search?q=%E6%B3%95%E8%BD%AE%E5%8A%9F HTTP/1.1\\r\\nHOST: www.douban.com\\r\\nUser-Agent: Chrome\\r\\n\\r\\n\");\nv16 = 0LL;\nmemset(v17, 0, sizeof(v17));\nputs(\"Testing checksum\");\nstrcpy(v1, \"192.168.1.9\");\nstrcpy(v2, \"74.125.196.156\");\nv3 = -27212;\nv4 = 80;\nv5 = htonl(0x5464Eu);\nv6 = 2;\nv7 = 0;\nv2[16] = 0x80;\nv8 = -2;\nv9 = 4;\nv10 = -7;\nv11 = -119;\nv12 = 4;\nv13[0] = 0;\nstrncat(v13, src, 0x3E8uLL);\nv14 = strlen(src);\nreturn sub_407CE9((__int64)v1);\n}\n\n\n\nQ:[v1,src,sub_40D2F7,sub_407CE9,]", "hints": "[]", "response": "{'v1': 'vars', 'src': 'payload', 'sub_40D2F7': 'test_checksum', 'sub_407CE9': 'send_tcp'}"} | [
[
0.803749144077301,
0.8024061918258667,
0.7985082268714905,
0.7954750061035156,
0.7918199896812439,
0.7877956628799438,
0.7832154035568237,
0.778732180595398,
0.7761321067810059,
0.7752810716629028,
0.7752648591995239,
0.7724659442901611,
0.7707951664924622,
0.7707551717758179,
0.7685434222221375,
0.7601944208145142,
0.7582194805145264,
0.7572998404502869,
0.7568124532699585,
0.7564207911491394
],
[
19525,
203453,
239242,
167793,
133575,
1477,
58731,
32382,
144421,
223355,
252437,
110864,
34753,
255583,
60324,
241586,
153469,
38250,
119738,
213511
]
] |
|
speex_resampler_process_float | 9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f | vampirefrog | mdxtools | NA | EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
#endif
{
int j;
spx_uint32_t ilen = *in_len;
spx_uint32_t olen = *out_len;
spx_word32_t *x = st->mem + channel_index * st->mem_alloc_size;
const int filt_offs = st->filt_len - 1;
const spx_uint32_t xlen = st->mem_alloc_size - filt_offs;
const int istride = st->in_stride;
if (st->magic_samples[channel_index])
olen -= speex_resampler_magic(st, channel_index, &out, olen);
if (! st->magic_samples[channel_index]) {
while (ilen && olen) {
spx_uint32_t ichunk = (ilen > xlen) ? xlen : ilen;
spx_uint32_t ochunk = olen;
if (in) {
for(j=0;j<ichunk;++j)
x[j+filt_offs]=in[j*istride];
} else {
for(j=0;j<ichunk;++j)
x[j+filt_offs]=0;
}
speex_resampler_process_native(st, channel_index, &ichunk, out, &ochunk);
ilen -= ichunk;
olen -= ochunk;
out += ochunk * st->out_stride;
if (in)
in += ichunk * istride;
}
}
*in_len -= ilen;
*out_len -= olen;
return st->resampler_ptr == resampler_basic_zero ? RESAMPLER_ERR_ALLOC_FAILED : RESAMPLER_ERR_SUCCESS;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40AEC5", "function_addr": 4239045, "binary_name": "9394a363835b85c27ad15b9a680cf720a2040e4a3bbc8f4e6ee5218516ca9a3f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1070h"], [3, "mov [rbp+var_1048], rdi"], [4, "mov [rbp+var_104C], esi"], [5, "mov [rbp+var_1058], rdx"], [6, "mov [rbp+var_1060], rcx"], [7, "mov [rbp+var_1068], r8"], [8, "mov [rbp+var_1070], r9"], [9, "mov rax, [rbp+var_1048]"], [10, "mov eax, [rax+78h]"], [11, "mov [rbp+var_14], eax"], [12, "mov rax, [rbp+var_1048]"], [13, "mov eax, [rax+7Ch]"], [14, "mov [rbp+var_18], eax"], [15, "mov rax, [rbp+var_1060]"], [16, "mov eax, [rax]"], [17, "mov [rbp+var_8], eax"], [18, "mov rax, [rbp+var_1070]"], [19, "mov eax, [rax]"], [20, "mov [rbp+var_C], eax"], [21, "mov rax, [rbp+var_1048]"], [22, "mov rdx, [rax+58h]"], [23, "mov rax, [rbp+var_1048]"], [24, "mov eax, [rax+1Ch]"], [25, "imul eax, [rbp+var_104C]"], [26, "mov eax, eax"], [27, "shl rax, 2"], [28, "add rax, rdx"], [29, "mov [rbp+var_20], rax"], [30, "mov rax, [rbp+var_1048]"], [31, "mov edx, [rax+1Ch]"], [32, "mov rax, [rbp+var_1048]"], [33, "mov ecx, [rax+18h]"], [34, "mov eax, edx"], [35, "sub eax, ecx"], [36, "add eax, 1"], [37, "mov [rbp+var_24], eax"], [38, "mov [rbp+var_28], 400h"], [39, "mov rax, [rbp+var_1048]"], [40, "mov dword ptr [rax+7Ch], 1"], [41, "jmp loc_40B241"], [42, "lea rax, [rbp+var_1030]"], [43, "mov [rbp+var_1038], rax"], [44, "mov eax, [rbp+var_24]"], [45, "cmp [rbp+var_8], eax"], [46, "cmovbe eax, [rbp+var_8]"], [47, "mov [rbp+var_103C], eax"], [48, "mov eax, [rbp+var_28]"], [49, "cmp [rbp+var_C], eax"], [50, "cmovbe eax, [rbp+var_C]"], [51, "mov [rbp+var_1040], eax"], [52, "mov [rbp+var_10], 0"], [53, "mov rax, [rbp+var_1048]"], [54, "mov rdx, [rax+50h]"], [55, "mov eax, [rbp+var_104C]"], [56, "shl rax, 2"], [57, "add rax, rdx"], [58, "mov eax, [rax]"], [59, "test eax, eax"], [60, "jz short loc_40B019"], [61, "mov ecx, [rbp+var_1040]"], [62, "lea rdx, [rbp+var_1038]"], [63, "mov esi, [rbp+var_104C]"], [64, "mov rax, [rbp+var_1048]"], [65, "mov rdi, rax"], [66, "call sub_40AB62"], [67, "mov [rbp+var_10], eax"], [68, "mov eax, [rbp+var_1040]"], [69, "sub eax, [rbp+var_10]"], [70, "mov [rbp+var_1040], eax"], [71, "mov eax, [rbp+var_10]"], [72, "sub [rbp+var_C], eax"], [73, "mov rax, [rbp+var_1048]"], [74, "mov rdx, [rax+50h]"], [75, "mov eax, [rbp+var_104C]"], [76, "shl rax, 2"], [77, "add rax, rdx"], [78, "mov eax, [rax]"], [79, "test eax, eax"], [80, "jnz loc_40B188"], [81, "cmp [rbp+var_1058], 0"], [82, "jz loc_40B116"], [83, "mov [rbp+var_4], 0"], [84, "jmp loc_40B103"], [85, "mov eax, [rbp+var_4]"], [86, "imul eax, [rbp+var_14]"], [87, "cdqe"], [88, "lea rdx, ds:0[rax*4]"], [89, "mov rax, [rbp+var_1058]"], [90, "add rax, rdx"], [91, "movss xmm1, dword ptr [rax]"], [92, "movss xmm0, cs:dword_411D14"], [93, "comiss xmm0, xmm1"], [94, "jbe short loc_40B088"], [95, "mov eax, 0FFFF8000h"], [96, "jmp short loc_40B0DA"], [97, "mov eax, [rbp+var_4]"], [98, "imul eax, [rbp+var_14]"], [99, "cdqe"], [100, "lea rdx, ds:0[rax*4]"], [101, "mov rax, [rbp+var_1058]"], [102, "add rax, rdx"], [103, "movss xmm0, dword ptr [rax]"], [104, "comiss xmm0, cs:dword_411D18"], [105, "jbe short loc_40B0B7"], [106, "mov eax, 7FFFh"], [107, "jmp short loc_40B0DA"], [108, "mov eax, [rbp+var_4]"], [109, "imul eax, [rbp+var_14]"], [110, "cdqe"], [111, "lea rdx, ds:0[rax*4]"], [112, "mov rax, [rbp+var_1058]"], [113, "add rax, rdx"], [114, "movss xmm0, dword ptr [rax]"], [115, "cvttss2si eax, xmm0"], [116, "mov rdx, [rbp+var_1048]"], [117, "mov ecx, [rdx+18h]"], [118, "mov edx, [rbp+var_4]"], [119, "add edx, ecx"], [120, "sub edx, 1"], [121, "mov edx, edx"], [122, "lea rcx, ds:0[rdx*4]"], [123, "mov rdx, [rbp+var_20]"], [124, "add rdx, rcx"], [125, "mov [rdx], eax"], [126, "add [rbp+var_4], 1"], [127, "mov edx, [rbp+var_4]"], [128, "mov eax, [rbp+var_103C]"], [129, "cmp edx, eax"], [130, "jb loc_40B055"], [131, "jmp short loc_40B159"], [132, "mov [rbp+var_4], 0"], [133, "jmp short loc_40B14C"], [134, "mov rax, [rbp+var_1048]"], [135, "mov edx, [rax+18h]"], [136, "mov eax, [rbp+var_4]"], [137, "add eax, edx"], [138, "sub eax, 1"], [139, "mov eax, eax"], [140, "lea rdx, ds:0[rax*4]"], [141, "mov rax, [rbp+var_20]"], [142, "add rax, rdx"], [143, "mov dword ptr [rax], 0"], [144, "add [rbp+var_4], 1"], [145, "mov edx, [rbp+var_4]"], [146, "mov eax, [rbp+var_103C]"], [147, "cmp edx, eax"], [148, "jb short loc_40B11F"], [149, "mov rcx, [rbp+var_1038]"], [150, "lea rdi, [rbp+var_1040]"], [151, "lea rdx, [rbp+var_103C]"], [152, "mov esi, [rbp+var_104C]"], [153, "mov rax, [rbp+var_1048]"], [154, "mov r8, rdi"], [155, "mov rdi, rax"], [156, "call sub_40AA07"], [157, "jmp short loc_40B19C"], [158, "mov [rbp+var_103C], 0"], [159, "mov [rbp+var_1040], 0"], [160, "mov [rbp+var_4], 0"], [161, "jmp short loc_40B1DC"], [162, "mov eax, [rbp+var_4]"], [163, "cdqe"], [164, "mov edx, [rbp+rax*4+var_1030]"], [165, "mov eax, [rbp+var_4]"], [166, "imul eax, [rbp+var_18]"], [167, "cdqe"], [168, "lea rcx, ds:0[rax*4]"], [169, "mov rax, [rbp+var_1068]"], [170, "add rax, rcx"], [171, "pxor xmm0, xmm0"], [172, "cvtsi2ss xmm0, edx"], [173, "movss dword ptr [rax], xmm0"], [174, "add [rbp+var_4], 1"], [175, "mov edx, [rbp+var_1040]"], [176, "mov eax, [rbp+var_10]"], [177, "add edx, eax"], [178, "mov eax, [rbp+var_4]"], [179, "cmp edx, eax"], [180, "ja short loc_40B1A5"], [181, "mov eax, [rbp+var_103C]"], [182, "sub [rbp+var_8], eax"], [183, "mov eax, [rbp+var_1040]"], [184, "sub [rbp+var_C], eax"], [185, "mov edx, [rbp+var_1040]"], [186, "mov eax, [rbp+var_10]"], [187, "add edx, eax"], [188, "mov eax, [rbp+var_18]"], [189, "imul eax, edx"], [190, "mov eax, eax"], [191, "shl rax, 2"], [192, "add [rbp+var_1068], rax"], [193, "cmp [rbp+var_1058], 0"], [194, "jz short loc_40B241"], [195, "mov edx, [rbp+var_103C]"], [196, "mov eax, [rbp+var_14]"], [197, "imul eax, edx"], [198, "mov eax, eax"], [199, "shl rax, 2"], [200, "add [rbp+var_1058], rax"], [201, "cmp [rbp+var_8], 0"], [202, "jz short loc_40B251"], [203, "cmp [rbp+var_C], 0"], [204, "jnz loc_40AF8C"], [205, "mov rax, [rbp+var_1048]"], [206, "mov edx, [rbp+var_18]"], [207, "mov [rax+7Ch], edx"], [208, "mov rax, [rbp+var_1060]"], [209, "mov eax, [rax]"], [210, "sub eax, [rbp+var_8]"], [211, "mov edx, eax"], [212, "mov rax, [rbp+var_1060]"], [213, "mov [rax], edx"], [214, "mov rax, [rbp+var_1070]"], [215, "mov eax, [rax]"], [216, "sub eax, [rbp+var_C]"], [217, "mov edx, eax"], [218, "mov rax, [rbp+var_1070]"], [219, "mov [rax], edx"], [220, "mov rax, [rbp+var_1048]"], [221, "mov rax, [rax+70h]"], [222, "cmp rax, offset sub_409A19"], [223, "setz al"], [224, "movzx eax, al"], [225, "leave"], [226, "retn"]], "data_dep": [[9, 3], [10, 9], [11, 10], [12, 3], [13, 12], [14, 13], [15, 6], [16, 15], [17, 16], [18, 8], [19, 18], [20, 19], [21, 3], [22, 21], [23, 3], [24, 23], [25, 24], [25, 4], [26, 25], [27, 26], [28, 27], [28, 22], [29, 28], [30, 3], [31, 30], [32, 3], [33, 32], [34, 31], [35, 34], [35, 33], [36, 35], [37, 36], [39, 3], [40, 39], [42, 39], [42, 191], [42, 199], [43, 42], [44, 37], [45, 182], [45, 17], [45, 44], [46, 45], [46, 17], [46, 182], [47, 46], [48, 38], [49, 184], [49, 48], [49, 20], [50, 20], [50, 184], [50, 49], [51, 50], [53, 3], [54, 40], [54, 143], [54, 53], [54, 173], [54, 125], [55, 4], [56, 55], [57, 54], [57, 56], [58, 57], [58, 173], [58, 125], [58, 143], [58, 40], [59, 58], [60, 59], [61, 51], [62, 54], [62, 43], [63, 4], [64, 3], [65, 64], [67, 66], [68, 51], [69, 67], [69, 68], [70, 69], [71, 67], [72, 20], [72, 71], [72, 184], [73, 3], [74, 173], [74, 125], [74, 143], [74, 73], [74, 40], [75, 4], [76, 75], [77, 76], [77, 74], [78, 77], [78, 40], [78, 173], [78, 125], [78, 143], [79, 78], [80, 79], [81, 200], [81, 5], [82, 81], [85, 126], [85, 83], [86, 11], [86, 85], [88, 127], [89, 200], [89, 5], [90, 88], [90, 89], [91, 90], [91, 173], [91, 125], [91, 143], [91, 40], [93, 92], [93, 91], [94, 90], [97, 126], [97, 83], [98, 97], [98, 11], [100, 88], [101, 5], [101, 200], [102, 101], [102, 100], [103, 143], [103, 102], [103, 40], [103, 173], [103, 125], [104, 103], [105, 102], [108, 126], [108, 83], [109, 11], [109, 108], [111, 100], [112, 200], [112, 5], [113, 112], [113, 111], [114, 143], [114, 40], [114, 113], [114, 125], [114, 173], [115, 114], [115, 113], [116, 3], [117, 116], [117, 125], [117, 143], [117, 40], [117, 173], [118, 126], [118, 83], [119, 118], [119, 117], [120, 119], [121, 120], [122, 117], [123, 29], [124, 123], [124, 122], [125, 106], [125, 115], [125, 124], [125, 95], [126, 126], [126, 83], [127, 126], [127, 83], [128, 47], [129, 128], [129, 127], [130, 129], [134, 3], [135, 40], [135, 173], [135, 125], [135, 134], [135, 143], [136, 144], [136, 132], [137, 135], [137, 136], [138, 137], [139, 138], [140, 135], [141, 29], [142, 140], [142, 141], [143, 142], [144, 132], [144, 144], [145, 144], [145, 132], [146, 47], [147, 146], [147, 145], [148, 147], [149, 43], [150, 70], [150, 65], [150, 51], [150, 155], [151, 127], [151, 145], [151, 47], [152, 4], [153, 3], [154, 150], [155, 153], [162, 174], [162, 160], [164, 162], [165, 174], [165, 160], [166, 14], [166, 165], [168, 61], [168, 168], [168, 33], [168, 149], [169, 7], [169, 192], [170, 169], [170, 168], [172, 171], [172, 164], [173, 170], [173, 172], [174, 174], [174, 160], [175, 70], [175, 51], [175, 159], [176, 67], [176, 52], [177, 176], [177, 175], [178, 174], [178, 160], [179, 178], [179, 177], [180, 179], [181, 47], [181, 158], [182, 17], [182, 182], [182, 181], [183, 70], [183, 51], [183, 159], [184, 72], [184, 184], [184, 183], [184, 20], [185, 159], [185, 70], [185, 51], [186, 67], [186, 52], [187, 186], [187, 185], [188, 14], [189, 188], [189, 187], [190, 189], [191, 190], [192, 192], [192, 7], [192, 191], [193, 5], [193, 200], [194, 193], [195, 47], [195, 158], [196, 11], [197, 196], [197, 195], [198, 197], [199, 198], [200, 5], [200, 200], [200, 199], [201, 17], [201, 182], [202, 201], [203, 184], [203, 20], [204, 203], [205, 3], [206, 14], [207, 206], [207, 205], [208, 6], [209, 208], [209, 207], [209, 173], [209, 143], [210, 182], [210, 209], [210, 17], [211, 210], [212, 6], [213, 212], [213, 211], [214, 8], [215, 214], [215, 213], [216, 20], [216, 215], [216, 184], [217, 216], [218, 8], [219, 218], [219, 217], [220, 3], [221, 219], [221, 220], [222, 221], [223, 222], [223, 221], [224, 223], [226, 224]]}
| {"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_40AEC5", "query": "\n\n\n_BOOL8 __fastcall sub_40AEC5(__int64 a1, unsigned int a2, __int64 a3, int *a4, __int64 a5, int *a6)\n{\nunsigned int v6; // eax\nunsigned int v7; // eax\nint v8; // eax\nunsigned int v14; // [rsp+30h] [rbp-1040h] BYREF\nunsigned int v15; // [rsp+34h] [rbp-103Ch] BYREF\nint *v16; // [rsp+38h] [rbp-1038h] BYREF\nint v17[1026]; // [rsp+40h] [rbp-1030h] BYREF\nunsigned int v18; // [rsp+1048h] [rbp-28h]\nunsigned int v19; // [rsp+104Ch] [rbp-24h]\n__int64 v20; // [rsp+1050h] [rbp-20h]\nint v21; // [rsp+1058h] [rbp-18h]\nint v22; // [rsp+105Ch] [rbp-14h]\nint v23; // [rsp+1060h] [rbp-10h]\nunsigned int v24; // [rsp+1064h] [rbp-Ch]\nunsigned int v25; // [rsp+1068h] [rbp-8h]\nunsigned int i; // [rsp+106Ch] [rbp-4h]\n\nv22 = *(_DWORD *)(a1 + 120);\nv21 = *(_DWORD *)(a1 + 124);\nv25 = *a4;\nv24 = *a6;\nv20 = *(_QWORD *)(a1 + 88) + 4LL * a2 * *(_DWORD *)(a1 + 28);\nv19 = *(_DWORD *)(a1 + 28) - *(_DWORD *)(a1 + 24) + 1;\nv18 = 1024;\n*(_DWORD *)(a1 + 124) = 1;\nwhile ( v25 && v24 )\n{\nv16 = v17;\nv6 = v19;\nif ( v25 <= v19 )\nv6 = v25;\nv15 = v6;\nv7 = v18;\nif ( v24 <= v18 )\nv7 = v24;\nv14 = v7;\nv23 = 0;\nif ( *(_DWORD *)(*(_QWORD *)(a1 + 80) + 4LL * a2) )\n{\nv23 = sub_40AB62(a1, a2, (__int64 *)&v16, v14);\nv14 -= v23;\nv24 -= v23;\n}\nif ( *(_DWORD *)(*(_QWORD *)(a1 + 80) + 4LL * a2) )\n{\nv15 = 0;\nv14 = 0;\n}\nelse\n{\nif ( a3 )\n{\nfor ( i = 0; i < v15; ++i )\n{\nif ( *(float *)(4LL * (int)(v22 * i) + a3) >= -32767.0 )\n{\nif ( *(float *)(4LL * (int)(v22 * i) + a3) <= 32766.0 )\nv8 = (int)*(float *)(4LL * (int)(v22 * i) + a3);\nelse\nv8 = 0x7FFF;\n}\nelse\n{\nv8 = -32768;\n}\n*(_DWORD *)(4LL * (*(_DWORD *)(a1 + 24) + i - 1) + v20) = v8;\n}\n}\nelse\n{\nfor ( i = 0; i < v15; ++i )\n*(_DWORD *)(4LL * (*(_DWORD *)(a1 + 24) + i - 1) + v20) = 0;\n}\nsub_40AA07(a1, a2, (int *)&v15, (__int64)v16, &v14);\n}\nfor ( i = 0; v23 + v14 > i; ++i )\n*(float *)(4LL * (int)(v21 * i) + a5) = (float)v17[i];\nv25 -= v15;\nv24 -= v14;\na5 += 4LL * (v23 + v14) * v21;\nif ( a3 )\na3 += 4LL * v15 * v22;\n}\n*(_DWORD *)(a1 + 124) = v21;\n*a4 -= v25;\n*a6 -= v24;\nreturn *(_QWORD *)(a1 + 112) == (_QWORD)sub_409A19;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,sub_40AEC5,sub_40AB62,sub_40AA07,sub_409A19,]", "hints": "[]", "response": "{'a3': 'in', 'a4': 'in_len', 'a1': 'st', 'a2': 'channel_index', 'a5': 'out', 'a6': 'out_len', 'v14': 'ochunk', 'v15': 'ichunk', 'v16': 'y', 'v17': 'ystack', 'v18': 'ylen', 'v19': 'xlen', 'v20': 'x', 'v21': 'ostride_save', 'v22': 'istride_save', 'v23': 'omagic', 'v24': 'olen', 'v25': 'ilen', 'sub_40AEC5': 'speex_resampler_process_float', 'sub_40AB62': 'speex_resampler_magic', 'sub_40AA07': 'speex_resampler_process_native', 'sub_409A19': 'resampler_basic_zero'}"} | [
[
0.8020082712173462,
0.7755580544471741,
0.7472524046897888,
0.7458898425102234,
0.7436457872390747,
0.7393670678138733,
0.7387712001800537,
0.7267166376113892,
0.7241679430007935,
0.7207374572753906,
0.7164328694343567,
0.715006411075592,
0.7137295007705688,
0.7128852605819702,
0.7122061252593994,
0.7102755308151245,
0.7092306613922119,
0.7086948156356812,
0.7031565308570862,
0.7020310163497925
],
[
101179,
51791,
101044,
223834,
140710,
213245,
162563,
16381,
262720,
193725,
91675,
224806,
89100,
220709,
218783,
219458,
234158,
98645,
239957,
257607
]
] |
|
set_flow | 2c00654bef88d0508fa38ae4f23cd4855f551f44cdb471bbff8963716b7f93f5 | xelerance | xl2tpd | NA | int set_flow (char *word, char *value, int context, void *item)
{
int v = -1;
set_boolean (word, value, &v);
if (v < 0)
return -1;
switch (context & ~CONTEXT_DEFAULT)
{
case CONTEXT_LAC:
if (v)
{
if (((struct lac *) item)->call_rws < 0)
((struct lac *) item)->call_rws = 0;
}
else
{
((struct lac *) item)->call_rws = -1;
}
break;
case CONTEXT_LNS:
if (v)
{
if (((struct lns *) item)->call_rws < 0)
((struct lns *) item)->call_rws = 0;
}
else
{
((struct lns *) item)->call_rws = -1;
}
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_415A70", "function_addr": 4282992, "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+var_20], rsi"], [5, "mov [rbp+var_24], edx"], [6, "mov [rbp+var_30], rcx"], [7, "mov [rbp+var_4], 0FFFFFFFFh"], [8, "lea rdx, [rbp+var_4]"], [9, "mov rcx, [rbp+var_20]"], [10, "mov rax, [rbp+var_18]"], [11, "mov rsi, rcx"], [12, "mov rdi, rax"], [13, "call sub_4152A5"], [14, "mov eax, [rbp+var_4]"], [15, "test eax, eax"], [16, "jns short loc_415AB6"], [17, "mov eax, 0FFFFFFFFh"], [18, "jmp locret_415B4E"], [19, "mov eax, [rbp+var_24]"], [20, "and ah, 0FEh"], [21, "cmp eax, 2"], [22, "jz short loc_415AF2"], [23, "cmp eax, 3"], [24, "jnz short loc_415B1E"], [25, "mov eax, [rbp+var_4]"], [26, "test eax, eax"], [27, "jz short loc_415AE5"], [28, "mov rax, [rbp+var_30]"], [29, "mov eax, [rax+1Ch]"], [30, "test eax, eax"], [31, "jns short loc_415B45"], [32, "mov rax, [rbp+var_30]"], [33, "mov dword ptr [rax+1Ch], 0"], [34, "jmp short loc_415B45"], [35, "mov rax, [rbp+var_30]"], [36, "mov dword ptr [rax+1Ch], 0FFFFFFFFh"], [37, "jmp short loc_415B45"], [38, "mov eax, [rbp+var_4]"], [39, "test eax, eax"], [40, "jz short loc_415B11"], [41, "mov rax, [rbp+var_30]"], [42, "mov eax, [rax+18h]"], [43, "test eax, eax"], [44, "jns short loc_415B48"], [45, "mov rax, [rbp+var_30]"], [46, "mov dword ptr [rax+18h], 0"], [47, "jmp short loc_415B48"], [48, "mov rax, [rbp+var_30]"], [49, "mov dword ptr [rax+18h], 0FFFFFFFFh"], [50, "jmp short loc_415B48"], [51, "mov rax, [rbp+var_18]"], [52, "mov rcx, rax"], [53, "mov edx, offset aSNotValidInThi"], [54, "mov esi, 64h "], [55, "mov edi, offset byte_426340"], [56, "mov eax, 0"], [57, "call _snprintf"], [58, "mov eax, 0FFFFFFFFh"], [59, "jmp short locret_415B4E"], [60, "nop"], [61, "jmp short loc_415B49"], [62, "nop"], [63, "mov eax, 0"], [64, "leave"], [65, "retn"]], "data_dep": [[8, 7], [9, 4], [10, 3], [11, 9], [12, 10], [14, 7], [15, 14], [16, 15], [19, 5], [20, 19], [21, 20], [22, 21], [23, 20], [24, 23], [25, 7], [26, 25], [27, 26], [28, 6], [29, 28], [30, 29], [31, 30], [32, 6], [33, 32], [35, 6], [36, 35], [38, 7], [39, 38], [40, 39], [41, 6], [42, 41], [43, 42], [44, 43], [45, 6], [46, 45], [48, 6], [49, 48], [51, 3], [52, 51], [65, 58], [65, 63], [65, 17]]}
| {"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_415A70", "query": "\n\n\n__int64 __fastcall sub_415A70(const char *a1, const char *a2, int a3, __int64 a4)\n{\nint v5; // eax\nint v8; // [rsp+2Ch] [rbp-4h] BYREF\n\nv8 = -1;\nsub_4152A5(a1, a2, &v8);\nif ( v8 < 0 )\nreturn 0xFFFFFFFFLL;\nv5 = a3;\nBYTE1(v5) = BYTE1(a3) & 0xFE;\nif ( v5 == 2 )\n{\nif ( v8 )\n{\nif ( *(int *)(a4 + 24) < 0 )\n*(_DWORD *)(a4 + 24) = 0;\n}\nelse\n{\n*(_DWORD *)(a4 + 24) = -1;\n}\n}\nelse\n{\nif ( v5 != 3 )\n{\nsnprintf(byte_426340, 0x64uLL, \"'%s' not valid in this context\\n\", a1);\nreturn 0xFFFFFFFFLL;\n}\nif ( v8 )\n{\nif ( *(int *)(a4 + 28) < 0 )\n*(_DWORD *)(a4 + 28) = 0;\n}\nelse\n{\n*(_DWORD *)(a4 + 28) = -1;\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a4,a1,a2,v8,sub_415A70,sub_4152A5,]", "hints": "[]", "response": "{'a3': 'context', 'a4': 'item', 'a1': 'word', 'a2': 'value', 'v8': 'v', 'sub_415A70': 'set_flow', 'sub_4152A5': 'set_boolean'}"} | [
[
0.7467539310455322,
0.7329226732254028,
0.714155375957489,
0.7141038179397583,
0.7114894390106201,
0.7111040353775024,
0.7101994752883911,
0.7035302519798279,
0.7014364004135132,
0.699083149433136,
0.6935023069381714,
0.6931703686714172,
0.6926078796386719,
0.6897612810134888,
0.6897443532943726,
0.6887418031692505,
0.6876502633094788,
0.686867892742157,
0.6843444108963013,
0.6841036677360535
],
[
227523,
192716,
100841,
96294,
9825,
163074,
185247,
33006,
165640,
134593,
255755,
35733,
195635,
146118,
61399,
8840,
124058,
2736,
32120,
45123
]
] |
|
isbc464_set_base | 83287b4d3aa6d2f27b2397e22e7f93ef88ca3a5d6032c60c8f19bff4458e1767 | open-simh | simh | NA | t_stat isbc464_set_base(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{
uint32 size, result, i;
if (cptr == NULL)
return SCPE_ARG;
result = sscanf(cptr, "%i%n", &size, &i);
if ((result == 1) && (cptr[i] == 'K') && ((cptr[i + 1] == 0) ||
((cptr[i + 1] == 'B') && (cptr[i + 2] == 0)))) {
switch (size) {
case 0x00: //0K
uptr->BASE_ADDR = 0;
break;
case 0x10: //16K
uptr->BASE_ADDR = 16384;
break;
case 0x20: //32K
uptr->BASE_ADDR = 32768;
break;
case 0x30: //48K
uptr->BASE_ADDR = 49152;
break;
default:
sim_printf("SBC464: Base error\n");
return SCPE_ARG;
}
sim_printf("SBC464: Base=%04X\n", uptr->BASE_ADDR);
return SCPE_OK;
}
return SCPE_ARG;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40E307", "function_addr": 4252423, "binary_name": "83287b4d3aa6d2f27b2397e22e7f93ef88ca3a5d6032c60c8f19bff4458e1767.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_1C], esi"], [5, "mov [rbp+s], rdx"], [6, "mov [rbp+var_30], rcx"], [7, "cmp [rbp+s], 0"], [8, "jnz short loc_40E32F"], [9, "mov eax, 48h "], [10, "jmp locret_40E44B"], [11, "lea rcx, [rbp+var_C]"], [12, "lea rdx, [rbp+var_8]"], [13, "mov rax, [rbp+s]"], [14, "mov esi, offset aIN_1"], [15, "mov rdi, rax"], [16, "mov eax, 0"], [17, "call _sscanf"], [18, "mov [rbp+var_4], eax"], [19, "cmp [rbp+var_4], 1"], [20, "jnz loc_40E446"], [21, "mov eax, [rbp+var_C]"], [22, "mov edx, eax"], [23, "mov rax, [rbp+s]"], [24, "add rax, rdx"], [25, "movzx eax, byte ptr [rax]"], [26, "cmp al, 4Bh "], [27, "jnz loc_40E446"], [28, "mov eax, [rbp+var_C]"], [29, "add eax, 1"], [30, "mov edx, eax"], [31, "mov rax, [rbp+s]"], [32, "add rax, rdx"], [33, "movzx eax, byte ptr [rax]"], [34, "test al, al"], [35, "jz short loc_40E3BB"], [36, "mov eax, [rbp+var_C]"], [37, "add eax, 1"], [38, "mov edx, eax"], [39, "mov rax, [rbp+s]"], [40, "add rax, rdx"], [41, "movzx eax, byte ptr [rax]"], [42, "cmp al, 42h "], [43, "jnz loc_40E446"], [44, "mov eax, [rbp+var_C]"], [45, "add eax, 2"], [46, "mov edx, eax"], [47, "mov rax, [rbp+s]"], [48, "add rax, rdx"], [49, "movzx eax, byte ptr [rax]"], [50, "test al, al"], [51, "jnz loc_40E446"], [52, "mov eax, [rbp+var_8]"], [53, "cmp eax, 30h "], [54, "jz short loc_40E404"], [55, "cmp eax, 30h "], [56, "ja short loc_40E411"], [57, "cmp eax, 20h "], [58, "jz short loc_40E3F7"], [59, "cmp eax, 20h "], [60, "ja short loc_40E411"], [61, "test eax, eax"], [62, "jz short loc_40E3DD"], [63, "cmp eax, 10h"], [64, "jz short loc_40E3EA"], [65, "jmp short loc_40E411"], [66, "mov rax, [rbp+var_18]"], [67, "mov dword ptr [rax+5Ch], 0"], [68, "jmp short loc_40E427"], [69, "mov rax, [rbp+var_18]"], [70, "mov dword ptr [rax+5Ch], 4000h"], [71, "jmp short loc_40E427"], [72, "mov rax, [rbp+var_18]"], [73, "mov dword ptr [rax+5Ch], 8000h"], [74, "jmp short loc_40E427"], [75, "mov rax, [rbp+var_18]"], [76, "mov dword ptr [rax+5Ch], 0C000h"], [77, "jmp short loc_40E427"], [78, "mov edi, offset aSbc464BaseErro"], [79, "mov eax, 0"], [80, "call sub_437B8B"], [81, "mov eax, 48h "], [82, "jmp short locret_40E44B"], [83, "mov rax, [rbp+var_18]"], [84, "mov eax, [rax+5Ch]"], [85, "mov esi, eax"], [86, "mov edi, offset aSbc464Base04x"], [87, "mov eax, 0"], [88, "call sub_437B8B"], [89, "mov eax, 0"], [90, "jmp short locret_40E44B"], [91, "mov eax, 48h "], [92, "leave"], [93, "retn"]], "data_dep": [[7, 5], [8, 7], [13, 5], [15, 13], [18, 17], [19, 18], [20, 19], [22, 21], [23, 5], [24, 23], [24, 22], [25, 24], [26, 25], [27, 26], [29, 28], [30, 29], [31, 5], [32, 31], [32, 30], [33, 32], [34, 33], [35, 34], [37, 36], [38, 37], [39, 5], [40, 38], [40, 39], [41, 40], [42, 41], [43, 42], [45, 44], [46, 45], [47, 5], [48, 47], [48, 46], [49, 48], [50, 49], [51, 50], [53, 52], [54, 53], [55, 52], [56, 55], [57, 52], [58, 57], [59, 52], [60, 59], [61, 52], [62, 61], [63, 61], [64, 63], [66, 3], [67, 66], [69, 3], [70, 69], [72, 3], [73, 72], [75, 3], [76, 75], [83, 3], [84, 83], [84, 70], [84, 67], [84, 73], [84, 76], [85, 84], [93, 89], [93, 9], [93, 91], [93, 81]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/83287b4d3aa6d2f27b2397e22e7f93ef88ca3a5d6032c60c8f19bff4458e1767_83287b4d3aa6d2f27b2397e22e7f93ef88ca3a5d6032c60c8f19bff4458e1767.jsonl.gz", "strip_func_name": "sub_40E307", "query": "\n\n\n__int64 __fastcall sub_40E307(__int64 a1, __int64 a2, const char *a3)\n{\nint v4; // ecx\nint v5; // er8\nint v6; // er9\n__int64 v7; // rdx\nunsigned int v9; // [rsp+24h] [rbp-Ch] BYREF\nunsigned int v10; // [rsp+28h] [rbp-8h] BYREF\nint v11; // [rsp+2Ch] [rbp-4h]\n\nif ( !a3 )\nreturn 72LL;\nv11 = sscanf(a3, \"%i%n\", &v10, &v9);\nif ( v11 == 1 && a3[v9] == 75 )\n{\nv7 = v9 + 1;\nif ( !a3[v7] || a3[v9 + 1] == 66 && (v7 = v9 + 2, !a3[v7]) )\n{\nif ( v10 == 48 )\n{\n*(_DWORD *)(a1 + 92) = 49152;\n}\nelse\n{\nif ( v10 > 0x30 )\ngoto LABEL_19;\nif ( v10 != 32 )\n{\nif ( v10 <= 0x20 )\n{\nif ( v10 )\n{\nif ( v10 != 16 )\ngoto LABEL_19;\n*(_DWORD *)(a1 + 92) = 0x4000;\n}\nelse\n{\n*(_DWORD *)(a1 + 92) = 0;\n}\ngoto LABEL_20;\n}\nLABEL_19:\nsub_437B8B((unsigned int)\"SBC464: Base error\\n\", (unsigned int)\"%i%n\", v7, v4, v5, v6);\nreturn 72LL;\n}\n*(_DWORD *)(a1 + 92) = 0x8000;\n}\nLABEL_20:\nsub_437B8B((unsigned int)\"SBC464: Base=%04X\\n\", *(_DWORD *)(a1 + 92), v7, v4, v5, v6);\nreturn 0LL;\n}\n}\nreturn 72LL;\n}\n\n\n\nQ:[a3,a1,a2,v4,v7,v10,v11,sub_40E307,sub_437B8B,]", "hints": "[]", "response": "{'a3': 'cptr', 'a1': 'uptr', 'a2': 'val', 'v4': 'desc', 'v7': 'cptr', 'v10': 'size', 'v11': 'result', 'sub_40E307': 'isbc464_set_base', 'sub_437B8B': 'sim_printf'}"} | [
[
0.7225907444953918,
0.7031348943710327,
0.7015156745910645,
0.6893327832221985,
0.6846438646316528,
0.6792336702346802,
0.6764222979545593,
0.6726127862930298,
0.6700950264930725,
0.6696557998657227,
0.6677942276000977,
0.6639490723609924,
0.6609519720077515,
0.6604037284851074,
0.6600794196128845,
0.659912109375,
0.6580359935760498,
0.6579177975654602,
0.6571789979934692,
0.6548024415969849
],
[
90217,
139395,
197544,
35733,
260567,
100841,
209614,
8692,
113575,
22306,
237566,
170372,
178194,
65836,
17727,
222216,
26356,
12092,
87651,
195635
]
] |
|
drawFrameLabel | 1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d | cleanflight | blackbox-tools | NA | void drawFrameLabel(cairo_t *cr, uint32_t frameIndex, uint32_t frameTimeMsec)
{
char frameNumberBuf[16];
cairo_text_extents_t extentFrameNumber, extentFrameTime;
snprintf(frameNumberBuf, sizeof(frameNumberBuf), "#%07u", frameIndex);
cairo_set_font_size(cr, FONTSIZE_FRAME_LABEL);
cairo_set_source_rgba(cr, 1, 1, 1, 0.65);
cairo_text_extents(cr, "#0000000", &extentFrameNumber);
cairo_move_to(cr, options.imageWidth - extentFrameNumber.width - 8, options.imageHeight - 8);
cairo_show_text(cr, frameNumberBuf);
int frameSec, frameMins;
frameSec = frameTimeMsec / 1000;
frameTimeMsec %= 1000;
frameMins = frameSec / 60;
frameSec %= 60;
snprintf(frameNumberBuf, sizeof(frameNumberBuf), "%02d:%02d.%03d", frameMins, frameSec, frameTimeMsec);
cairo_text_extents(cr, "00:00.000", &extentFrameTime);
cairo_move_to(cr, options.imageWidth - extentFrameTime.width - 8, options.imageHeight - 8 - extentFrameNumber.height - 8);
cairo_show_text(cr, frameNumberBuf);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A8C1", "function_addr": 4237505, "binary_name": "1661f441bdf693be8ec8f497a2206a08ad49ee439f589bcaaf7473e752249a3d.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_88], rdi"], [4, "mov [rbp+var_8C], esi"], [5, "mov [rbp+var_90], edx"], [6, "mov edx, [rbp+var_8C]"], [7, "lea rax, [rbp+s]"], [8, "mov ecx, edx"], [9, "mov edx, offset a07u"], [10, "mov esi, 10h"], [11, "mov rdi, rax"], [12, "mov eax, 0"], [13, "call _snprintf"], [14, "mov rdx, cs:qword_4120C8"], [15, "mov rax, [rbp+var_88]"], [16, "movq xmm0, rdx"], [17, "mov rdi, rax"], [18, "call _cairo_set_font_size"], [19, "movsd xmm2, cs:qword_412118"], [20, "movsd xmm1, cs:qword_411FF8"], [21, "movsd xmm0, cs:qword_411FF8"], [22, "mov rdx, cs:qword_411FF8"], [23, "mov rax, [rbp+var_88]"], [24, "movapd xmm3, xmm2"], [25, "movapd xmm2, xmm1"], [26, "movapd xmm1, xmm0"], [27, "movq xmm0, rdx"], [28, "mov rdi, rax"], [29, "call _cairo_set_source_rgba"], [30, "lea rdx, [rbp+var_50]"], [31, "mov rax, [rbp+var_88]"], [32, "mov esi, offset a0000000"], [33, "mov rdi, rax"], [34, "call _cairo_text_extents"], [35, "mov eax, cs:dword_434C68"], [36, "sub eax, 8"], [37, "pxor xmm2, xmm2"], [38, "cvtsi2sd xmm2, eax"], [39, "mov eax, cs:dword_434C64"], [40, "pxor xmm0, xmm0"], [41, "cvtsi2sd xmm0, eax"], [42, "movsd xmm1, [rbp+var_40]"], [43, "subsd xmm0, xmm1"], [44, "movsd xmm1, cs:qword_412038"], [45, "subsd xmm0, xmm1"], [46, "movq rdx, xmm0"], [47, "mov rax, [rbp+var_88]"], [48, "movapd xmm1, xmm2"], [49, "movq xmm0, rdx"], [50, "mov rdi, rax"], [51, "call _cairo_move_to"], [52, "lea rdx, [rbp+s]"], [53, "mov rax, [rbp+var_88]"], [54, "mov rsi, rdx"], [55, "mov rdi, rax"], [56, "call _cairo_show_text"], [57, "mov eax, [rbp+var_90]"], [58, "mov eax, eax"], [59, "imul rax, 10624DD3h"], [60, "shr rax, 20h"], [61, "shr eax, 6"], [62, "mov [rbp+var_4], eax"], [63, "mov eax, [rbp+var_90]"], [64, "mov edx, eax"], [65, "imul rdx, 10624DD3h"], [66, "shr rdx, 20h"], [67, "shr edx, 6"], [68, "imul edx, 3E8h"], [69, "sub eax, edx"], [70, "mov [rbp+var_90], eax"], [71, "mov eax, [rbp+var_4]"], [72, "movsxd rdx, eax"], [73, "imul rdx, 0FFFFFFFF88888889h"], [74, "shr rdx, 20h"], [75, "add edx, eax"], [76, "sar edx, 5"], [77, "sar eax, 1Fh"], [78, "mov ecx, eax"], [79, "mov eax, edx"], [80, "sub eax, ecx"], [81, "mov [rbp+var_8], eax"], [82, "mov eax, [rbp+var_4]"], [83, "movsxd rdx, eax"], [84, "imul rdx, 0FFFFFFFF88888889h"], [85, "shr rdx, 20h"], [86, "add edx, eax"], [87, "sar edx, 5"], [88, "mov ecx, eax"], [89, "sar ecx, 1Fh"], [90, "sub edx, ecx"], [91, "imul edx, 3Ch "], [92, "sub eax, edx"], [93, "mov [rbp+var_4], eax"], [94, "mov esi, [rbp+var_90]"], [95, "mov ecx, [rbp+var_4]"], [96, "mov edx, [rbp+var_8]"], [97, "lea rax, [rbp+s]"], [98, "mov r9d, esi"], [99, "mov r8d, ecx"], [100, "mov ecx, edx"], [101, "mov edx, offset a02d02d03d"], [102, "mov esi, 10h"], [103, "mov rdi, rax"], [104, "mov eax, 0"], [105, "call _snprintf"], [106, "lea rdx, [rbp+var_80]"], [107, "mov rax, [rbp+var_88]"], [108, "mov esi, offset a0000000_0"], [109, "mov rdi, rax"], [110, "call _cairo_text_extents"], [111, "mov eax, cs:dword_434C68"], [112, "sub eax, 8"], [113, "pxor xmm0, xmm0"], [114, "cvtsi2sd xmm0, eax"], [115, "movsd xmm1, [rbp+var_38]"], [116, "subsd xmm0, xmm1"], [117, "movsd xmm1, cs:qword_412038"], [118, "movapd xmm2, xmm0"], [119, "subsd xmm2, xmm1"], [120, "mov eax, cs:dword_434C64"], [121, "pxor xmm0, xmm0"], [122, "cvtsi2sd xmm0, eax"], [123, "movsd xmm1, [rbp+var_70]"], [124, "subsd xmm0, xmm1"], [125, "movsd xmm1, cs:qword_412038"], [126, "subsd xmm0, xmm1"], [127, "movq rdx, xmm0"], [128, "mov rax, [rbp+var_88]"], [129, "movapd xmm1, xmm2"], [130, "movq xmm0, rdx"], [131, "mov rdi, rax"], [132, "call _cairo_move_to"], [133, "lea rdx, [rbp+s]"], [134, "mov rax, [rbp+var_88]"], [135, "mov rsi, rdx"], [136, "mov rdi, rax"], [137, "call _cairo_show_text"], [138, "nop"], [139, "leave"], [140, "retn"]], "data_dep": [[6, 4], [8, 6], [11, 7], [15, 3], [16, 14], [17, 15], [23, 3], [24, 19], [25, 20], [26, 21], [27, 22], [28, 23], [30, 22], [31, 3], [33, 31], [36, 35], [38, 36], [38, 37], [41, 40], [41, 39], [43, 41], [43, 42], [45, 43], [45, 44], [46, 45], [47, 3], [48, 38], [49, 46], [50, 47], [52, 46], [53, 3], [54, 52], [55, 53], [57, 5], [58, 57], [59, 58], [60, 59], [61, 60], [62, 61], [63, 5], [64, 63], [65, 64], [66, 65], [67, 66], [68, 67], [69, 68], [69, 63], [70, 69], [71, 62], [72, 71], [73, 72], [74, 73], [75, 74], [75, 71], [76, 75], [77, 71], [78, 77], [79, 76], [80, 78], [80, 79], [81, 80], [82, 62], [83, 82], [84, 83], [85, 84], [86, 85], [86, 82], [87, 86], [88, 82], [89, 88], [90, 87], [90, 89], [91, 90], [92, 82], [92, 91], [93, 92], [94, 70], [95, 93], [96, 81], [97, 92], [98, 94], [99, 95], [100, 96], [103, 97], [106, 101], [107, 3], [109, 107], [112, 111], [114, 113], [114, 112], [116, 115], [116, 114], [118, 116], [119, 118], [119, 117], [122, 121], [122, 120], [124, 122], [124, 123], [126, 125], [126, 124], [127, 126], [128, 3], [129, 119], [130, 127], [131, 128], [133, 127], [134, 3], [135, 133], [136, 134], [140, 137]]}
| {"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_40A8C1", "query": "\n\n\n__int64 __fastcall sub_40A8C1(__int64 a1, unsigned int a2, unsigned int a3)\n{\nchar s[24]; // [rsp+70h] [rbp-20h] BYREF\nunsigned int v6; // [rsp+88h] [rbp-8h]\nunsigned int v7; // [rsp+8Ch] [rbp-4h]\n\nsnprintf(s, 0x10uLL, \"#%07u\", a2);\ncairo_set_font_size();\ncairo_set_source_rgba();\ncairo_text_extents();\ncairo_move_to();\ncairo_show_text();\nv6 = (int)(a3 / 0x3E8) / 60;\nv7 = (int)(a3 / 0x3E8) % 60;\nsnprintf(s, 0x10uLL, \"%02d:%02d.%03d\", v6, v7, a3 % 0x3E8);\ncairo_text_extents();\ncairo_move_to();\nreturn cairo_show_text();\n}\n\n\n\nQ:[a3,a2,a1,s,v6,v7,sub_40A8C1,]", "hints": "[]", "response": "{'a3': 'frameTimeMsec', 'a2': 'frameIndex', 'a1': 'cr', 's': 'frameNumberBuf', 'v6': 'frameMins', 'v7': 'frameSec', 'sub_40A8C1': 'drawFrameLabel'}"} | [
[
0.7806264162063599,
0.7785145044326782,
0.7772313356399536,
0.7742747068405151,
0.7602198123931885,
0.7573845982551575,
0.7557152509689331,
0.7541440725326538,
0.7527952790260315,
0.7517948150634766,
0.7515472769737244,
0.7508640289306641,
0.749388575553894,
0.7458682060241699,
0.745364785194397,
0.7449141144752502,
0.7447398900985718,
0.7406762838363647,
0.7384427785873413,
0.7366714477539062
],
[
143317,
254232,
207676,
198000,
252153,
173795,
190488,
101261,
184833,
65702,
24369,
60921,
237035,
264013,
64227,
229406,
115937,
55175,
149933,
33399
]
] |
|
get_precedence | 7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53 | kgabis | ape | NA | static precedence_t get_precedence(token_type_t tk) {
switch (tk) {
case TOKEN_EQ: return PRECEDENCE_EQUALS;
case TOKEN_NOT_EQ: return PRECEDENCE_EQUALS;
case TOKEN_LT: return PRECEDENCE_LESSGREATER;
case TOKEN_LTE: return PRECEDENCE_LESSGREATER;
case TOKEN_GT: return PRECEDENCE_LESSGREATER;
case TOKEN_GTE: return PRECEDENCE_LESSGREATER;
case TOKEN_PLUS: return PRECEDENCE_SUM;
case TOKEN_MINUS: return PRECEDENCE_SUM;
case TOKEN_SLASH: return PRECEDENCE_PRODUCT;
case TOKEN_ASTERISK: return PRECEDENCE_PRODUCT;
case TOKEN_PERCENT: return PRECEDENCE_PRODUCT;
case TOKEN_LPAREN: return PRECEDENCE_POSTFIX;
case TOKEN_LBRACKET: return PRECEDENCE_POSTFIX;
case TOKEN_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_PLUS_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_MINUS_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_ASTERISK_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_SLASH_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_PERCENT_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_BIT_AND_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_BIT_OR_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_BIT_XOR_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_LSHIFT_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_RSHIFT_ASSIGN: return PRECEDENCE_ASSIGN;
case TOKEN_DOT: return PRECEDENCE_POSTFIX;
case TOKEN_AND: return PRECEDENCE_LOGICAL_AND;
case TOKEN_OR: return PRECEDENCE_LOGICAL_OR;
case TOKEN_BIT_OR: return PRECEDENCE_BIT_OR;
case TOKEN_BIT_XOR: return PRECEDENCE_BIT_XOR;
case TOKEN_BIT_AND: return PRECEDENCE_BIT_AND;
case TOKEN_LSHIFT: return PRECEDENCE_SHIFT;
case TOKEN_RSHIFT: return PRECEDENCE_SHIFT;
case TOKEN_QUESTION: return PRECEDENCE_TERNARY;
case TOKEN_PLUS_PLUS: return PRECEDENCE_INCDEC;
case TOKEN_MINUS_MINUS: return PRECEDENCE_INCDEC;
default: return PRECEDENCE_LOWEST;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40E03F", "function_addr": 4251711, "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], 2Ch"], [4, "ja def_40E05B"], [5, "mov eax, [rbp+var_4]"], [6, "mov rax, ds:jpt_40E05B[rax*8]"], [7, "jmp rax"], [8, "mov eax, 8"], [9, "jmp loc_40E18A"], [10, "mov eax, 8"], [11, "jmp loc_40E18A"], [12, "mov eax, 9"], [13, "jmp loc_40E18A"], [14, "mov eax, 9"], [15, "jmp loc_40E18A"], [16, "mov eax, 9"], [17, "jmp loc_40E18A"], [18, "mov eax, 9"], [19, "jmp loc_40E18A"], [20, "mov eax, 0Bh"], [21, "jmp loc_40E18A"], [22, "mov eax, 0Bh"], [23, "jmp loc_40E18A"], [24, "mov eax, 0Ch"], [25, "jmp loc_40E18A"], [26, "mov eax, 0Ch"], [27, "jmp loc_40E18A"], [28, "mov eax, 0Ch"], [29, "jmp loc_40E18A"], [30, "mov eax, 0Fh"], [31, "jmp loc_40E18A"], [32, "mov eax, 0Fh"], [33, "jmp loc_40E18A"], [34, "mov eax, 1"], [35, "jmp loc_40E18A"], [36, "mov eax, 1"], [37, "jmp loc_40E18A"], [38, "mov eax, 1"], [39, "jmp loc_40E18A"], [40, "mov eax, 1"], [41, "jmp loc_40E18A"], [42, "mov eax, 1"], [43, "jmp short loc_40E18A"], [44, "mov eax, 1"], [45, "jmp short loc_40E18A"], [46, "mov eax, 1"], [47, "jmp short loc_40E18A"], [48, "mov eax, 1"], [49, "jmp short loc_40E18A"], [50, "mov eax, 1"], [51, "jmp short loc_40E18A"], [52, "mov eax, 1"], [53, "jmp short loc_40E18A"], [54, "mov eax, 1"], [55, "jmp short loc_40E18A"], [56, "mov eax, 0Fh"], [57, "jmp short loc_40E18A"], [58, "mov eax, 4"], [59, "jmp short loc_40E18A"], [60, "mov eax, 3"], [61, "jmp short loc_40E18A"], [62, "mov eax, 5"], [63, "jmp short loc_40E18A"], [64, "mov eax, 6"], [65, "jmp short loc_40E18A"], [66, "mov eax, 7"], [67, "jmp short loc_40E18A"], [68, "mov eax, 0Ah"], [69, "jmp short loc_40E18A"], [70, "mov eax, 0Ah"], [71, "jmp short loc_40E18A"], [72, "mov eax, 2"], [73, "jmp short loc_40E18A"], [74, "mov eax, 0Eh"], [75, "jmp short loc_40E18A"], [76, "mov eax, 0Eh"], [77, "jmp short loc_40E18A"], [78, "mov eax, 0"], [79, "pop rbp"], [80, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 2], [7, 6], [79, 0], [80, 50], [80, 56], [80, 62], [80, 68], [80, 10], [80, 16], [80, 22], [80, 74], [80, 28], [80, 34], [80, 40], [80, 46], [80, 52], [80, 58], [80, 64], [80, 70], [80, 12], [80, 18], [80, 76], [80, 24], [80, 30], [80, 36], [80, 42], [80, 48], [80, 54], [80, 60], [80, 8], [80, 66], [80, 72], [80, 14], [80, 20], [80, 78], [80, 26], [80, 32], [80, 38], [80, 44]]}
| {"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_40E03F", "query": "\n\n\n__int64 __fastcall sub_40E03F(int a1)\n{\n__int64 result; // rax\n\nswitch ( a1 )\n{\ncase 2:\nresult = 1LL;\nbreak;\ncase 3:\nresult = 1LL;\nbreak;\ncase 4:\nresult = 1LL;\nbreak;\ncase 5:\nresult = 1LL;\nbreak;\ncase 6:\nresult = 1LL;\nbreak;\ncase 7:\nresult = 1LL;\nbreak;\ncase 8:\nresult = 1LL;\nbreak;\ncase 9:\nresult = 1LL;\nbreak;\ncase 10:\nresult = 1LL;\nbreak;\ncase 11:\nresult = 1LL;\nbreak;\ncase 12:\nresult = 1LL;\nbreak;\ncase 13:\nresult = 2LL;\nbreak;\ncase 14:\nresult = 11LL;\nbreak;\ncase 15:\nresult = 14LL;\nbreak;\ncase 16:\nresult = 11LL;\nbreak;\ncase 17:\nresult = 14LL;\nbreak;\ncase 19:\nresult = 12LL;\nbreak;\ncase 20:\nresult = 12LL;\nbreak;\ncase 21:\nresult = 9LL;\nbreak;\ncase 22:\nresult = 9LL;\nbreak;\ncase 23:\nresult = 9LL;\nbreak;\ncase 24:\nresult = 9LL;\nbreak;\ncase 25:\nresult = 8LL;\nbreak;\ncase 26:\nresult = 8LL;\nbreak;\ncase 27:\nresult = 4LL;\nbreak;\ncase 28:\nresult = 3LL;\nbreak;\ncase 29:\nresult = 7LL;\nbreak;\ncase 30:\nresult = 5LL;\nbreak;\ncase 31:\nresult = 6LL;\nbreak;\ncase 32:\nresult = 10LL;\nbreak;\ncase 33:\nresult = 10LL;\nbreak;\ncase 37:\nresult = 15LL;\nbreak;\ncase 41:\nresult = 15LL;\nbreak;\ncase 43:\nresult = 15LL;\nbreak;\ncase 44:\nresult = 12LL;\nbreak;\ndefault:\nresult = 0LL;\nbreak;\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_40E03F,]", "hints": "[]", "response": "{'a1': 'tk', 'sub_40E03F': 'get_precedence'}"} | [
[
0.8318209648132324,
0.8315476775169373,
0.8270641565322876,
0.8198503255844116,
0.8160558938980103,
0.8152783513069153,
0.812987744808197,
0.8115820288658142,
0.8078140020370483,
0.8075041770935059,
0.8070353865623474,
0.806081235408783,
0.8004351258277893,
0.795785129070282,
0.786922812461853,
0.7856448888778687,
0.7837553024291992,
0.7798834443092346,
0.7737898826599121,
0.7717547416687012
],
[
46015,
255891,
146196,
54940,
115519,
171202,
94655,
161781,
243613,
209809,
132079,
26898,
111124,
103521,
97295,
11061,
218289,
169078,
252510,
78222
]
] |
|
term_set_flowcntrl | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | int
term_set_flowcntrl (int fd, enum flowcntrl_e flowcntl)
{
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 (flowcntl) {
case FC_RTSCTS:
tiop->c_cflag |= CRTSCTS;
tiop->c_iflag &= ~(IXON | IXOFF | IXANY);
break;
case FC_XONXOFF:
tiop->c_cflag &= ~(CRTSCTS);
tiop->c_iflag |= IXON | IXOFF;
break;
case FC_NONE:
tiop->c_cflag &= ~(CRTSCTS);
tiop->c_iflag &= ~(IXON | IXOFF | IXANY);
break;
default:
term_errno = TERM_EFLOW;
rval = -1;
break;
}
if ( rval < 0 ) break;
} while (0);
return rval;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4073EB", "function_addr": 4223979, "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_40741F"], [12, "mov [rbp+var_4], 0FFFFFFFFh"], [13, "jmp loc_4074F7"], [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], 2"], [27, "jz short loc_407491"], [28, "cmp [rbp+var_18], 2"], [29, "ja loc_4074E1"], [30, "cmp [rbp+var_18], 0"], [31, "jz short loc_4074B9"], [32, "cmp [rbp+var_18], 1"], [33, "jnz short loc_4074E1"], [34, "mov rax, [rbp+var_10]"], [35, "mov eax, [rax+8]"], [36, "or eax, 80000000h"], [37, "mov edx, eax"], [38, "mov rax, [rbp+var_10]"], [39, "mov [rax+8], edx"], [40, "mov rax, [rbp+var_10]"], [41, "mov eax, [rax]"], [42, "and ah, 0E3h"], [43, "mov edx, eax"], [44, "mov rax, [rbp+var_10]"], [45, "mov [rax], edx"], [46, "jmp short loc_4074F3"], [47, "mov rax, [rbp+var_10]"], [48, "mov eax, [rax+8]"], [49, "and eax, 7FFFFFFFh"], [50, "mov edx, eax"], [51, "mov rax, [rbp+var_10]"], [52, "mov [rax+8], edx"], [53, "mov rax, [rbp+var_10]"], [54, "mov eax, [rax]"], [55, "or ah, 14h"], [56, "mov edx, eax"], [57, "mov rax, [rbp+var_10]"], [58, "mov [rax], edx"], [59, "jmp short loc_4074F3"], [60, "mov rax, [rbp+var_10]"], [61, "mov eax, [rax+8]"], [62, "and eax, 7FFFFFFFh"], [63, "mov edx, eax"], [64, "mov rax, [rbp+var_10]"], [65, "mov [rax+8], edx"], [66, "mov rax, [rbp+var_10]"], [67, "mov eax, [rax]"], [68, "and ah, 0E3h"], [69, "mov edx, eax"], [70, "mov rax, [rbp+var_10]"], [71, "mov [rax], edx"], [72, "jmp short loc_4074F3"], [73, "mov cs:dword_40CBA0, 0Fh"], [74, "mov [rbp+var_4], 0FFFFFFFFh"], [75, "nop"], [76, "cmp [rbp+var_4], 0"], [77, "mov eax, [rbp+var_4]"], [78, "leave"], [79, "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, 15], [20, 19], [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, 25], [35, 34], [36, 35], [37, 36], [38, 25], [39, 37], [39, 38], [40, 25], [41, 40], [41, 39], [42, 41], [43, 42], [44, 25], [45, 43], [45, 44], [47, 25], [48, 47], [49, 48], [50, 49], [51, 25], [52, 51], [52, 50], [53, 25], [54, 53], [54, 52], [55, 54], [56, 55], [57, 25], [58, 56], [58, 57], [60, 25], [61, 60], [62, 61], [63, 62], [64, 25], [65, 63], [65, 64], [66, 25], [67, 65], [67, 66], [68, 67], [69, 68], [70, 25], [71, 69], [71, 70], [76, 74], [76, 5], [77, 12], [77, 5], [77, 74], [79, 77]]}
| {"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_4073EB", "query": "\n\n\n__int64 __fastcall sub_4073EB(int a1, unsigned int a2)\n{\nint v2; // eax\nint v3; // eax\nint v5; // [rsp+10h] [rbp-8h]\nunsigned int v6; // [rsp+14h] [rbp-4h]\n\nv6 = 0;\nv5 = sub_4065BD(a1);\nif ( v5 < 0 )\nreturn (unsigned int)-1;\nif ( a2 == 2 )\n{\n*((_DWORD *)&unk_40D18C + 11 * v5) &= 0x7FFFFFFFu;\nv3 = *((_DWORD *)&unk_40D184 + 11 * v5);\nBYTE1(v3) |= 0x14u;\n*((_DWORD *)&unk_40D184 + 11 * v5) = v3;\n}\nelse if ( a2 > 2 )\n{\ndword_40CBA0 = 15;\nv6 = -1;\n}\nelse\n{\nif ( a2 )\n*((_DWORD *)&unk_40D18C + 11 * v5) |= 0x80000000;\nelse\n*((_DWORD *)&unk_40D18C + 11 * v5) &= 0x7FFFFFFFu;\nv2 = *((_DWORD *)&unk_40D184 + 11 * v5);\nBYTE1(v2) &= 0xE3u;\n*((_DWORD *)&unk_40D184 + 11 * v5) = v2;\n}\nreturn v6;\n}\n\n\n\nQ:[a1,a2,v6,sub_4073EB,sub_4065BD,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'flowcntl', 'v6': 'rval', 'sub_4073EB': 'term_set_flowcntrl', 'sub_4065BD': 'term_find'}"} | [
[
0.758648157119751,
0.7197058796882629,
0.710730791091919,
0.7076947689056396,
0.7021902203559875,
0.6998525857925415,
0.69869464635849,
0.6979480385780334,
0.6959735155105591,
0.6937488913536072,
0.692245602607727,
0.6843550801277161,
0.6795351505279541,
0.6743091344833374,
0.6738520860671997,
0.6724356412887573,
0.6614924669265747,
0.6605096459388733,
0.660060465335846,
0.6591877937316895
],
[
202569,
2093,
253040,
58168,
201591,
88438,
231336,
134253,
83033,
164210,
175052,
55017,
188579,
102680,
218322,
249170,
160081,
75527,
51796,
162140
]
] |
|
send_fake_payload | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | static void send_fake_payload(
const char *src_ip, unsigned short src_port,
const char *dst_ip, unsigned short dst_port,
unsigned int seq_num, unsigned int ack_num)
{
char pkt[MAX_PACKET_SIZE];
struct send_tcp_vars 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 = htonl(ntohl(seq_num) + (rand() % 10000000 + 1000000));
vars.ack_num = ack_num;
//vars.wrong_tcp_checksum = 1;
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 = 1;
vars.payload[0] = 'A';
//dump_send_tcp_vars(&vars);
send_tcp(&vars);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41BB23", "function_addr": 4307747, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 20B8h"], [4, "mov [rbp+src], rdi"], [5, "mov [rbp+var_20B8], rdx"], [6, "mov eax, ecx"], [7, "mov [rbp+netlong], r8d"], [8, "mov [rbp+var_20C0], r9d"], [9, "mov edx, esi"], [10, "mov [rbp+var_20AC], dx"], [11, "mov [rbp+var_20B0], ax"], [12, "lea rax, [rbp+s]"], [13, "mov edx, 1064h"], [14, "mov esi, 0"], [15, "mov rdi, rax"], [16, "call _memset"], [17, "mov rcx, [rbp+src]"], [18, "lea rax, [rbp+s]"], [19, "mov edx, 10h"], [20, "mov rsi, rcx"], [21, "mov rdi, rax"], [22, "call _strncpy"], [23, "mov rax, [rbp+var_20B8]"], [24, "lea rdx, [rbp+s]"], [25, "lea rcx, [rdx+10h]"], [26, "mov edx, 10h"], [27, "mov rsi, rax"], [28, "mov rdi, rcx"], [29, "call _strncpy"], [30, "movzx eax, [rbp+var_20AC]"], [31, "mov [rbp+var_205C], ax"], [32, "movzx eax, [rbp+var_20B0]"], [33, "mov [rbp+var_205A], ax"], [34, "mov [rbp+var_204D], 10h"], [35, "mov eax, [rbp+netlong]"], [36, "mov edi, eax"], [37, "call _ntohl"], [38, "mov ebx, eax"], [39, "call _rand"], [40, "movsxd rdx, eax"], [41, "imul rdx, 6B5FCA6Bh"], [42, "shr rdx, 20h"], [43, "sar edx, 16h"], [44, "mov ecx, eax"], [45, "sar ecx, 1Fh"], [46, "sub edx, ecx"], [47, "imul ecx, edx, 989680h"], [48, "sub eax, ecx"], [49, "mov edx, eax"], [50, "mov eax, edx"], [51, "add eax, ebx"], [52, "add eax, 0F4240h"], [53, "mov edi, eax"], [54, "call _htonl"], [55, "mov [rbp+var_2058], eax"], [56, "mov eax, [rbp+var_20C0]"], [57, "mov [rbp+var_2054], eax"], [58, "mov rax, 15A6DD5C89F91213h"], [59, "mov rdx, 44332211933E8312h"], [60, "mov [rbp+var_20A0], rax"], [61, "mov [rbp+var_2098], rdx"], [62, "mov [rbp+var_2090], 1016655h"], [63, "mov rax, [rbp+var_20A0]"], [64, "mov rdx, [rbp+var_2098]"], [65, "mov [rbp+var_2049], rax"], [66, "mov [rbp+var_2041], rdx"], [67, "mov eax, [rbp+var_2090]"], [68, "mov [rbp+var_2039], eax"], [69, "mov [rbp+var_2021], 14h"], [70, "mov [rbp+var_1020], 1"], [71, "mov [rbp+var_2020], 41h "], [72, "lea rax, [rbp+s]"], [73, "mov rdi, rax"], [74, "call sub_407CE9"], [75, "nop"], [76, "mov rbx, [rbp+var_8]"], [77, "leave"], [78, "retn"]], "data_dep": [[10, 9], [11, 6], [12, 6], [15, 12], [17, 4], [18, 16], [20, 17], [21, 18], [23, 5], [24, 19], [25, 24], [25, 17], [27, 23], [28, 25], [30, 10], [31, 30], [32, 11], [33, 32], [35, 7], [36, 35], [38, 37], [40, 39], [41, 40], [42, 41], [43, 42], [44, 39], [45, 44], [46, 45], [46, 43], [47, 46], [47, 45], [48, 39], [48, 47], [49, 48], [50, 49], [51, 38], [51, 50], [52, 51], [53, 52], [55, 54], [56, 8], [57, 56], [60, 58], [61, 59], [63, 60], [64, 61], [65, 63], [66, 64], [67, 62], [68, 67], [72, 67], [73, 72], [78, 74]]}
| {"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_41BB23", "query": "\n\n\nint __fastcall sub_41BB23(const char *a1, __int16 a2, const char *a3, __int16 a4, uint32_t a5, int a6)\n{\nuint32_t v6; // ebx\nint v7; // eax\nchar s[16]; // [rsp+40h] [rbp-2080h] BYREF\nchar v14[20]; // [rsp+50h] [rbp-2070h] BYREF\n__int16 v15; // [rsp+64h] [rbp-205Ch]\n__int16 v16; // [rsp+66h] [rbp-205Ah]\nuint32_t v17; // [rsp+68h] [rbp-2058h]\nint v18; // [rsp+6Ch] [rbp-2054h]\nchar v19; // [rsp+73h] [rbp-204Dh]\n__int64 v20; // [rsp+77h] [rbp-2049h]\n__int64 v21; // [rsp+7Fh] [rbp-2041h]\nint v22; // [rsp+87h] [rbp-2039h]\nchar v23; // [rsp+9Fh] [rbp-2021h]\nchar v24; // [rsp+A0h] [rbp-2020h]\n__int16 v25; // [rsp+10A0h] [rbp-1020h]\n\nmemset(s, 0, 0x1064uLL);\nstrncpy(s, a1, 0x10uLL);\nstrncpy(v14, a3, 0x10uLL);\nv15 = a2;\nv16 = a4;\nv19 = 16;\nv6 = ntohl(a5);\nv7 = rand();\nv17 = htonl(v6 + v7 % 10000000 + 1000000);\nv18 = a6;\nv20 = 0x15A6DD5C89F91213LL;\nv21 = 0x44332211933E8312LL;\nv22 = 16868949;\nv23 = 20;\nv25 = 1;\nv24 = 65;\nreturn sub_407CE9((__int64)s);\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,s,sub_41BB23,sub_407CE9,]", "hints": "[]", "response": "{'a3': 'dst_ip', 'a4': 'dst_port', 'a1': 'src_ip', 'a2': 'src_port', 'a5': 'seq_num', 'a6': 'ack_num', 's': 'vars', 'sub_41BB23': 'send_fake_payload_4', 'sub_407CE9': 'send_tcp'}"} | [
[
0.7816205620765686,
0.7753223180770874,
0.751196563243866,
0.7470322251319885,
0.7459614872932434,
0.7426484823226929,
0.7408325672149658,
0.7391879558563232,
0.7205966114997864,
0.7188234329223633,
0.7177385091781616,
0.7157794833183289,
0.7151811122894287,
0.712995171546936,
0.7116928696632385,
0.7112135291099548,
0.7102032899856567,
0.707607090473175,
0.7062890529632568,
0.7055639028549194
],
[
167885,
229090,
245548,
128541,
52397,
259604,
206207,
1220,
125240,
48389,
263576,
244531,
199613,
230762,
194087,
145904,
132472,
153977,
69447,
81595
]
] |
|
arm_scale_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_scale_q31(
const q31_t *pSrc,
q31_t scaleFract,
int8_t shift,
q31_t *pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
q31_t in, out; /* Temporary variables */
int8_t kShift = shift + 1; /* Shift to apply after scaling */
int8_t sign = (kShift & 0x80);
#if defined (ARM_MATH_LOOPUNROLL)
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A * scale */
/* Scale input and store result in destination buffer. */
in = *pSrc++; /* read input from source */
in = ((q63_t) in * scaleFract) >> 32; /* multiply input with scaler value */
out = in << kShift; /* apply shifting */
if (in != (out >> kShift)) /* saturate the result */
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out; /* Store result destination */
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in << kShift;
if (in != (out >> kShift))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in << kShift;
if (in != (out >> kShift))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in << kShift;
if (in != (out >> kShift))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A * scale */
/* Scale input and store result in destination buffer. */
in = *pSrc++; /* read four inputs from source */
in = ((q63_t) in * scaleFract) >> 32; /* multiply input with scaler value */
out = in >> -kShift; /* apply shifting */
*pDst++ = out; /* Store result destination */
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in >> -kShift;
*pDst++ = out;
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in >> -kShift;
*pDst++ = out;
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in >> -kShift;
*pDst++ = out;
/* 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) */
if (sign == 0U)
{
while (blkCnt > 0U)
{
/* C = A * scale */
/* Scale input and store result in destination buffer. */
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in << kShift;
if (in != (out >> kShift))
out = 0x7FFFFFFF ^ (in >> 31);
*pDst++ = out;
/* Decrement loop counter */
blkCnt--;
}
}
else
{
while (blkCnt > 0U)
{
/* C = A * scale */
/* Scale input and store result in destination buffer. */
in = *pSrc++;
in = ((q63_t) in * scaleFract) >> 32;
out = in >> -kShift;
*pDst++ = out;
/* Decrement loop counter */
blkCnt--;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4205E6", "function_addr": 4326886, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.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 eax, edx"], [5, "mov [rbp+var_28], rcx"], [6, "mov [rbp+var_2C], r8d"], [7, "mov [rbp+var_20], al"], [8, "movzx eax, [rbp+var_20]"], [9, "add eax, 1"], [10, "mov [rbp+var_9], al"], [11, "movzx eax, [rbp+var_9]"], [12, "and eax, 0FFFFFF80h"], [13, "mov [rbp+var_A], al"], [14, "mov eax, [rbp+var_2C]"], [15, "mov [rbp+var_4], eax"], [16, "cmp [rbp+var_A], 0"], [17, "jnz loc_4206E6"], [18, "jmp short loc_420690"], [19, "mov rax, [rbp+var_18]"], [20, "lea rdx, [rax+4]"], [21, "mov [rbp+var_18], rdx"], [22, "mov eax, [rax]"], [23, "mov [rbp+var_10], eax"], [24, "mov eax, [rbp+var_10]"], [25, "movsxd rdx, eax"], [26, "mov eax, [rbp+var_1C]"], [27, "cdqe"], [28, "imul rax, rdx"], [29, "sar rax, 20h"], [30, "mov [rbp+var_10], eax"], [31, "movsx eax, [rbp+var_9]"], [32, "mov edx, [rbp+var_10]"], [33, "mov ecx, eax"], [34, "shl edx, cl"], [35, "mov eax, edx"], [36, "mov [rbp+var_8], eax"], [37, "movsx eax, [rbp+var_9]"], [38, "mov edx, [rbp+var_8]"], [39, "mov ecx, eax"], [40, "sar edx, cl"], [41, "mov eax, edx"], [42, "cmp [rbp+var_10], eax"], [43, "jz short loc_42067B"], [44, "mov eax, [rbp+var_10]"], [45, "sar eax, 1Fh"], [46, "xor eax, 7FFFFFFFh"], [47, "mov [rbp+var_8], eax"], [48, "mov rax, [rbp+var_28]"], [49, "lea rdx, [rax+4]"], [50, "mov [rbp+var_28], rdx"], [51, "mov edx, [rbp+var_8]"], [52, "mov [rax], edx"], [53, "sub [rbp+var_4], 1"], [54, "cmp [rbp+var_4], 0"], [55, "jnz short loc_420624"], [56, "jmp short loc_4206EC"], [57, "mov rax, [rbp+var_18]"], [58, "lea rdx, [rax+4]"], [59, "mov [rbp+var_18], rdx"], [60, "mov eax, [rax]"], [61, "mov [rbp+var_10], eax"], [62, "mov eax, [rbp+var_10]"], [63, "movsxd rdx, eax"], [64, "mov eax, [rbp+var_1C]"], [65, "cdqe"], [66, "imul rax, rdx"], [67, "sar rax, 20h"], [68, "mov [rbp+var_10], eax"], [69, "movsx eax, [rbp+var_9]"], [70, "neg eax"], [71, "mov edx, [rbp+var_10]"], [72, "mov ecx, eax"], [73, "sar edx, cl"], [74, "mov eax, edx"], [75, "mov [rbp+var_8], eax"], [76, "mov rax, [rbp+var_28]"], [77, "lea rdx, [rax+4]"], [78, "mov [rbp+var_28], rdx"], [79, "mov edx, [rbp+var_8]"], [80, "mov [rax], edx"], [81, "sub [rbp+var_4], 1"], [82, "cmp [rbp+var_4], 0"], [83, "jnz short loc_420698"], [84, "nop"], [85, "pop rbp"], [86, "retn"]], "data_dep": [[7, 4], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 6], [15, 14], [16, 13], [17, 16], [19, 2], [19, 21], [20, 51], [20, 19], [20, 52], [21, 20], [22, 19], [22, 52], [23, 22], [24, 23], [25, 24], [26, 3], [28, 25], [28, 26], [29, 28], [30, 29], [31, 10], [32, 30], [33, 31], [34, 32], [34, 33], [35, 34], [36, 35], [37, 10], [38, 36], [39, 37], [40, 38], [40, 39], [41, 40], [42, 41], [42, 30], [43, 42], [44, 30], [45, 44], [46, 45], [47, 46], [48, 5], [48, 50], [49, 48], [49, 52], [49, 40], [50, 49], [51, 36], [51, 47], [52, 51], [52, 48], [53, 15], [53, 53], [54, 15], [54, 53], [55, 54], [57, 2], [57, 59], [58, 80], [58, 57], [58, 79], [59, 58], [60, 80], [60, 57], [61, 60], [62, 61], [63, 62], [64, 3], [66, 64], [66, 63], [67, 66], [68, 67], [69, 10], [70, 69], [71, 68], [72, 70], [73, 71], [73, 72], [74, 73], [75, 74], [76, 5], [76, 78], [77, 76], [77, 80], [77, 73], [78, 77], [79, 75], [80, 76], [80, 79], [81, 15], [81, 81], [82, 15], [82, 81], [83, 82], [85, 0], [86, 76], [86, 48], [86, 14]]}
| {"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_4205E6", "query": "\n\n\nint *__fastcall sub_4205E6(int *a1, int a2, char a3, int *a4, unsigned int a5)\n{\nint *result; // rax\nint *v6; // rax\nint *v7; // rax\nint v10; // [rsp+1Ch] [rbp-10h]\nchar v11; // [rsp+23h] [rbp-9h]\nint v12; // [rsp+24h] [rbp-8h]\nint v13; // [rsp+24h] [rbp-8h]\nunsigned int v14; // [rsp+28h] [rbp-4h]\n\nv11 = a3 + 1;\nresult = (int *)a5;\nv14 = a5;\nif ( (char)(a3 + 1) < 0 )\n{\nwhile ( v14 )\n{\nv7 = a1++;\nv13 = (int)((unsigned __int64)(*v7 * (__int64)a2) >> 32) >> -v11;\nresult = a4++;\n*result = v13;\n--v14;\n}\n}\nelse\n{\nwhile ( v14 )\n{\nv6 = a1++;\nv10 = (unsigned __int64)(*v6 * (__int64)a2) >> 32;\nv12 = v10 << v11;\nif ( v10 != v10 << v11 >> v11 )\nv12 = (v10 >> 31) ^ 0x7FFFFFFF;\nresult = a4++;\n*result = v12;\n--v14;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,v10,v11,v12,sub_4205E6,]", "hints": "[]", "response": "{'a3': 'shift', 'a4': 'pDst', 'a1': 'pSrc', 'a2': 'scaleFract', 'a5': 'blockSize', 'v10': 'in', 'v11': 'kShift', 'v12': 'out', 'sub_4205E6': 'arm_scale_q31'}"} | [
[
0.7861627340316772,
0.777497410774231,
0.775824785232544,
0.7608085870742798,
0.7565634846687317,
0.755661129951477,
0.7542282938957214,
0.7479368448257446,
0.7471095323562622,
0.7437949180603027,
0.7416011095046997,
0.740085244178772,
0.7394786477088928,
0.7376644611358643,
0.7339715957641602,
0.7325354814529419,
0.7304363250732422,
0.7302961349487305,
0.729999840259552,
0.7296146154403687
],
[
172556,
139396,
4659,
53185,
249276,
69213,
155327,
93701,
49957,
96176,
215603,
237167,
73689,
118005,
16719,
240647,
23904,
78263,
21251,
70775
]
] |
|
ape_object_get_type | 7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53 | kgabis | ape | NA | ape_object_type_t ape_object_get_type(ape_object_t ape_obj) {
object_t obj = ape_object_to_object(ape_obj);
switch (object_get_type(obj)) {
case OBJECT_NONE: return APE_OBJECT_NONE;
case OBJECT_ERROR: return APE_OBJECT_ERROR;
case OBJECT_NUMBER: return APE_OBJECT_NUMBER;
case OBJECT_BOOL: return APE_OBJECT_BOOL;
case OBJECT_STRING: return APE_OBJECT_STRING;
case OBJECT_NULL: return APE_OBJECT_NULL;
case OBJECT_NATIVE_FUNCTION: return APE_OBJECT_NATIVE_FUNCTION;
case OBJECT_ARRAY: return APE_OBJECT_ARRAY;
case OBJECT_MAP: return APE_OBJECT_MAP;
case OBJECT_FUNCTION: return APE_OBJECT_FUNCTION;
case OBJECT_EXTERNAL: return APE_OBJECT_EXTERNAL;
case OBJECT_FREED: return APE_OBJECT_FREED;
case OBJECT_ANY: return APE_OBJECT_ANY;
default: return APE_OBJECT_NONE;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_422229", "function_addr": 4334121, "binary_name": "7fc81bc5e05805462160f0f7e72ba32357f81d09a102ced059628d2f6c88ce53.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 rdi, rax"], [6, "call sub_423466"], [7, "mov [rbp+var_8], rax"], [8, "mov rax, [rbp+var_8]"], [9, "mov rdi, rax"], [10, "call sub_417F9F"], [11, "cmp eax, 0FFFFh"], [12, "jz loc_422324"], [13, "cmp eax, 0FFFFh"], [14, "ja def_4222C7"], [15, "cmp eax, 400h"], [16, "jz loc_42231D"], [17, "cmp eax, 400h"], [18, "ja def_4222C7"], [19, "cmp eax, 200h"], [20, "jz loc_422316"], [21, "cmp eax, 200h"], [22, "ja def_4222C7"], [23, "cmp eax, 100h"], [24, "jz short loc_42230F"], [25, "cmp eax, 100h"], [26, "ja def_4222C7"], [27, "cmp eax, 80h"], [28, "jz short loc_422308"], [29, "cmp eax, 80h"], [30, "ja short def_4222C7"], [31, "cmp eax, 20h "], [32, "ja short loc_4222C9"], [33, "cmp eax, 20h"], [34, "ja short def_4222C7"], [35, "mov eax, eax"], [36, "mov rax, ds:jpt_4222C7[rax*8]"], [37, "jmp rax"], [38, "cmp eax, 40h "], [39, "jz short loc_422301"], [40, "jmp short def_4222C7"], [41, "mov eax, 0"], [42, "jmp short locret_422330"], [43, "mov eax, 1"], [44, "jmp short locret_422330"], [45, "mov eax, 2"], [46, "jmp short locret_422330"], [47, "mov eax, 4"], [48, "jmp short locret_422330"], [49, "mov eax, 8"], [50, "jmp short locret_422330"], [51, "mov eax, 10h"], [52, "jmp short locret_422330"], [53, "mov eax, 20h "], [54, "jmp short locret_422330"], [55, "mov eax, 40h "], [56, "jmp short locret_422330"], [57, "mov eax, 80h"], [58, "jmp short locret_422330"], [59, "mov eax, 100h"], [60, "jmp short locret_422330"], [61, "mov eax, 200h"], [62, "jmp short locret_422330"], [63, "mov eax, 400h"], [64, "jmp short locret_422330"], [65, "mov eax, 0FFFFh"], [66, "jmp short locret_422330"], [67, "mov eax, 0"], [68, "leave"], [69, "retn"]], "data_dep": [[4, 3], [5, 4], [7, 6], [8, 7], [9, 8], [11, 10], [12, 11], [13, 10], [14, 13], [15, 10], [16, 15], [17, 10], [18, 17], [19, 10], [20, 19], [21, 10], [22, 21], [23, 10], [24, 23], [25, 10], [26, 25], [27, 10], [28, 27], [29, 10], [30, 29], [31, 10], [32, 31], [33, 10], [34, 33], [35, 10], [37, 36], [38, 10], [39, 38], [69, 59], [69, 65], [69, 43], [69, 49], [69, 55], [69, 61], [69, 67], [69, 45], [69, 51], [69, 57], [69, 63], [69, 41], [69, 47], [69, 53]]}
| {"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_422229", "query": "\n\n\n__int64 __fastcall sub_422229(__int64 a1)\n{\nunsigned int v1; // eax\n__int64 result; // rax\nunsigned __int64 v3; // [rsp+18h] [rbp-8h]\n\nv3 = sub_423466(a1);\nv1 = sub_417F9F(v3);\nif ( v1 == 0xFFFF )\nreturn 0xFFFFLL;\nif ( v1 > 0xFFFF )\nreturn 0LL;\nif ( v1 == 1024 )\nreturn 1024LL;\nif ( v1 > 0x400 )\nreturn 0LL;\nif ( v1 == 512 )\nreturn 512LL;\nif ( v1 > 0x200 )\nreturn 0LL;\nif ( v1 == 256 )\nreturn 256LL;\nif ( v1 > 0x100 )\nreturn 0LL;\nif ( v1 == 128 )\nreturn 128LL;\nif ( v1 > 0x80 )\nreturn 0LL;\nif ( v1 > 0x20 )\n{\nif ( v1 == 64 )\nreturn 64LL;\nreturn 0LL;\n}\nswitch ( v1 )\n{\ncase 0u:\nresult = 0LL;\nbreak;\ncase 1u:\nresult = 1LL;\nbreak;\ncase 2u:\nresult = 2LL;\nbreak;\ncase 4u:\nresult = 4LL;\nbreak;\ncase 8u:\nresult = 8LL;\nbreak;\ncase 0x10u:\nresult = 16LL;\nbreak;\ncase 0x20u:\nresult = 32LL;\nbreak;\ndefault:\nreturn 0LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v3,sub_422229,sub_423466,sub_417F9F,]", "hints": "[]", "response": "{'a1': 'ape_obj', 'v3': 'obj', 'sub_422229': 'ape_object_get_type', 'sub_423466': 'ape_object_to_object', 'sub_417F9F': 'object_get_type'}"} | [
[
0.8578654527664185,
0.7683567404747009,
0.7616809010505676,
0.7418088316917419,
0.728614091873169,
0.72744220495224,
0.7247252464294434,
0.7241835594177246,
0.7202003598213196,
0.7147267460823059,
0.7098174095153809,
0.7022390365600586,
0.7015516757965088,
0.7012611031532288,
0.6985511183738708,
0.6978182792663574,
0.6971732378005981,
0.6958394050598145,
0.694414496421814,
0.6943244338035583
],
[
207701,
37645,
106001,
301,
376,
145476,
37600,
63525,
101148,
100070,
228686,
144048,
65943,
251553,
223193,
48330,
237876,
190033,
42666,
215527
]
] |
|
priv_sock_close | 89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6 | Tachone | Tachftp | NA | void priv_sock_close(session_t *sess)
{
if (sess->parent_fd != -1)
{
close(sess->parent_fd);
sess->parent_fd = -1;
}
if (sess->child_fd != -1)
{
close(sess->child_fd);
sess->child_fd = -1;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407779", "function_addr": 4224889, "binary_name": "89443bdfefd0d94018baec5d954a9a6aeca19ff5ba8e5f19dfc1e207d11131c6.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+858h]"], [6, "cmp eax, 0FFFFFFFFh"], [7, "jz short loc_4077B3"], [8, "mov rax, [rbp+var_8]"], [9, "mov eax, [rax+858h]"], [10, "mov edi, eax"], [11, "call _close"], [12, "mov rax, [rbp+var_8]"], [13, "mov dword ptr [rax+858h], 0FFFFFFFFh"], [14, "mov rax, [rbp+var_8]"], [15, "mov eax, [rax+85Ch]"], [16, "cmp eax, 0FFFFFFFFh"], [17, "jz short loc_4077E1"], [18, "mov rax, [rbp+var_8]"], [19, "mov eax, [rax+85Ch]"], [20, "mov edi, eax"], [21, "call _close"], [22, "mov rax, [rbp+var_8]"], [23, "mov dword ptr [rax+85Ch], 0FFFFFFFFh"], [24, "nop"], [25, "leave"], [26, "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], [15, 13], [16, 15], [17, 16], [18, 3], [19, 18], [19, 23], [19, 13], [20, 19], [22, 3], [23, 22], [26, 22], [26, 15]]}
| {"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_407779", "query": "\n\n\n__int64 __fastcall sub_407779(__int64 a1)\n{\n__int64 result; // rax\n\nif ( *(_DWORD *)(a1 + 2136) != -1 )\n{\nclose(*(_DWORD *)(a1 + 2136));\n*(_DWORD *)(a1 + 2136) = -1;\n}\nresult = *(unsigned int *)(a1 + 2140);\nif ( (_DWORD)result != -1 )\n{\nclose(*(_DWORD *)(a1 + 2140));\nresult = a1;\n*(_DWORD *)(a1 + 2140) = -1;\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_407779,]", "hints": "[]", "response": "{'a1': 'sess', 'sub_407779': 'priv_sock_close'}"} | [
[
0.8692842721939087,
0.8663336038589478,
0.8185489773750305,
0.8181493282318115,
0.8131254315376282,
0.8096157908439636,
0.8088487982749939,
0.8074729442596436,
0.8053286075592041,
0.794235110282898,
0.7872104048728943,
0.7862902283668518,
0.7843459844589233,
0.7813761234283447,
0.7725987434387207,
0.7715592384338379,
0.7647520303726196,
0.756409764289856,
0.7548822164535522,
0.7509670853614807
],
[
21863,
223746,
88312,
131672,
87998,
205110,
175494,
97672,
74706,
250505,
151767,
147009,
10450,
90871,
91144,
90464,
139696,
30485,
95827,
198974
]
] |
|
png_create_struct | 4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a | embecosm | mibench | NA | png_voidp
png_create_struct(uInt type)
{
size_t size;
png_voidp struct_ptr;
if (type == PNG_STRUCT_INFO)
size = sizeof(png_info);
else if (type == PNG_STRUCT_PNG)
size = sizeof(png_struct);
else
return (png_voidp)NULL;
#if defined(__TURBOC__) && !defined(__FLAT__)
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL)
# else
if ((struct_ptr = (png_voidp)malloc(size)) != NULL)
# endif
#endif
{
png_memset(struct_ptr, 0, size);
}
return (struct_ptr);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40EDA2", "function_addr": 4255138, "binary_name": "4b58bb905f42bf1b4392143f49979b18b390ebb44b12087a07242a7fbf0e831a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_14], edi"], [4, "cmp [rbp+var_14], 2"], [5, "jnz short loc_40EDBD"], [6, "mov [rbp+size], 0D0h"], [7, "jmp short loc_40EDD4"], [8, "cmp [rbp+var_14], 1"], [9, "jnz short loc_40EDCD"], [10, "mov [rbp+size], 340h"], [11, "jmp short loc_40EDD4"], [12, "mov eax, 0"], [13, "jmp short locret_40EE04"], [14, "mov rax, [rbp+size]"], [15, "mov rdi, rax"], [16, "call _malloc"], [17, "mov [rbp+s], rax"], [18, "cmp [rbp+s], 0"], [19, "jz short loc_40EE00"], [20, "mov rdx, [rbp+size]"], [21, "mov rax, [rbp+s]"], [22, "mov esi, 0"], [23, "mov rdi, rax"], [24, "call _memset"], [25, "mov rax, [rbp+s]"], [26, "leave"], [27, "retn"]], "data_dep": [[4, 3], [5, 4], [8, 3], [9, 8], [14, 10], [14, 6], [15, 14], [17, 16], [18, 17], [19, 18], [20, 10], [20, 6], [21, 17], [23, 21], [25, 17], [27, 25], [27, 12]]}
| {"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_40EDA2", "query": "\n\n\nvoid *__fastcall sub_40EDA2(int a1)\n{\nvoid *v1; // rax\nvoid *s; // [rsp+10h] [rbp-10h]\nsize_t size; // [rsp+18h] [rbp-8h]\n\nif ( a1 == 2 )\n{\nsize = 208LL;\nv1 = malloc(0xD0uLL);\n}\nelse\n{\nif ( a1 != 1 )\nreturn 0LL;\nsize = 832LL;\nv1 = malloc(0x340uLL);\n}\ns = v1;\nif ( v1 )\nmemset(v1, 0, size);\nreturn s;\n}\n\n\n\nQ:[a1,s,sub_40EDA2,]", "hints": "[]", "response": "{'a1': 'type', 's': 'struct_ptr', 'sub_40EDA2': 'png_create_struct'}"} | [
[
0.7695658206939697,
0.7669150233268738,
0.7654556035995483,
0.7613811492919922,
0.7530183792114258,
0.7501184940338135,
0.7500781416893005,
0.7357844114303589,
0.729742705821991,
0.7278413772583008,
0.7272970676422119,
0.7246938943862915,
0.7142165899276733,
0.7091900110244751,
0.7075313925743103,
0.7037590742111206,
0.703397274017334,
0.7030735015869141,
0.702968955039978,
0.699815571308136
],
[
37385,
11164,
215854,
184498,
112754,
141908,
128076,
22540,
151703,
39629,
116008,
56839,
115671,
61186,
243548,
20990,
28684,
67247,
22698,
26404
]
] |
|
arm_mat_mult_q31 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | arm_status arm_mat_mult_q31(
const arm_matrix_instance_q31 * pSrcA,
const arm_matrix_instance_q31 * pSrcB,
arm_matrix_instance_q31 * pDst)
{
q31_t *pIn1 = pSrcA->pData; /* Input data matrix pointer A */
q31_t *pIn2 = pSrcB->pData; /* Input data matrix pointer B */
q31_t *pInA = pSrcA->pData; /* Input data matrix pointer A */
q31_t *pInB = pSrcB->pData; /* Input data matrix pointer B */
q31_t *pOut = pDst->pData; /* Output data matrix pointer */
q31_t *px; /* Temporary output data matrix pointer */
q63_t sum; /* Accumulator */
uint16_t numRowsA = pSrcA->numRows; /* Number of rows of input matrix A */
uint16_t numColsB = pSrcB->numCols; /* Number of columns of input matrix B */
uint16_t numColsA = pSrcA->numCols; /* Number of columns of input matrix A */
uint32_t col, i = 0U, row = numRowsA, colCnt; /* Loop counters */
arm_status status; /* Status of matrix multiplication */
#ifdef ARM_MATH_MATRIX_CHECK
/* Check for matrix mismatch condition */
if ((pSrcA->numCols != pSrcB->numRows) ||
(pSrcA->numRows != pDst->numRows) ||
(pSrcB->numCols != pDst->numCols) )
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
}
else
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
{
/* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */
/* row loop */
do
{
/* Output pointer is set to starting address of row being processed */
px = pOut + i;
/* For every row wise process, column loop counter is to be initiated */
col = numColsB;
/* For every row wise process, pIn2 pointer is set to starting address of pSrcB data */
pIn2 = pSrcB->pData;
/* column loop */
do
{
/* Set the variable sum, that acts as accumulator, to zero */
sum = 0;
/* Initialize pointer pIn1 to point to starting address of column being processed */
pIn1 = pInA;
#if defined (ARM_MATH_LOOPUNROLL)
/* Loop unrolling: Compute 4 MACs at a time. */
colCnt = numColsA >> 2U;
/* matrix multiplication */
while (colCnt > 0U)
{
/* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */
/* Perform the multiply-accumulates */
sum += (q63_t) *pIn1++ * *pIn2;
pIn2 += numColsB;
sum += (q63_t) *pIn1++ * *pIn2;
pIn2 += numColsB;
sum += (q63_t) *pIn1++ * *pIn2;
pIn2 += numColsB;
sum += (q63_t) *pIn1++ * *pIn2;
pIn2 += numColsB;
/* Decrement loop counter */
colCnt--;
}
/* Loop unrolling: Compute remaining MACs */
colCnt = numColsA % 0x4U;
#else
/* Initialize cntCnt with number of columns */
colCnt = numColsA;
#endif /* #if defined (ARM_MATH_LOOPUNROLL) */
while (colCnt > 0U)
{
/* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */
/* Perform the multiply-accumulates */
sum += (q63_t) *pIn1++ * *pIn2;
pIn2 += numColsB;
/* Decrement loop counter */
colCnt--;
}
/* Convert result from 2.62 to 1.31 format and store in destination buffer */
*px++ = (q31_t) (sum >> 31);
/* Decrement column loop counter */
col--;
/* Update pointer pIn2 to point to starting address of next column */
pIn2 = pInB + (numColsB - col);
} while (col > 0U);
/* Update pointer pInA to point to starting address of next row */
i = i + numColsB;
pInA = pInA + numColsA;
/* Decrement row loop counter */
row--;
} while (row > 0U);
/* Set status as ARM_MATH_SUCCESS */
status = ARM_MATH_SUCCESS;
}
/* Return to application */
return (status);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_408D90", "function_addr": 4230544, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_68], rdi"], [3, "mov [rbp+var_70], rsi"], [4, "mov [rbp+var_78], rdx"], [5, "mov rax, [rbp+var_68]"], [6, "mov rax, [rax+8]"], [7, "mov [rbp+var_8], rax"], [8, "mov rax, [rbp+var_70]"], [9, "mov rax, [rax+8]"], [10, "mov [rbp+var_10], rax"], [11, "mov rax, [rbp+var_68]"], [12, "mov rax, [rax+8]"], [13, "mov [rbp+var_18], rax"], [14, "mov rax, [rbp+var_70]"], [15, "mov rax, [rax+8]"], [16, "mov [rbp+var_40], rax"], [17, "mov rax, [rbp+var_78]"], [18, "mov rax, [rax+8]"], [19, "mov [rbp+var_48], rax"], [20, "mov rax, [rbp+var_68]"], [21, "movzx eax, word ptr [rax]"], [22, "mov [rbp+var_4A], ax"], [23, "mov rax, [rbp+var_70]"], [24, "movzx eax, word ptr [rax+2]"], [25, "mov [rbp+var_4C], ax"], [26, "mov rax, [rbp+var_68]"], [27, "movzx eax, word ptr [rax+2]"], [28, "mov [rbp+var_4E], ax"], [29, "mov [rbp+var_30], 0"], [30, "movzx eax, [rbp+var_4A]"], [31, "mov [rbp+var_34], eax"], [32, "mov eax, [rbp+var_30]"], [33, "lea rdx, ds:0[rax*4]"], [34, "mov rax, [rbp+var_48]"], [35, "add rax, rdx"], [36, "mov [rbp+var_20], rax"], [37, "movzx eax, [rbp+var_4C]"], [38, "mov [rbp+var_2C], eax"], [39, "mov rax, [rbp+var_70]"], [40, "mov rax, [rax+8]"], [41, "mov [rbp+var_10], rax"], [42, "mov [rbp+var_28], 0"], [43, "mov rax, [rbp+var_18]"], [44, "mov [rbp+var_8], rax"], [45, "movzx eax, [rbp+var_4E]"], [46, "mov [rbp+var_38], eax"], [47, "jmp short loc_408E80"], [48, "mov rax, [rbp+var_8]"], [49, "lea rdx, [rax+4]"], [50, "mov [rbp+var_8], rdx"], [51, "mov eax, [rax]"], [52, "movsxd rdx, eax"], [53, "mov rax, [rbp+var_10]"], [54, "mov eax, [rax]"], [55, "cdqe"], [56, "imul rax, rdx"], [57, "add [rbp+var_28], rax"], [58, "movzx eax, [rbp+var_4C]"], [59, "shl rax, 2"], [60, "add [rbp+var_10], rax"], [61, "sub [rbp+var_38], 1"], [62, "cmp [rbp+var_38], 0"], [63, "jnz short loc_408E4F"], [64, "mov rax, [rbp+var_28]"], [65, "sar rax, 1Fh"], [66, "mov rcx, rax"], [67, "mov rax, [rbp+var_20]"], [68, "lea rdx, [rax+4]"], [69, "mov [rbp+var_20], rdx"], [70, "mov edx, ecx"], [71, "mov [rax], edx"], [72, "sub [rbp+var_2C], 1"], [73, "movzx eax, [rbp+var_4C]"], [74, "sub eax, [rbp+var_2C]"], [75, "mov eax, eax"], [76, "lea rdx, ds:0[rax*4]"], [77, "mov rax, [rbp+var_40]"], [78, "add rax, rdx"], [79, "mov [rbp+var_10], rax"], [80, "cmp [rbp+var_2C], 0"], [81, "jnz loc_408E36"], [82, "movzx eax, [rbp+var_4C]"], [83, "add [rbp+var_30], eax"], [84, "movzx eax, [rbp+var_4E]"], [85, "shl rax, 2"], [86, "add [rbp+var_18], rax"], [87, "sub [rbp+var_34], 1"], [88, "cmp [rbp+var_34], 0"], [89, "jnz loc_408E0D"], [90, "mov [rbp+var_54], 0"], [91, "mov eax, [rbp+var_54]"], [92, "pop rbp"], [93, "retn"]], "data_dep": [[5, 2], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [11, 2], [12, 11], [13, 12], [14, 3], [15, 14], [16, 15], [17, 4], [18, 17], [19, 18], [20, 2], [21, 20], [22, 21], [23, 3], [24, 23], [25, 24], [26, 2], [27, 26], [28, 27], [30, 22], [31, 30], [32, 29], [32, 83], [33, 76], [34, 19], [35, 33], [35, 34], [36, 35], [37, 25], [38, 37], [39, 3], [40, 71], [40, 39], [41, 40], [43, 13], [43, 86], [44, 43], [45, 28], [46, 45], [48, 44], [48, 50], [49, 71], [49, 48], [49, 52], [49, 33], [49, 76], [50, 49], [51, 71], [51, 48], [52, 51], [53, 41], [53, 79], [53, 60], [54, 53], [54, 71], [56, 52], [56, 54], [57, 57], [57, 56], [57, 42], [58, 25], [59, 58], [60, 41], [60, 59], [60, 79], [60, 60], [61, 61], [61, 46], [62, 46], [62, 61], [63, 62], [64, 57], [64, 42], [65, 64], [66, 65], [67, 36], [67, 69], [68, 52], [68, 33], [68, 67], [68, 76], [68, 71], [69, 68], [70, 66], [71, 67], [71, 70], [72, 72], [72, 38], [73, 25], [74, 73], [74, 72], [75, 74], [76, 70], [77, 16], [78, 77], [78, 76], [79, 78], [80, 72], [81, 80], [82, 25], [83, 82], [83, 29], [83, 83], [84, 28], [85, 84], [86, 85], [86, 13], [86, 86], [87, 31], [87, 87], [88, 87], [89, 88], [91, 90], [92, 0], [93, 91]]}
| {"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_408D90", "query": "\n\n\n__int64 __fastcall sub_408D90(unsigned __int16 *a1, __int64 a2, __int64 a3)\n{\nint *v3; // rax\n_DWORD *v4; // rax\nunsigned __int16 v6; // [rsp+2Ah] [rbp-4Eh]\nunsigned __int16 v7; // [rsp+2Ch] [rbp-4Ch]\n__int64 v8; // [rsp+30h] [rbp-48h]\n__int64 v9; // [rsp+38h] [rbp-40h]\nint i; // [rsp+40h] [rbp-38h]\nint v11; // [rsp+44h] [rbp-34h]\nunsigned int v12; // [rsp+48h] [rbp-30h]\nint v13; // [rsp+4Ch] [rbp-2Ch]\n__int64 v14; // [rsp+50h] [rbp-28h]\n_DWORD *v15; // [rsp+58h] [rbp-20h]\nint *v16; // [rsp+60h] [rbp-18h]\nint *v17; // [rsp+68h] [rbp-10h]\nint *v18; // [rsp+70h] [rbp-8h]\n\nv16 = (int *)*((_QWORD *)a1 + 1);\nv9 = *(_QWORD *)(a2 + 8);\nv8 = *(_QWORD *)(a3 + 8);\nv7 = *(_WORD *)(a2 + 2);\nv6 = a1[1];\nv12 = 0;\nv11 = *a1;\ndo\n{\nv15 = (_DWORD *)(4LL * v12 + v8);\nv13 = v7;\nv17 = *(int **)(a2 + 8);\ndo\n{\nv14 = 0LL;\nv18 = v16;\nfor ( i = v6; i; --i )\n{\nv3 = v18++;\nv14 += *v3 * (__int64)*v17;\nv17 += v7;\n}\nv4 = v15++;\n*v4 = v14 >> 31;\n--v13;\nv17 = (int *)(4LL * ((unsigned int)v7 - v13) + v9);\n}\nwhile ( v13 );\nv12 += v7;\nv16 += v6;\n--v11;\n}\nwhile ( v11 );\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v6,v7,v8,v9,i,v11,v13,v14,v15,v16,v17,v18,sub_408D90,]", "hints": "[]", "response": "{'a3': 'pDst', 'a1': 'pSrcA', 'a2': 'pSrcB', 'v6': 'numColsA', 'v7': 'numColsB', 'v8': 'pOut', 'v9': 'pInB', 'i': 'colCnt', 'v11': 'row', 'v13': 'col', 'v14': 'sum', 'v15': 'px', 'v16': 'pInA', 'v17': 'pIn2', 'v18': 'pIn1', 'sub_408D90': 'arm_mat_mult_q31'}"} | [
[
0.8076285719871521,
0.7821531891822815,
0.7627297043800354,
0.7474983930587769,
0.7324631810188293,
0.732349693775177,
0.7251989841461182,
0.7183865308761597,
0.7172417044639587,
0.713449239730835,
0.710839569568634,
0.698032021522522,
0.6957131624221802,
0.6913357377052307,
0.690295398235321,
0.6878581047058105,
0.6855560541152954,
0.6852734088897705,
0.6832559108734131,
0.6829965710639954
],
[
112963,
140602,
148127,
105989,
21543,
207380,
103793,
32152,
241030,
51791,
220269,
213773,
43354,
129307,
126879,
150902,
37202,
135157,
138696,
231904
]
] |
|
get_part_ofs | b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817 | chenall | grubutils | NA | uchar4
get_part_ofs (uchar *buf)
{
int i;
uchar4 min;
min = 0xffffffff;
for (i = 0x1be; i < 0x1fe; i += 16)
{
uchar4 lba;
if (! buf[i + 4])
continue;
lba = *((uchar4 *) &buf[i + 8]);
if ((lba) && (lba < min))
min = lba;
}
return min;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402A11", "function_addr": 4205073, "binary_name": "b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov eax, 0FFFFFFFFh"], [4, "mov [rbp+var_10], rax"], [5, "mov [rbp+var_4], 1BEh"], [6, "jmp short loc_402A79"], [7, "mov eax, [rbp+var_4]"], [8, "cdqe"], [9, "lea rdx, [rax+4]"], [10, "mov rax, [rbp+var_28]"], [11, "add rax, rdx"], [12, "movzx eax, byte ptr [rax]"], [13, "test al, al"], [14, "jz short loc_402A74"], [15, "mov eax, [rbp+var_4]"], [16, "cdqe"], [17, "lea rdx, [rax+8]"], [18, "mov rax, [rbp+var_28]"], [19, "add rax, rdx"], [20, "mov rax, [rax]"], [21, "mov [rbp+var_18], rax"], [22, "cmp [rbp+var_18], 0"], [23, "jz short loc_402A75"], [24, "mov rax, [rbp+var_18]"], [25, "cmp rax, [rbp+var_10]"], [26, "jnb short loc_402A75"], [27, "mov rax, [rbp+var_18]"], [28, "mov [rbp+var_10], rax"], [29, "jmp short loc_402A75"], [30, "nop"], [31, "add [rbp+var_4], 10h"], [32, "cmp [rbp+var_4], 1FDh"], [33, "jle short loc_402A2B"], [34, "mov rax, [rbp+var_10]"], [35, "pop rbp"], [36, "retn"]], "data_dep": [[4, 3], [7, 31], [7, 5], [9, 17], [9, 7], [9, 9], [10, 2], [11, 10], [11, 9], [12, 11], [13, 12], [14, 13], [15, 5], [15, 31], [17, 9], [17, 15], [18, 2], [19, 18], [19, 17], [20, 19], [21, 20], [22, 21], [23, 22], [24, 21], [25, 4], [25, 28], [25, 24], [26, 25], [27, 21], [28, 27], [31, 5], [31, 31], [32, 31], [32, 5], [33, 32], [34, 4], [34, 28], [35, 0], [36, 34]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817_b3309fee496084ed2c06e93056024105d6b18bf8dde2f8761d7fdc034d3b3817.jsonl.gz", "strip_func_name": "sub_402A11", "query": "\n\n\nunsigned __int64 __fastcall sub_402A11(__int64 a1)\n{\nunsigned __int64 v2; // [rsp+10h] [rbp-18h]\nunsigned __int64 v3; // [rsp+18h] [rbp-10h]\nint i; // [rsp+24h] [rbp-4h]\n\nv3 = 0xFFFFFFFFLL;\nfor ( i = 446; i <= 509; i += 16 )\n{\nif ( *(_BYTE *)(i + 4LL + a1) )\n{\nv2 = *(_QWORD *)(i + 8LL + a1);\nif ( v2 )\n{\nif ( v2 < v3 )\nv3 = *(_QWORD *)(i + 8LL + a1);\n}\n}\n}\nreturn v3;\n}\n\n\n\nQ:[a1,v2,v3,sub_402A11,]", "hints": "[]", "response": "{'a1': 'buf', 'v2': 'lba', 'v3': 'min', 'sub_402A11': 'get_part_ofs'}"} | [
[
0.7545807361602783,
0.7540353536605835,
0.7438181638717651,
0.7358395457267761,
0.7328008413314819,
0.729144275188446,
0.7087984085083008,
0.7065669894218445,
0.7063746452331543,
0.703299343585968,
0.7010805606842041,
0.6983399391174316,
0.6971004009246826,
0.6919666528701782,
0.6912075877189636,
0.6837536692619324,
0.6815815567970276,
0.6796042919158936,
0.6785228252410889,
0.6780683994293213
],
[
71749,
233109,
211922,
42886,
172552,
165915,
40063,
249638,
115427,
134441,
87499,
55681,
131358,
207610,
82099,
59881,
40473,
151278,
158093,
256364
]
] |
|
DArray_resize | fed690b33f485efbaf752360368966f020e4837e69aac5b4d8f10608e90cb0b9 | zedshaw | liblcthw | NA | static inline int DArray_resize(DArray * array, size_t newsize)
{
array->max = newsize;
check(array->max > 0, "The newsize must be > 0.");
void *contents = realloc(
array->contents, array->max * sizeof(void *));
// check contents and assume realloc doesn't harm the original on error
check_mem(contents);
array->contents = contents;
return 0;
error:
return -1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402403", "function_addr": 4203523, "binary_name": "fed690b33f485efbaf752360368966f020e4837e69aac5b4d8f10608e90cb0b9.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, [rbp+var_20]"], [6, "mov edx, eax"], [7, "mov rax, [rbp+var_18]"], [8, "mov [rax+4], edx"], [9, "mov rax, [rbp+var_18]"], [10, "mov eax, [rax+4]"], [11, "test eax, eax"], [12, "jg short loc_402487"], [13, "call ___errno_location"], [14, "mov eax, [rax]"], [15, "test eax, eax"], [16, "jz short loc_402446"], [17, "call ___errno_location"], [18, "mov eax, [rax]"], [19, "mov edi, eax"], [20, "call _strerror"], [21, "jmp short loc_40244D"], [22, "lea rax, aNone"], [23, "mov rdx, cs:_edata_ptr"], [24, "mov rdi, [rdx]"], [25, "mov r8, rax"], [26, "mov ecx, 29h "], [27, "lea rdx, aSrcLcthwDarray"], [28, "lea rsi, aErrorSDErrnoST"], [29, "mov eax, 0"], [30, "call _fprintf"], [31, "call ___errno_location"], [32, "mov dword ptr [rax], 0"], [33, "jmp loc_402522"], [34, "mov rax, [rbp+var_18]"], [35, "mov eax, [rax+4]"], [36, "cdqe"], [37, "lea rdx, ds:0[rax*8]"], [38, "mov rax, [rbp+var_18]"], [39, "mov rax, [rax+18h]"], [40, "mov rsi, rdx"], [41, "mov rdi, rax"], [42, "call _realloc"], [43, "mov [rbp+var_8], rax"], [44, "cmp [rbp+var_8], 0"], [45, "jnz short loc_40250F"], [46, "call ___errno_location"], [47, "mov eax, [rax]"], [48, "test eax, eax"], [49, "jz short loc_4024D1"], [50, "call ___errno_location"], [51, "mov eax, [rax]"], [52, "mov edi, eax"], [53, "call _strerror"], [54, "jmp short loc_4024D8"], [55, "lea rax, aNone"], [56, "mov rdx, cs:_edata_ptr"], [57, "mov rdi, [rdx]"], [58, "mov r8, rax"], [59, "mov ecx, 2Fh "], [60, "lea rdx, aSrcLcthwDarray"], [61, "lea rsi, aErrorSDErrnoSO"], [62, "mov eax, 0"], [63, "call _fprintf"], [64, "call ___errno_location"], [65, "mov dword ptr [rax], 0"], [66, "jmp short loc_402522"], [67, "mov rax, [rbp+var_18]"], [68, "mov rdx, [rbp+var_8]"], [69, "mov [rax+18h], rdx"], [70, "mov eax, 0"], [71, "jmp short locret_402527"], [72, "mov eax, 0FFFFFFFFh"], [73, "leave"], [74, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [8, 6], [8, 7], [9, 3], [10, 9], [10, 8], [11, 10], [12, 11], [14, 13], [14, 8], [15, 14], [16, 15], [18, 17], [18, 8], [19, 18], [22, 15], [24, 8], [24, 23], [24, 32], [25, 22], [25, 20], [27, 23], [32, 31], [34, 3], [35, 8], [35, 34], [37, 6], [38, 3], [39, 8], [39, 38], [40, 37], [41, 39], [43, 42], [44, 43], [45, 44], [47, 46], [47, 8], [48, 47], [49, 48], [51, 50], [51, 8], [52, 51], [55, 48], [57, 8], [57, 56], [57, 65], [58, 55], [58, 53], [60, 56], [61, 40], [65, 64], [67, 3], [68, 43], [69, 68], [69, 67], [74, 70], [74, 72]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/fed690b33f485efbaf752360368966f020e4837e69aac5b4d8f10608e90cb0b9_fed690b33f485efbaf752360368966f020e4837e69aac5b4d8f10608e90cb0b9.jsonl.gz", "strip_func_name": "sub_402403", "query": "\n\n\n__int64 __fastcall sub_402403(__int64 a1, int a2)\n{\nint *v2; // rax\nchar *v3; // rax\nint *v4; // rax\nchar *v5; // rax\nvoid *v7; // [rsp+18h] [rbp-8h]\n\n*(_DWORD *)(a1 + 4) = a2;\nif ( *(int *)(a1 + 4) > 0 )\n{\nv7 = realloc(*(void **)(a1 + 24), 8LL * *(int *)(a1 + 4));\nif ( v7 )\n{\n*(_QWORD *)(a1 + 24) = v7;\nreturn 0LL;\n}\nif ( *__errno_location() )\n{\nv4 = __errno_location();\nv5 = strerror(*v4);\n}\nelse\n{\nv5 = \"None\";\n}\nfprintf(edata, \"[ERROR] (%s:%d: errno: %s) Out of memory.\\n\", \"src/lcthw/darray.c\", 47LL, v5);\n*__errno_location() = 0;\n}\nelse\n{\nif ( *__errno_location() )\n{\nv2 = __errno_location();\nv3 = strerror(*v2);\n}\nelse\n{\nv3 = \"None\";\n}\nfprintf(edata, \"[ERROR] (%s:%d: errno: %s) The newsize must be > 0.\\n\", \"src/lcthw/darray.c\", 41LL, v3);\n*__errno_location() = 0;\n}\nreturn 0xFFFFFFFFLL;\n}\n\n\n\nQ:[a1,a2,v7,sub_402403,]", "hints": "[]", "response": "{'a1': 'array', 'a2': 'newsize', 'v7': 'contents', 'sub_402403': 'DArray_resize'}"} | [
[
0.7387162446975708,
0.7386618852615356,
0.737432062625885,
0.7367613315582275,
0.7310090065002441,
0.7239178419113159,
0.717204213142395,
0.7072875499725342,
0.7048816084861755,
0.7036558389663696,
0.7023953199386597,
0.7021921277046204,
0.702179491519928,
0.6996426582336426,
0.6971069574356079,
0.6964544057846069,
0.6935925483703613,
0.6934639811515808,
0.6927225589752197,
0.6914231181144714
],
[
39534,
151737,
32843,
123312,
37053,
160902,
7003,
220194,
218073,
256805,
109850,
83509,
60445,
94748,
207336,
236702,
43188,
146787,
71820,
3142
]
] |
|
append_escaped | 3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413 | emikulic | darkhttpd | NA | static void append_escaped(struct apbuf *dst, const char *src) {
int pos = 0;
while (src[pos] != '\0') {
switch (src[pos]) {
case '<':
append(dst, "<");
break;
case '>':
append(dst, ">");
break;
case '&':
append(dst, "&");
break;
case '\'':
append(dst, "'");
break;
case '"':
append(dst, """);
break;
default:
appendl(dst, src+pos, 1);
}
pos++;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4151A1", "function_addr": 4280737, "binary_name": "3bcf173d341df86f6f8c68ed537bf47f1d919855b29727d483d7dab93b6c4413.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 28h"], [4, "mov [rbp+var_28], rdi"], [5, "mov [rbp+var_30], rsi"], [6, "mov [rbp+var_14], 0"], [7, "jmp loc_415363"], [8, "mov eax, [rbp+var_14]"], [9, "movsxd rbx, eax"], [10, "mov rdx, [rbp+var_30]"], [11, "lea rax, [rdx+rbx]"], [12, "mov rcx, rbx"], [13, "not rcx"], [14, "shr rcx, 3Fh"], [15, "test cl, cl"], [16, "jz short loc_4151F5"], [17, "cmp rax, rdx"], [18, "jnb short loc_4151FA"], [19, "mov rcx, [rbp+var_30]"], [20, "mov rdx, rax"], [21, "mov rsi, rcx"], [22, "mov edi, offset off_43E3A0"], [23, "call ___ubsan_handle_pointer_overflow"], [24, "jmp short loc_4151FA"], [25, "cmp rax, rdx"], [26, "ja short loc_4151DF"], [27, "mov rax, [rbp+var_30]"], [28, "add rbx, rax"], [29, "test rbx, rbx"], [30, "jnz short loc_415215"], [31, "mov esi, 0"], [32, "mov edi, offset off_43E3E0"], [33, "call ___ubsan_handle_type_mismatch_v1"], [34, "mov rax, rbx"], [35, "mov rdx, rax"], [36, "shr rdx, 3"], [37, "add rdx, 7FFF8000h"], [38, "movzx edx, byte ptr [rdx]"], [39, "test dl, dl"], [40, "setnz cl"], [41, "mov rsi, rax"], [42, "and esi, 7"], [43, "cmp sil, dl"], [44, "setnl dl"], [45, "and edx, ecx"], [46, "test dl, dl"], [47, "jz short loc_415248"], [48, "mov rdi, rax"], [49, "call ___asan_report_load1"], [50, "movzx eax, byte ptr [rbx]"], [51, "movsx eax, al"], [52, "sub eax, 22h "], [53, "cmp eax, 1Ch"], [54, "ja def_415264"], [55, "mov eax, eax"], [56, "mov rax, ds:jpt_415264[rax*8]"], [57, "jmp rax"], [58, "mov rax, [rbp+var_28]"], [59, "mov edx, 4"], [60, "mov esi, offset aLt"], [61, "mov rdi, rax"], [62, "call sub_403D7B"], [63, "jmp loc_41533F"], [64, "mov rax, [rbp+var_28]"], [65, "mov edx, 4"], [66, "mov esi, offset aGt"], [67, "mov rdi, rax"], [68, "call sub_403D7B"], [69, "jmp loc_41533F"], [70, "mov rax, [rbp+var_28]"], [71, "mov edx, 5"], [72, "mov esi, offset aAmp"], [73, "mov rdi, rax"], [74, "call sub_403D7B"], [75, "jmp loc_41533F"], [76, "mov rax, [rbp+var_28]"], [77, "mov edx, 6"], [78, "mov esi, offset aApos"], [79, "mov rdi, rax"], [80, "call sub_403D7B"], [81, "jmp short loc_41533F"], [82, "mov rax, [rbp+var_28]"], [83, "mov edx, 6"], [84, "mov esi, offset aQuot"], [85, "mov rdi, rax"], [86, "call sub_403D7B"], [87, "jmp short loc_41533F"], [88, "mov eax, [rbp+var_14]"], [89, "movsxd rbx, eax"], [90, "mov rdx, [rbp+var_30]"], [91, "lea rax, [rdx+rbx]"], [92, "mov rcx, rbx"], [93, "not rcx"], [94, "shr rcx, 3Fh"], [95, "test cl, cl"], [96, "jz short loc_41531E"], [97, "cmp rax, rdx"], [98, "jnb short loc_415323"], [99, "mov rcx, [rbp+var_30]"], [100, "mov rdx, rax"], [101, "mov rsi, rcx"], [102, "mov edi, offset off_43E420"], [103, "call ___ubsan_handle_pointer_overflow"], [104, "jmp short loc_415323"], [105, "cmp rax, rdx"], [106, "ja short loc_415308"], [107, "mov rax, [rbp+var_30]"], [108, "lea rcx, [rbx+rax]"], [109, "mov rax, [rbp+var_28]"], [110, "mov edx, 1"], [111, "mov rsi, rcx"], [112, "mov rdi, rax"], [113, "call sub_403D7B"], [114, "mov eax, [rbp+var_14]"], [115, "add eax, 1"], [116, "mov ebx, eax"], [117, "jno short loc_415360"], [118, "mov eax, [rbp+var_14]"], [119, "cdqe"], [120, "mov edx, 1"], [121, "mov rsi, rax"], [122, "mov edi, offset off_43E4E0"], [123, "call ___ubsan_handle_add_overflow"], [124, "mov [rbp+var_14], ebx"], [125, "mov eax, [rbp+var_14]"], [126, "movsxd rbx, eax"], [127, "mov rdx, [rbp+var_30]"], [128, "lea rax, [rdx+rbx]"], [129, "mov rcx, rbx"], [130, "not rcx"], [131, "shr rcx, 3Fh"], [132, "test cl, cl"], [133, "jz short loc_41539A"], [134, "cmp rax, rdx"], [135, "jnb short loc_41539F"], [136, "mov rcx, [rbp+var_30]"], [137, "mov rdx, rax"], [138, "mov rsi, rcx"], [139, "mov edi, offset off_43E460"], [140, "call ___ubsan_handle_pointer_overflow"], [141, "jmp short loc_41539F"], [142, "cmp rax, rdx"], [143, "ja short loc_415384"], [144, "mov rax, [rbp+var_30]"], [145, "add rbx, rax"], [146, "test rbx, rbx"], [147, "jnz short loc_4153BA"], [148, "mov esi, 0"], [149, "mov edi, offset off_43E4A0"], [150, "call ___ubsan_handle_type_mismatch_v1"], [151, "mov rax, rbx"], [152, "mov rdx, rax"], [153, "shr rdx, 3"], [154, "add rdx, 7FFF8000h"], [155, "movzx edx, byte ptr [rdx]"], [156, "test dl, dl"], [157, "setnz cl"], [158, "mov rsi, rax"], [159, "and esi, 7"], [160, "cmp sil, dl"], [161, "setnl dl"], [162, "and edx, ecx"], [163, "test dl, dl"], [164, "jz short loc_4153ED"], [165, "mov rdi, rax"], [166, "call ___asan_report_load1"], [167, "movzx eax, byte ptr [rbx]"], [168, "test al, al"], [169, "jnz loc_4151BE"], [170, "nop"], [171, "nop"], [172, "mov rbx, [rbp+var_8]"], [173, "leave"], [174, "retn"]], "data_dep": [[8, 6], [8, 124], [9, 8], [10, 5], [11, 9], [11, 8], [12, 9], [13, 12], [14, 13], [15, 14], [16, 15], [17, 11], [17, 10], [18, 17], [19, 5], [20, 11], [21, 19], [25, 11], [25, 10], [26, 25], [27, 5], [28, 9], [28, 27], [29, 28], [30, 29], [34, 29], [35, 34], [36, 35], [37, 36], [38, 37], [39, 38], [40, 15], [40, 19], [40, 39], [41, 34], [42, 41], [43, 39], [43, 42], [44, 39], [44, 43], [45, 40], [45, 44], [46, 45], [47, 46], [48, 34], [50, 29], [51, 50], [52, 51], [53, 52], [54, 53], [55, 52], [57, 56], [58, 4], [61, 58], [64, 4], [67, 64], [70, 4], [73, 70], [76, 4], [79, 76], [82, 4], [85, 82], [88, 124], [88, 6], [89, 88], [90, 5], [91, 89], [91, 88], [92, 89], [93, 92], [94, 93], [95, 94], [96, 95], [97, 90], [97, 91], [98, 97], [99, 5], [100, 91], [101, 99], [105, 90], [105, 91], [106, 105], [107, 5], [108, 107], [108, 95], [108, 99], [109, 4], [111, 108], [112, 109], [114, 124], [114, 6], [115, 114], [116, 115], [117, 115], [118, 124], [118, 6], [121, 118], [124, 116], [125, 6], [125, 124], [126, 125], [127, 5], [128, 126], [128, 125], [129, 126], [130, 129], [131, 130], [132, 131], [133, 132], [134, 128], [134, 127], [135, 134], [136, 5], [137, 128], [138, 136], [142, 128], [142, 127], [143, 142], [144, 5], [145, 126], [145, 144], [146, 145], [147, 146], [151, 146], [152, 151], [153, 152], [154, 153], [155, 154], [156, 155], [157, 132], [157, 136], [157, 156], [158, 151], [159, 158], [160, 159], [160, 156], [161, 156], [161, 160], [162, 161], [162, 157], [163, 162], [164, 163], [165, 151], [167, 146], [168, 167], [169, 168], [174, 168]]}
| {"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_4151A1", "query": "\n\n\n__int64 __fastcall sub_4151A1(unsigned __int64 a1, unsigned __int64 a2)\n{\nunsigned __int64 v2; // rax\nunsigned __int64 v3; // rbx\nunsigned __int64 v4; // rax\nunsigned __int64 v5; // rax\nunsigned __int64 v6; // rbx\n__int64 result; // rax\nint v8; // [rsp+1Ch] [rbp-14h]\n\nv8 = 0;\nwhile ( 1 )\n{\nv5 = a2 + v8;\nif ( v8 >= 0LL )\n{\nif ( v5 >= a2 )\ngoto LABEL_28;\nLABEL_26:\n__ubsan_handle_pointer_overflow();\ngoto LABEL_28;\n}\nif ( v5 > a2 )\ngoto LABEL_26;\nLABEL_28:\nv6 = a2 + v8;\nif ( !v6 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v6 >> 3) + 0x7FFF8000) != 0 && (char)(v6 & 7) >= *(_BYTE *)((v6 >> 3) + 0x7FFF8000) )\n__asan_report_load1();\nresult = *(unsigned __int8 *)v6;\nif ( !(_BYTE)result )\nreturn result;\nv2 = a2 + v8;\nif ( v8 < 0LL )\n{\nif ( v2 <= a2 )\ngoto LABEL_6;\nLABEL_4:\n__ubsan_handle_pointer_overflow();\ngoto LABEL_6;\n}\nif ( v2 < a2 )\ngoto LABEL_4;\nLABEL_6:\nv3 = a2 + v8;\nif ( !v3 )\n__ubsan_handle_type_mismatch_v1();\nif ( *(_BYTE *)((v3 >> 3) + 0x7FFF8000) != 0 && (char)(v3 & 7) >= *(_BYTE *)((v3 >> 3) + 0x7FFF8000) )\n__asan_report_load1();\nswitch ( *(_BYTE *)v3 )\n{\ncase '\"':\nsub_403D7B(a1, \""\", 6uLL);\ngoto LABEL_21;\ncase '&':\nsub_403D7B(a1, \"&\", 5uLL);\ngoto LABEL_21;\ncase '\\'':\nsub_403D7B(a1, \"'\", 6uLL);\ngoto LABEL_21;\ncase '<':\nsub_403D7B(a1, \"<\", 4uLL);\ngoto LABEL_21;\ncase '>':\nsub_403D7B(a1, \">\", 4uLL);\ngoto LABEL_21;\ndefault:\nv4 = a2 + v8;\nif ( v8 >= 0LL )\n{\nif ( v4 >= a2 )\ngoto LABEL_20;\nLABEL_18:\n__ubsan_handle_pointer_overflow();\ngoto LABEL_20;\n}\nif ( v4 > a2 )\ngoto LABEL_18;\nLABEL_20:\nsub_403D7B(a1, (const void *)(v8 + a2), 1uLL);\nLABEL_21:\nif ( __OFADD__(1, v8) )\n__ubsan_handle_add_overflow();\n++v8;\nbreak;\n}\n}\n}\n\n\n\nQ:[a1,a2,v8,sub_4151A1,sub_403D7B,]", "hints": "[]", "response": "{'a1': 'dst', 'a2': 'src', 'v8': 'pos', 'sub_4151A1': 'append_escaped', 'sub_403D7B': 'appendl'}"} | [
[
0.7299677133560181,
0.7094962000846863,
0.6968335509300232,
0.6828770637512207,
0.6794574856758118,
0.6656042337417603,
0.6649039387702942,
0.663658857345581,
0.6620159149169922,
0.6614348888397217,
0.6581212282180786,
0.6557835340499878,
0.6556764841079712,
0.6551995873451233,
0.6546057462692261,
0.6531858444213867,
0.653024435043335,
0.652094841003418,
0.6507493257522583,
0.6489508152008057
],
[
33492,
229304,
111675,
11428,
204516,
58245,
237678,
243833,
180210,
121041,
69509,
52490,
33361,
233642,
6472,
81574,
125862,
134269,
198358,
154061
]
] |
|
FS_ConvertFilename | a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040 | ec- | Quake3e | NA | static void FS_ConvertFilename( char *name )
{
int c;
while ( (c = *name) != '\0' ) {
if ( c <= 'Z' && c >= 'A' ) {
*name = c - 'A' + 'a';
} else if ( c == '\\' || c == ':' ) {
*name = '/';
}
name++;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_439166", "function_addr": 4428134, "binary_name": "a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "jmp short loc_4391A4"], [4, "cmp [rbp+var_4], 5Ah "], [5, "jg short loc_43918C"], [6, "cmp [rbp+var_4], 40h "], [7, "jle short loc_43918C"], [8, "mov eax, [rbp+var_4]"], [9, "add eax, 20h "], [10, "mov edx, eax"], [11, "mov rax, [rbp+var_18]"], [12, "mov [rax], dl"], [13, "jmp short loc_43919F"], [14, "cmp [rbp+var_4], 5Ch "], [15, "jz short loc_439198"], [16, "cmp [rbp+var_4], 3Ah "], [17, "jnz short loc_43919F"], [18, "mov rax, [rbp+var_18]"], [19, "mov byte ptr [rax], 2Fh "], [20, "add [rbp+var_18], 1"], [21, "mov rax, [rbp+var_18]"], [22, "movzx eax, byte ptr [rax]"], [23, "movsx eax, al"], [24, "mov [rbp+var_4], eax"], [25, "cmp [rbp+var_4], 0"], [26, "jnz short loc_439170"], [27, "nop"], [28, "nop"], [29, "pop rbp"], [30, "retn"]], "data_dep": [[4, 24], [5, 4], [6, 24], [7, 6], [8, 24], [9, 8], [10, 9], [11, 2], [11, 20], [12, 10], [12, 11], [14, 24], [15, 14], [16, 24], [17, 16], [18, 20], [18, 2], [19, 18], [20, 20], [20, 2], [21, 2], [21, 20], [22, 19], [22, 12], [22, 21], [23, 22], [24, 23], [25, 24], [26, 25], [29, 0], [30, 23]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040_a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.jsonl.gz", "strip_func_name": "sub_439166", "query": "\n\n\n__int64 __fastcall sub_439166(_BYTE *a1)\n{\n__int64 result; // rax\nint v3; // [rsp+14h] [rbp-4h]\n\nwhile ( 1 )\n{\nresult = (unsigned int)(char)*a1;\nv3 = (char)*a1;\nif ( !*a1 )\nbreak;\nif ( v3 > 90 || v3 <= 64 )\n{\nif ( v3 == 92 || v3 == 58 )\n*a1 = 47;\n}\nelse\n{\n*a1 = v3 + 32;\n}\n++a1;\n}\nreturn result;\n}\n\n\n\nQ:[a1,v3,sub_439166,]", "hints": "[]", "response": "{'a1': 'name', 'v3': 'c', 'sub_439166': 'FS_ConvertFilename'}"} | [
[
0.7504061460494995,
0.7496027946472168,
0.7490887641906738,
0.7489956617355347,
0.7392619848251343,
0.7179371118545532,
0.7165657877922058,
0.7055434584617615,
0.6969741582870483,
0.6966744065284729,
0.6963251233100891,
0.6960412263870239,
0.6887999176979065,
0.6885768175125122,
0.6857629418373108,
0.6846206188201904,
0.6827844977378845,
0.6816960573196411,
0.678480327129364,
0.6764618754386902
],
[
85171,
7045,
65083,
35583,
151325,
212621,
202266,
207610,
16084,
222610,
8221,
173230,
106297,
211290,
66907,
50540,
161042,
104293,
7001,
54850
]
] |
|
dump_patch_body | 56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b | peterbjornx | patchtools_pub | NA | void dump_patch_body( const patch_body_t *body ) {
const uint32_t *groupbase;
uint32_t grp_or[MSRAM_GROUP_SIZE];
int i,j;
printf("MSRAM: \n");
memset( grp_or, 0, sizeof grp_or );
for ( i = 0; i < MSRAM_GROUP_COUNT; i++ ) {
groupbase = body->msram + MSRAM_GROUP_SIZE * i;
printf("\t%04X: %08X %08X %08X %08X %08X %08X %08X %08X\n",
i * 8,
groupbase[0], groupbase[1], groupbase[2], groupbase[3],
groupbase[4], groupbase[5], groupbase[6], groupbase[7]);
for ( j = 0; j < MSRAM_GROUP_SIZE; j++ )
grp_or[j] |= groupbase[j];
}
groupbase = grp_or;
printf("\n\tOR : %08X %08X %08X %08X %08X %08X %08X %08X\n",
groupbase[0], groupbase[1], groupbase[2], groupbase[3],
groupbase[4], groupbase[5], groupbase[6], groupbase[7]);
printf("Control register ops: \n");
for ( i = 0; i < PATCH_CR_OP_COUNT; i++ ) {
printf("\tAddr: %08X Mask: %08X Value: %08X\n",
body->cr_ops[i].address,
body->cr_ops[i].mask,
body->cr_ops[i].value);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402A13", "function_addr": 4205075, "binary_name": "56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov edi, offset aMsram"], [5, "call _puts"], [6, "lea rax, [rbp+s]"], [7, "mov edx, 20h "], [8, "mov esi, 0"], [9, "mov rdi, rax"], [10, "call _memset"], [11, "mov [rbp+var_4], 0"], [12, "jmp loc_402B1C"], [13, "mov rdx, [rbp+var_38]"], [14, "mov eax, [rbp+var_4]"], [15, "shl eax, 3"], [16, "cdqe"], [17, "shl rax, 2"], [18, "add rax, rdx"], [19, "mov [rbp+var_10], rax"], [20, "mov rax, [rbp+var_10]"], [21, "add rax, 1Ch"], [22, "mov r9d, [rax]"], [23, "mov rax, [rbp+var_10]"], [24, "add rax, 18h"], [25, "mov r8d, [rax]"], [26, "mov rax, [rbp+var_10]"], [27, "add rax, 14h"], [28, "mov edi, [rax]"], [29, "mov rax, [rbp+var_10]"], [30, "add rax, 10h"], [31, "mov ecx, [rax]"], [32, "mov rax, [rbp+var_10]"], [33, "add rax, 0Ch"], [34, "mov r11d, [rax]"], [35, "mov rax, [rbp+var_10]"], [36, "add rax, 8"], [37, "mov r10d, [rax]"], [38, "mov rax, [rbp+var_10]"], [39, "add rax, 4"], [40, "mov edx, [rax]"], [41, "mov rax, [rbp+var_10]"], [42, "mov eax, [rax]"], [43, "mov esi, [rbp+var_4]"], [44, "shl esi, 3"], [45, "push r9"], [46, "push r8"], [47, "push rdi"], [48, "push rcx"], [49, "mov r9d, r11d"], [50, "mov r8d, r10d"], [51, "mov ecx, edx"], [52, "mov edx, eax"], [53, "mov edi, offset a04x08x08x08x08"], [54, "mov eax, 0"], [55, "call _printf"], [56, "add rsp, 20h"], [57, "mov [rbp+var_8], 0"], [58, "jmp short loc_402B12"], [59, "mov eax, [rbp+var_8]"], [60, "cdqe"], [61, "mov edx, [rbp+rax*4+s]"], [62, "mov eax, [rbp+var_8]"], [63, "cdqe"], [64, "lea rcx, ds:0[rax*4]"], [65, "mov rax, [rbp+var_10]"], [66, "add rax, rcx"], [67, "mov eax, [rax]"], [68, "or edx, eax"], [69, "mov eax, [rbp+var_8]"], [70, "cdqe"], [71, "mov [rbp+rax*4+s], edx"], [72, "add [rbp+var_8], 1"], [73, "cmp [rbp+var_8], 7"], [74, "jle short loc_402AE4"], [75, "add [rbp+var_4], 1"], [76, "cmp [rbp+var_4], 14h"], [77, "jle loc_402A4B"], [78, "lea rax, [rbp+s]"], [79, "mov [rbp+var_10], rax"], [80, "mov rax, [rbp+var_10]"], [81, "add rax, 1Ch"], [82, "mov r8d, [rax]"], [83, "mov rax, [rbp+var_10]"], [84, "add rax, 18h"], [85, "mov edi, [rax]"], [86, "mov rax, [rbp+var_10]"], [87, "add rax, 14h"], [88, "mov esi, [rax]"], [89, "mov rax, [rbp+var_10]"], [90, "add rax, 10h"], [91, "mov r9d, [rax]"], [92, "mov rax, [rbp+var_10]"], [93, "add rax, 0Ch"], [94, "mov r10d, [rax]"], [95, "mov rax, [rbp+var_10]"], [96, "add rax, 8"], [97, "mov ecx, [rax]"], [98, "mov rax, [rbp+var_10]"], [99, "add rax, 4"], [100, "mov edx, [rax]"], [101, "mov rax, [rbp+var_10]"], [102, "mov eax, [rax]"], [103, "sub rsp, 8"], [104, "push r8"], [105, "push rdi"], [106, "push rsi"], [107, "mov r8d, r10d"], [108, "mov esi, eax"], [109, "mov edi, offset aOr08x08x08x08x"], [110, "mov eax, 0"], [111, "call _printf"], [112, "add rsp, 20h"], [113, "mov edi, offset aControlRegiste"], [114, "call _puts"], [115, "mov [rbp+var_4], 0"], [116, "jmp short loc_402C0F"], [117, "mov rdx, [rbp+var_38]"], [118, "mov eax, [rbp+var_4]"], [119, "cdqe"], [120, "add rax, 2Ah "], [121, "shl rax, 4"], [122, "add rax, rdx"], [123, "add rax, 8"], [124, "mov ecx, [rax]"], [125, "mov rdx, [rbp+var_38]"], [126, "mov eax, [rbp+var_4]"], [127, "cdqe"], [128, "add rax, 2Ah "], [129, "shl rax, 4"], [130, "add rax, rdx"], [131, "add rax, 4"], [132, "mov edx, [rax]"], [133, "mov rsi, [rbp+var_38]"], [134, "mov eax, [rbp+var_4]"], [135, "cdqe"], [136, "add rax, 2Ah "], [137, "shl rax, 4"], [138, "add rax, rsi"], [139, "mov eax, [rax]"], [140, "mov esi, eax"], [141, "mov edi, offset aAddr08xMask08x"], [142, "mov eax, 0"], [143, "call _printf"], [144, "add [rbp+var_4], 1"], [145, "cmp [rbp+var_4], 0Fh"], [146, "jle short loc_402BB0"], [147, "nop"], [148, "nop"], [149, "leave"], [150, "retn"]], "data_dep": [[6, 5], [9, 6], [13, 3], [14, 11], [14, 75], [15, 14], [17, 15], [18, 17], [18, 13], [19, 18], [20, 19], [21, 20], [22, 21], [23, 19], [24, 23], [25, 24], [26, 19], [27, 26], [28, 27], [29, 19], [30, 29], [31, 30], [32, 19], [33, 32], [34, 33], [35, 19], [36, 35], [37, 36], [38, 19], [39, 38], [40, 39], [41, 19], [42, 41], [43, 11], [43, 75], [44, 43], [45, 22], [46, 25], [47, 28], [48, 31], [49, 34], [50, 37], [51, 40], [52, 42], [56, 2], [56, 56], [59, 57], [59, 72], [61, 71], [61, 59], [62, 72], [62, 57], [64, 64], [64, 51], [65, 19], [66, 64], [66, 65], [67, 66], [68, 61], [68, 67], [69, 57], [69, 72], [71, 69], [71, 68], [72, 57], [72, 72], [73, 57], [73, 72], [74, 73], [75, 11], [75, 75], [76, 11], [76, 75], [77, 76], [78, 10], [78, 69], [78, 55], [79, 78], [80, 79], [81, 80], [82, 81], [83, 79], [84, 83], [85, 84], [86, 79], [87, 86], [88, 87], [89, 79], [90, 89], [91, 90], [92, 79], [93, 92], [94, 93], [95, 79], [96, 95], [97, 96], [98, 79], [99, 98], [100, 99], [101, 79], [102, 101], [103, 56], [103, 2], [104, 82], [105, 85], [106, 88], [107, 94], [108, 102], [112, 103], [117, 3], [118, 115], [118, 144], [120, 118], [121, 120], [122, 117], [122, 121], [123, 122], [124, 123], [125, 3], [126, 144], [126, 115], [128, 126], [129, 128], [130, 125], [130, 129], [131, 130], [132, 131], [133, 3], [134, 144], [134, 115], [136, 134], [137, 136], [138, 133], [138, 137], [139, 138], [140, 139], [144, 115], [144, 144], [145, 115], [145, 144], [146, 145], [150, 143], [150, 114]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b_56dfa417cb0243577844c2cc09f7018b6f313117d646e362a8cf9da09c47095b.jsonl.gz", "strip_func_name": "sub_402A13", "query": "\n\n\nint __fastcall sub_402A13(__int64 a1)\n{\nint result; // eax\nunsigned int s[8]; // [rsp+10h] [rbp-30h] BYREF\nunsigned int *v3; // [rsp+30h] [rbp-10h]\nint j; // [rsp+38h] [rbp-8h]\nint i; // [rsp+3Ch] [rbp-4h]\n\nputs(\"MSRAM: \");\nmemset(s, 0, sizeof(s));\nfor ( i = 0; i <= 20; ++i )\n{\nv3 = (unsigned int *)(a1 + 32LL * i);\nprintf(\n\"\\t%04X: %08X %08X %08X %08X %08X %08X %08X %08X\\n\",\n(unsigned int)(8 * i),\n*v3,\nv3[1],\nv3[2],\nv3[3],\nv3[4],\nv3[5],\nv3[6],\nv3[7]);\nfor ( j = 0; j <= 7; ++j )\ns[j] |= v3[j];\n}\nv3 = s;\nprintf(\"\\n\\tOR : %08X %08X %08X %08X %08X %08X %08X %08X\\n\", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]);\nresult = puts(\"Control register ops: \");\nfor ( i = 0; i <= 15; ++i )\nresult = printf(\n\"\\tAddr: %08X Mask: %08X Value: %08X\\n\",\n*(unsigned int *)(a1 + 16 * (i + 42LL)),\n*(unsigned int *)(a1 + 16 * (i + 42LL) + 4),\n*(unsigned int *)(a1 + 16 * (i + 42LL) + 8));\nreturn result;\n}\n\n\n\nQ:[a1,s,v3,sub_402A13,]", "hints": "[]", "response": "{'a1': 'body', 's': 'grp_or', 'v3': 'groupbase', 'sub_402A13': 'dump_patch_body'}"} | [
[
0.7140259742736816,
0.7102201581001282,
0.6950777173042297,
0.6915667653083801,
0.6878274083137512,
0.6877011060714722,
0.6845933794975281,
0.6845597624778748,
0.6811367273330688,
0.6809096336364746,
0.6780456304550171,
0.6762630939483643,
0.674915611743927,
0.674789309501648,
0.6746771335601807,
0.6731964349746704,
0.6698112487792969,
0.6675702333450317,
0.6672524809837341,
0.6663200259208679
],
[
108312,
253169,
87496,
43725,
77283,
119814,
106474,
244884,
109265,
166637,
138947,
209230,
257337,
262110,
121908,
248311,
82685,
251524,
165291,
250845
]
] |
|
sharkssl_B64Decode | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | SHARKSSL_API U32 sharkssl_B64Decode(
U8 *disableevent, U32 queryinput, const char *joystickmonitor, const char *requestpending)
{
U32 len;
U8 phase, d, prev_d, c;
len = 0;
prev_d = phase = 0;
for (; joystickmonitor != requestpending; joystickmonitor++)
{
if (((U8)(*joystickmonitor)) & 0x80)
{
continue;
}
d = sysrqreboot[(U8)*joystickmonitor];
if (d != 0xFF)
{
switch (phase & 0x03)
{
case 0:
phase++;
break;
case 1:
c = (U8)((prev_d << 2) | ((d & 0x30) >> 4));
goto _sharkssl_outstr_c;
case 2:
c = (U8)(((prev_d & 0xf) << 4) | ((d & 0x3c) >> 2));
goto _sharkssl_outstr_c;
case 3:
c = (U8)(((prev_d & 0x03) << 6) | d);
_sharkssl_outstr_c:
if (len < queryinput)
{
disableevent[len++] = c;
}
phase++;
break;
}
prev_d = d;
}
}
return len;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_458D3D", "function_addr": 4558141, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.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 [rbp+var_30], rcx"], [6, "mov [rbp+var_4], 0"], [7, "mov [rbp+var_5], 0"], [8, "movzx eax, [rbp+var_5]"], [9, "mov [rbp+var_6], al"], [10, "jmp loc_458E50"], [11, "mov rax, [rbp+var_28]"], [12, "movzx eax, byte ptr [rax]"], [13, "test al, al"], [14, "js loc_458E4A"], [15, "mov rax, [rbp+var_28]"], [16, "movzx eax, byte ptr [rax]"], [17, "movzx eax, al"], [18, "cdqe"], [19, "movzx eax, ds:byte_47F720[rax]"], [20, "mov [rbp+var_8], al"], [21, "cmp [rbp+var_8], 0FFh"], [22, "jz loc_458E4B"], [23, "movzx eax, [rbp+var_5]"], [24, "and eax, 3"], [25, "cmp eax, 3"], [26, "jz short loc_458E04"], [27, "cmp eax, 3"], [28, "jg loc_458E41"], [29, "cmp eax, 2"], [30, "jz short loc_458DEA"], [31, "cmp eax, 2"], [32, "jg loc_458E41"], [33, "test eax, eax"], [34, "jz short loc_458DC4"], [35, "cmp eax, 1"], [36, "jz short loc_458DD0"], [37, "jmp short loc_458E41"], [38, "movzx eax, [rbp+var_5]"], [39, "add eax, 1"], [40, "mov [rbp+var_5], al"], [41, "jmp short loc_458E41"], [42, "movzx eax, [rbp+var_6]"], [43, "shl eax, 2"], [44, "mov edx, eax"], [45, "movzx eax, [rbp+var_8]"], [46, "sar eax, 4"], [47, "and eax, 3"], [48, "or eax, edx"], [49, "mov [rbp+var_7], al"], [50, "jmp short loc_458E16"], [51, "movzx eax, [rbp+var_6]"], [52, "shl eax, 4"], [53, "mov edx, eax"], [54, "movzx eax, [rbp+var_8]"], [55, "sar eax, 2"], [56, "and eax, 0Fh"], [57, "or eax, edx"], [58, "mov [rbp+var_7], al"], [59, "jmp short loc_458E16"], [60, "movzx eax, [rbp+var_6]"], [61, "shl eax, 6"], [62, "mov edx, eax"], [63, "movzx eax, [rbp+var_8]"], [64, "or eax, edx"], [65, "mov [rbp+var_7], al"], [66, "mov eax, [rbp+var_4]"], [67, "cmp eax, [rbp+var_1C]"], [68, "jnb short loc_458E36"], [69, "mov eax, [rbp+var_4]"], [70, "lea edx, [rax+1]"], [71, "mov [rbp+var_4], edx"], [72, "mov edx, eax"], [73, "mov rax, [rbp+var_18]"], [74, "add rdx, rax"], [75, "movzx eax, [rbp+var_7]"], [76, "mov [rdx], al"], [77, "movzx eax, [rbp+var_5]"], [78, "add eax, 1"], [79, "mov [rbp+var_5], al"], [80, "nop"], [81, "movzx eax, [rbp+var_8]"], [82, "mov [rbp+var_6], al"], [83, "jmp short loc_458E4B"], [84, "nop"], [85, "add [rbp+var_28], 1"], [86, "mov rax, [rbp+var_28]"], [87, "cmp rax, [rbp+var_30]"], [88, "jnz loc_458D67"], [89, "mov eax, [rbp+var_4]"], [90, "pop rbp"], [91, "retn"]], "data_dep": [[8, 7], [9, 8], [11, 4], [11, 85], [12, 76], [12, 11], [13, 12], [14, 13], [15, 85], [15, 4], [16, 15], [16, 76], [17, 16], [20, 19], [21, 20], [22, 21], [23, 40], [23, 79], [23, 7], [24, 23], [25, 24], [26, 25], [27, 24], [28, 27], [29, 24], [30, 29], [31, 24], [32, 31], [33, 24], [34, 33], [35, 33], [36, 35], [38, 7], [38, 40], [38, 79], [39, 38], [40, 39], [42, 82], [42, 9], [43, 42], [44, 43], [45, 20], [46, 45], [47, 46], [48, 47], [48, 44], [49, 48], [51, 9], [51, 82], [52, 51], [53, 52], [54, 20], [55, 54], [56, 55], [57, 56], [57, 53], [58, 57], [60, 9], [60, 82], [61, 60], [62, 61], [63, 20], [64, 62], [64, 63], [65, 64], [66, 71], [66, 6], [67, 3], [67, 66], [68, 67], [69, 71], [69, 6], [70, 44], [70, 76], [70, 69], [70, 53], [70, 62], [71, 70], [72, 69], [73, 2], [74, 73], [74, 72], [75, 65], [75, 58], [75, 49], [76, 74], [76, 75], [77, 7], [77, 79], [77, 40], [78, 77], [79, 78], [81, 20], [82, 81], [85, 4], [85, 85], [86, 85], [86, 4], [87, 86], [87, 5], [88, 87], [89, 6], [89, 71], [90, 0], [91, 89]]}
| {"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_458D3D", "query": "\n\n\n__int64 __fastcall sub_458D3D(__int64 a1, unsigned int a2, char *a3, char *a4)\n{\nint v4; // eax\nunsigned int v5; // eax\nunsigned __int8 v8; // [rsp+28h] [rbp-8h]\nchar v9; // [rsp+29h] [rbp-7h]\nunsigned __int8 v10; // [rsp+2Ah] [rbp-6h]\nchar v11; // [rsp+2Bh] [rbp-5h]\nunsigned int v12; // [rsp+2Ch] [rbp-4h]\n\nv12 = 0;\nv11 = 0;\nv10 = 0;\nwhile ( a3 != a4 )\n{\nif ( *a3 >= 0 )\n{\nv8 = byte_47F720[(unsigned __int8)*a3];\nif ( v8 != 0xFF )\n{\nv4 = v11 & 3;\nif ( v4 == 3 )\n{\nv9 = (v10 << 6) | v8;\n}\nelse\n{\nif ( (v11 & 3u) > 3 )\ngoto LABEL_15;\nif ( v4 != 2 )\n{\nif ( (v11 & 3) != 0 )\n{\nv9 = (4 * v10) | ((int)v8 >> 4) & 3;\ngoto LABEL_12;\n}\n++v11;\nLABEL_15:\nv10 = v8;\ngoto LABEL_16;\n}\nv9 = (16 * v10) | ((int)v8 >> 2) & 0xF;\n}\nLABEL_12:\nif ( v12 < a2 )\n{\nv5 = v12++;\n*(_BYTE *)(a1 + v5) = v9;\n}\n++v11;\ngoto LABEL_15;\n}\n}\nLABEL_16:\n++a3;\n}\nreturn v12;\n}\n\n\n\nQ:[a3,a4,a1,a2,v8,v9,v10,v11,v12,sub_458D3D,]", "hints": "[]", "response": "{'a3': 'joystickmonitor', 'a4': 'requestpending', 'a1': 'disableevent', 'a2': 'queryinput', 'v8': 'd', 'v9': 'c', 'v10': 'prev_d', 'v11': 'phase', 'v12': 'len', 'sub_458D3D': 'sharkssl_B64Decode'}"} | [
[
0.7888888716697693,
0.7634180784225464,
0.7543556690216064,
0.7462775707244873,
0.7418318390846252,
0.7236608266830444,
0.7162606716156006,
0.7086385488510132,
0.7084319591522217,
0.7084319591522217,
0.7084319591522217,
0.7075886130332947,
0.7048079967498779,
0.7043166160583496,
0.7041785717010498,
0.703773558139801,
0.701187789440155,
0.7009434700012207,
0.7005587220191956,
0.700334370136261
],
[
22881,
257920,
166466,
208754,
55244,
174328,
136306,
13917,
143172,
264048,
221224,
95069,
151843,
66781,
168255,
225659,
182953,
229970,
263632,
31939
]
] |
|
fsk_get_demod_stats | 89953df44bf9ebe9ddd290b1d619cedb146b7549b98cda96a7c6c81d6c35dfe2 | projecthorus | radiosonde_auto_rx | NA | void fsk_get_demod_stats(struct FSK *fsk, struct MODEM_STATS *stats){
/* copy from internal stats, note we can't overwrite stats completely
as it has other states rqd by caller, also we want a consistent
interface across modem types for the freedv_api.
*/
stats->clock_offset = fsk->stats->clock_offset;
stats->snr_est = fsk->stats->snr_est; // TODO: make this SNR not Eb/No
stats->rx_timing = fsk->stats->rx_timing;
stats->foff = fsk->stats->foff;
stats->neyesamp = fsk->stats->neyesamp;
stats->neyetr = fsk->stats->neyetr;
memcpy(stats->rx_eye, fsk->stats->rx_eye, sizeof(stats->rx_eye));
memcpy(stats->f_est, fsk->stats->f_est, fsk->mode*sizeof(float));
/* these fields not used for FSK so set to something sensible */
stats->sync = 0;
stats->nr = fsk->stats->nr;
stats->Nc = fsk->stats->Nc;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405D9B", "function_addr": 4218267, "binary_name": "89953df44bf9ebe9ddd290b1d619cedb146b7549b98cda96a7c6c81d6c35dfe2.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_10], rsi"], [5, "mov rax, [rbp+var_8]"], [6, "mov rax, [rax+0C8h]"], [7, "movss xmm0, dword ptr [rax+0CD8h]"], [8, "mov rax, [rbp+var_10]"], [9, "movss dword ptr [rax+0CD8h], xmm0"], [10, "mov rax, [rbp+var_8]"], [11, "mov rax, [rax+0C8h]"], [12, "movss xmm0, dword ptr [rax+4]"], [13, "mov rax, [rbp+var_10]"], [14, "movss dword ptr [rax+4], xmm0"], [15, "mov rax, [rbp+var_8]"], [16, "mov rax, [rax+0C8h]"], [17, "movss xmm0, dword ptr [rax+0CD4h]"], [18, "mov rax, [rbp+var_10]"], [19, "movss dword ptr [rax+0CD4h], xmm0"], [20, "mov rax, [rbp+var_8]"], [21, "mov rax, [rax+0C8h]"], [22, "movss xmm0, dword ptr [rax+0CD0h]"], [23, "mov rax, [rbp+var_10]"], [24, "movss dword ptr [rax+0CD0h], xmm0"], [25, "mov rax, [rbp+var_8]"], [26, "mov rax, [rax+0C8h]"], [27, "mov edx, [rax+20E4h]"], [28, "mov rax, [rbp+var_10]"], [29, "mov [rax+20E4h], edx"], [30, "mov rax, [rbp+var_8]"], [31, "mov rax, [rax+0C8h]"], [32, "mov edx, [rax+20E0h]"], [33, "mov rax, [rbp+var_10]"], [34, "mov [rax+20E0h], edx"], [35, "mov rax, [rbp+var_8]"], [36, "mov rax, [rax+0C8h]"], [37, "lea rcx, [rax+0CE0h]"], [38, "mov rax, [rbp+var_10]"], [39, "add rax, 0CE0h"], [40, "mov edx, 1400h"], [41, "mov rsi, rcx"], [42, "mov rdi, rax"], [43, "call _memcpy"], [44, "mov rax, [rbp+var_8]"], [45, "mov eax, [rax+2Ch]"], [46, "cdqe"], [47, "lea rdx, ds:0[rax*4]"], [48, "mov rax, [rbp+var_8]"], [49, "mov rax, [rax+0C8h]"], [50, "lea rcx, [rax+20E8h]"], [51, "mov rax, [rbp+var_10]"], [52, "add rax, 20E8h"], [53, "mov rsi, rcx"], [54, "mov rdi, rax"], [55, "call _memcpy"], [56, "mov rax, [rbp+var_10]"], [57, "mov dword ptr [rax+0CCCh], 0"], [58, "mov rax, [rbp+var_8]"], [59, "mov rax, [rax+0C8h]"], [60, "mov edx, [rax+0CC8h]"], [61, "mov rax, [rbp+var_10]"], [62, "mov [rax+0CC8h], edx"], [63, "mov rax, [rbp+var_8]"], [64, "mov rax, [rax+0C8h]"], [65, "mov edx, [rax]"], [66, "mov rax, [rbp+var_10]"], [67, "mov [rax], edx"], [68, "nop"], [69, "leave"], [70, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 4], [9, 8], [9, 7], [10, 3], [11, 9], [11, 10], [12, 9], [12, 11], [13, 4], [14, 13], [14, 12], [15, 3], [16, 15], [16, 14], [17, 14], [17, 16], [18, 4], [19, 18], [19, 17], [20, 3], [21, 20], [21, 19], [22, 19], [22, 21], [23, 4], [24, 23], [24, 22], [25, 3], [26, 25], [26, 24], [27, 24], [27, 26], [28, 4], [29, 27], [29, 28], [30, 3], [31, 29], [31, 30], [32, 29], [32, 31], [33, 4], [34, 32], [34, 33], [35, 3], [36, 34], [36, 35], [37, 34], [37, 36], [38, 4], [39, 38], [41, 37], [42, 39], [44, 3], [45, 34], [45, 44], [47, 40], [48, 3], [49, 48], [49, 34], [50, 49], [50, 37], [50, 34], [51, 4], [52, 51], [53, 50], [54, 52], [56, 4], [57, 56], [58, 3], [59, 57], [59, 58], [60, 57], [60, 59], [61, 4], [62, 60], [62, 61], [63, 3], [64, 62], [64, 63], [65, 62], [65, 64], [66, 4], [67, 65], [67, 66], [70, 66]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/89953df44bf9ebe9ddd290b1d619cedb146b7549b98cda96a7c6c81d6c35dfe2_89953df44bf9ebe9ddd290b1d619cedb146b7549b98cda96a7c6c81d6c35dfe2.jsonl.gz", "strip_func_name": "sub_405D9B", "query": "\n\n\n_DWORD *__fastcall sub_405D9B(__int64 a1, _DWORD *a2)\n{\n_DWORD *result; // rax\n\na2[822] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 3288LL);\na2[1] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 4LL);\na2[821] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 3284LL);\na2[820] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 3280LL);\na2[2105] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 8420LL);\na2[2104] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 8416LL);\nmemcpy(a2 + 824, (const void *)(*(_QWORD *)(a1 + 200) + 3296LL), 0x1400uLL);\nmemcpy(a2 + 2106, (const void *)(*(_QWORD *)(a1 + 200) + 8424LL), 4LL * *(int *)(a1 + 44));\na2[819] = 0;\na2[818] = *(_DWORD *)(*(_QWORD *)(a1 + 200) + 3272LL);\nresult = a2;\n*a2 = **(_DWORD **)(a1 + 200);\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_405D9B,]", "hints": "[]", "response": "{'a1': 'fsk', 'a2': 'stats', 'sub_405D9B': 'fsk_get_demod_stats'}"} | [
[
0.7955003976821899,
0.7803400754928589,
0.7764486074447632,
0.7763786911964417,
0.7616432905197144,
0.7421035766601562,
0.7390133142471313,
0.7329882383346558,
0.7325475811958313,
0.7273956537246704,
0.7260184288024902,
0.7253256440162659,
0.7247008085250854,
0.7235334515571594,
0.7224000096321106,
0.7177614569664001,
0.7174367904663086,
0.7166719436645508,
0.7164104580879211,
0.7090857625007629
],
[
110573,
66518,
233485,
238494,
98104,
262844,
156395,
139632,
152574,
153944,
242062,
112369,
220829,
132824,
60441,
195196,
97320,
23088,
19329,
87442
]
] |
|
lexer_scan_operator | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | static gtoken_t lexer_scan_operator(gravity_lexer_t *lexer) {
TOKEN_RESET;
INC_TOKLEN;
int c = NEXT;
int c2 = PEEK_CURRENT;
int tok = 0;
switch (c) {
case '=':
if (c2 == '=') {
INC_OFFSET_POSITION; INC_TOKLEN; c2 = PEEK_CURRENT;
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_ISIDENTICAL;}
else tok = TOK_OP_ISEQUAL;
}
else tok = TOK_OP_ASSIGN;
break;
case '+':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_ADD_ASSIGN;}
else tok = TOK_OP_ADD;
break;
case '-':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_SUB_ASSIGN;}
else tok = TOK_OP_SUB;
break;
case '*':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_MUL_ASSIGN;}
else tok = TOK_OP_MUL;
break;
case '/':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_DIV_ASSIGN;}
else tok = TOK_OP_DIV;
break;
case '%':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_REM_ASSIGN;}
else tok = TOK_OP_REM;
break;
case '<':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_LESS_EQUAL;}
else if (c2 == '<') {
INC_OFFSET_POSITION; INC_TOKLEN; c2 = PEEK_CURRENT;
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_SHIFT_LEFT_ASSIGN;}
else tok = TOK_OP_SHIFT_LEFT;
}
else tok = TOK_OP_LESS;
break;
case '>':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_GREATER_EQUAL;}
else if (c2 == '>') {
INC_OFFSET_POSITION; INC_TOKLEN; c2 = PEEK_CURRENT;
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_SHIFT_RIGHT_ASSIGN;}
else tok = TOK_OP_SHIFT_RIGHT;
}
else tok = TOK_OP_GREATER;
break;
case '&':
if (c2 == '&') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_AND;}
else if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_BIT_AND_ASSIGN;}
else tok = TOK_OP_BIT_AND;
break;
case '|':
if (c2 == '|') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_OR;}
else if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_BIT_OR_ASSIGN;}
else tok = TOK_OP_BIT_OR;
break;
case '.': // check for special .digit case
if (is_digit(c2, false)) {DEC_OFFSET_POSITION; DEC_TOKLEN; tok = lexer_scan_number(lexer);}
else if (c2 == '.') {
// seems a range, now peek c2 again and decide range type
INC_OFFSET_POSITION; INC_TOKLEN; c2 = PEEK_CURRENT;
if ((c2 == '<') || (c2 == '.')) {
INC_OFFSET_POSITION; INC_TOKLEN;
tok = (c2 == '<') ? TOK_OP_RANGE_EXCLUDED : TOK_OP_RANGE_INCLUDED;
} else {
return lexer_error(lexer, "Unrecognized Range operator");
}
}
else tok = TOK_OP_DOT;
break;
case ',':
tok = TOK_OP_COMMA;
break;
case '!':
if (c2 == '=') {
INC_OFFSET_POSITION; INC_TOKLEN; c2 = PEEK_CURRENT;
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_ISNOTIDENTICAL;}
else tok = TOK_OP_ISNOTEQUAL;
}
else tok = TOK_OP_NOT;
break;
case '^':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_BIT_XOR_ASSIGN;}
else tok = TOK_OP_BIT_XOR;
break;
case '~':
if (c2 == '=') {INC_OFFSET_POSITION; INC_TOKLEN; tok = TOK_OP_PATTERN_MATCH;}
else tok = TOK_OP_BIT_NOT;
break;
case ':':
tok = TOK_OP_COLON;
break;
case '{':
tok = TOK_OP_OPEN_CURLYBRACE;
break;
case '}':
tok = TOK_OP_CLOSED_CURLYBRACE;
break;
case '[':
tok = TOK_OP_OPEN_SQUAREBRACKET;
break;
case ']':
tok = TOK_OP_CLOSED_SQUAREBRACKET;
break;
case '(':
tok = TOK_OP_OPEN_PARENTHESIS;
break;
case ')':
tok = TOK_OP_CLOSED_PARENTHESIS;
break;
case '?':
tok = TOK_OP_TERNARY;
break;
default:
return lexer_error(lexer, "Unrecognized Operator");
}
TOKEN_FINALIZE(tok);
DEBUG_LEXEM("Found operator: %s", token_name(tok));
return tok;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42009F", "function_addr": 4325535, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_48], rdi"], [4, "mov rax, [rbp+var_48]"], [5, "mov qword ptr [rax+20h], 0"], [6, "mov qword ptr [rax+28h], 0"], [7, "mov qword ptr [rax+30h], 0"], [8, "mov qword ptr [rax+38h], 0"], [9, "mov qword ptr [rax+40h], 0"], [10, "mov rax, [rbp+var_48]"], [11, "mov edx, [rax+0Ch]"], [12, "mov rax, [rbp+var_48]"], [13, "mov [rax+2Ch], edx"], [14, "mov rax, [rbp+var_48]"], [15, "mov rdx, [rax]"], [16, "mov rax, [rbp+var_48]"], [17, "mov eax, [rax+8]"], [18, "mov eax, eax"], [19, "add rdx, rax"], [20, "mov rax, [rbp+var_48]"], [21, "mov [rax+40h], rdx"], [22, "mov rax, [rbp+var_48]"], [23, "mov edx, [rax+14h]"], [24, "mov rax, [rbp+var_48]"], [25, "mov [rax+24h], edx"], [26, "mov rax, [rbp+var_48]"], [27, "mov edx, [rax+18h]"], [28, "mov rax, [rbp+var_48]"], [29, "mov [rax+28h], edx"], [30, "mov rax, [rbp+var_48]"], [31, "mov dword ptr [rax+3Ch], 0"], [32, "mov rax, [rbp+var_48]"], [33, "mov eax, [rax+30h]"], [34, "lea edx, [rax+1]"], [35, "mov rax, [rbp+var_48]"], [36, "mov [rax+30h], edx"], [37, "mov rax, [rbp+var_48]"], [38, "mov eax, [rax+34h]"], [39, "lea edx, [rax+1]"], [40, "mov rax, [rbp+var_48]"], [41, "mov [rax+34h], edx"], [42, "mov rax, [rbp+var_48]"], [43, "mov rsi, [rax]"], [44, "mov rax, [rbp+var_48]"], [45, "mov eax, [rax+8]"], [46, "lea ecx, [rax+1]"], [47, "mov rdx, [rbp+var_48]"], [48, "mov [rdx+8], ecx"], [49, "mov eax, eax"], [50, "add rax, rsi"], [51, "movzx eax, byte ptr [rax]"], [52, "movsx eax, al"], [53, "mov [rbp+var_8], eax"], [54, "mov rax, [rbp+var_48]"], [55, "mov eax, [rax+0Ch]"], [56, "lea edx, [rax+1]"], [57, "mov rax, [rbp+var_48]"], [58, "mov [rax+0Ch], edx"], [59, "mov rax, [rbp+var_48]"], [60, "mov eax, [rax+18h]"], [61, "lea edx, [rax+1]"], [62, "mov rax, [rbp+var_48]"], [63, "mov [rax+18h], edx"], [64, "mov rax, [rbp+var_48]"], [65, "mov rdx, [rax]"], [66, "mov rax, [rbp+var_48]"], [67, "mov eax, [rax+8]"], [68, "mov eax, eax"], [69, "add rax, rdx"], [70, "movzx eax, byte ptr [rax]"], [71, "movsx eax, al"], [72, "mov [rbp+var_C], eax"], [73, "mov [rbp+var_4], 0"], [74, "mov eax, [rbp+var_8]"], [75, "sub eax, 21h "], [76, "cmp eax, 5Dh"], [77, "ja def_4201E3"], [78, "mov eax, eax"], [79, "lea rdx, ds:0[rax*4]"], [80, "lea rax, jpt_4201E3"], [81, "mov eax, ds:(jpt_4201E3 - 46CA2Ch)[rdx+rax]"], [82, "cdqe"], [83, "lea rdx, jpt_4201E3"], [84, "add rax, rdx"], [85, "jmp rax"], [86, "cmp [rbp+var_C], 3Dh "], [87, "jnz loc_4202D3"], [88, "mov rax, [rbp+var_48]"], [89, "mov eax, [rax+8]"], [90, "lea edx, [rax+1]"], [91, "mov rax, [rbp+var_48]"], [92, "mov [rax+8], edx"], [93, "mov rax, [rbp+var_48]"], [94, "mov eax, [rax+18h]"], [95, "lea edx, [rax+1]"], [96, "mov rax, [rbp+var_48]"], [97, "mov [rax+18h], edx"], [98, "mov rax, [rbp+var_48]"], [99, "mov eax, [rax+0Ch]"], [100, "lea edx, [rax+1]"], [101, "mov rax, [rbp+var_48]"], [102, "mov [rax+0Ch], edx"], [103, "mov rax, [rbp+var_48]"], [104, "mov eax, [rax+30h]"], [105, "lea edx, [rax+1]"], [106, "mov rax, [rbp+var_48]"], [107, "mov [rax+30h], edx"], [108, "mov rax, [rbp+var_48]"], [109, "mov eax, [rax+34h]"], [110, "lea edx, [rax+1]"], [111, "mov rax, [rbp+var_48]"], [112, "mov [rax+34h], edx"], [113, "mov rax, [rbp+var_48]"], [114, "mov rdx, [rax]"], [115, "mov rax, [rbp+var_48]"], [116, "mov eax, [rax+8]"], [117, "mov eax, eax"], [118, "add rax, rdx"], [119, "movzx eax, byte ptr [rax]"], [120, "movsx eax, al"], [121, "mov [rbp+var_C], eax"], [122, "cmp [rbp+var_C], 3Dh "], [123, "jnz short loc_4202C7"], [124, "mov rax, [rbp+var_48]"], [125, "mov eax, [rax+8]"], [126, "lea edx, [rax+1]"], [127, "mov rax, [rbp+var_48]"], [128, "mov [rax+8], edx"], [129, "mov rax, [rbp+var_48]"], [130, "mov eax, [rax+18h]"], [131, "lea edx, [rax+1]"], [132, "mov rax, [rbp+var_48]"], [133, "mov [rax+18h], edx"], [134, "mov rax, [rbp+var_48]"], [135, "mov eax, [rax+0Ch]"], [136, "lea edx, [rax+1]"], [137, "mov rax, [rbp+var_48]"], [138, "mov [rax+0Ch], edx"], [139, "mov rax, [rbp+var_48]"], [140, "mov eax, [rax+30h]"], [141, "lea edx, [rax+1]"], [142, "mov rax, [rbp+var_48]"], [143, "mov [rax+30h], edx"], [144, "mov rax, [rbp+var_48]"], [145, "mov eax, [rax+34h]"], [146, "lea edx, [rax+1]"], [147, "mov rax, [rbp+var_48]"], [148, "mov [rax+34h], edx"], [149, "mov [rbp+var_4], 3Fh "], [150, "jmp loc_420D6D"], [151, "mov [rbp+var_4], 3Dh "], [152, "jmp loc_420D6D"], [153, "mov [rbp+var_4], 45h "], [154, "jmp loc_420D6D"], [155, "cmp [rbp+var_C], 3Dh "], [156, "jnz short loc_420346"], [157, "mov rax, [rbp+var_48]"], [158, "mov eax, [rax+8]"], [159, "lea edx, [rax+1]"], [160, "mov rax, [rbp+var_48]"], [161, "mov [rax+8], edx"], [162, "mov rax, [rbp+var_48]"], [163, "mov eax, [rax+18h]"], [164, "lea edx, [rax+1]"], [165, "mov rax, [rbp+var_48]"], [166, "mov [rax+18h], edx"], [167, "mov rax, [rbp+var_48]"], [168, "mov eax, [rax+0Ch]"], [169, "lea edx, [rax+1]"], [170, "mov rax, [rbp+var_48]"], [171, "mov [rax+0Ch], edx"], [172, "mov rax, [rbp+var_48]"], [173, "mov eax, [rax+30h]"], [174, "lea edx, [rax+1]"], [175, "mov rax, [rbp+var_48]"], [176, "mov [rax+30h], edx"], [177, "mov rax, [rbp+var_48]"], [178, "mov eax, [rax+34h]"], [179, "lea edx, [rax+1]"], [180, "mov rax, [rbp+var_48]"], [181, "mov [rax+34h], edx"], [182, "mov [rbp+var_4], 49h "], [183, "jmp loc_420D6D"], [184, "mov [rbp+var_4], 32h "], [185, "jmp loc_420D6D"], [186, "cmp [rbp+var_C], 3Dh "], [187, "jnz short loc_4203B9"], [188, "mov rax, [rbp+var_48]"], [189, "mov eax, [rax+8]"], [190, "lea edx, [rax+1]"], [191, "mov rax, [rbp+var_48]"], [192, "mov [rax+8], edx"], [193, "mov rax, [rbp+var_48]"], [194, "mov eax, [rax+18h]"], [195, "lea edx, [rax+1]"], [196, "mov rax, [rbp+var_48]"], [197, "mov [rax+18h], edx"], [198, "mov rax, [rbp+var_48]"], [199, "mov eax, [rax+0Ch]"], [200, "lea edx, [rax+1]"], [201, "mov rax, [rbp+var_48]"], [202, "mov [rax+0Ch], edx"], [203, "mov rax, [rbp+var_48]"], [204, "mov eax, [rax+30h]"], [205, "lea edx, [rax+1]"], [206, "mov rax, [rbp+var_48]"], [207, "mov [rax+30h], edx"], [208, "mov rax, [rbp+var_48]"], [209, "mov eax, [rax+34h]"], [210, "lea edx, [rax+1]"], [211, "mov rax, [rbp+var_48]"], [212, "mov [rax+34h], edx"], [213, "mov [rbp+var_4], 4Ah "], [214, "jmp loc_420D6D"], [215, "mov [rbp+var_4], 33h "], [216, "jmp loc_420D6D"], [217, "cmp [rbp+var_C], 3Dh "], [218, "jnz short loc_42042C"], [219, "mov rax, [rbp+var_48]"], [220, "mov eax, [rax+8]"], [221, "lea edx, [rax+1]"], [222, "mov rax, [rbp+var_48]"], [223, "mov [rax+8], edx"], [224, "mov rax, [rbp+var_48]"], [225, "mov eax, [rax+18h]"], [226, "lea edx, [rax+1]"], [227, "mov rax, [rbp+var_48]"], [228, "mov [rax+18h], edx"], [229, "mov rax, [rbp+var_48]"], [230, "mov eax, [rax+0Ch]"], [231, "lea edx, [rax+1]"], [232, "mov rax, [rbp+var_48]"], [233, "mov [rax+0Ch], edx"], [234, "mov rax, [rbp+var_48]"], [235, "mov eax, [rax+30h]"], [236, "lea edx, [rax+1]"], [237, "mov rax, [rbp+var_48]"], [238, "mov [rax+30h], edx"], [239, "mov rax, [rbp+var_48]"], [240, "mov eax, [rax+34h]"], [241, "lea edx, [rax+1]"], [242, "mov rax, [rbp+var_48]"], [243, "mov [rax+34h], edx"], [244, "mov [rbp+var_4], 46h "], [245, "jmp loc_420D6D"], [246, "mov [rbp+var_4], 2Eh "], [247, "jmp loc_420D6D"], [248, "cmp [rbp+var_C], 3Dh "], [249, "jnz short loc_42049F"], [250, "mov rax, [rbp+var_48]"], [251, "mov eax, [rax+8]"], [252, "lea edx, [rax+1]"], [253, "mov rax, [rbp+var_48]"], [254, "mov [rax+8], edx"], [255, "mov rax, [rbp+var_48]"], [256, "mov eax, [rax+18h]"], [257, "lea edx, [rax+1]"], [258, "mov rax, [rbp+var_48]"], [259, "mov [rax+18h], edx"], [260, "mov rax, [rbp+var_48]"], [261, "mov eax, [rax+0Ch]"], [262, "lea edx, [rax+1]"], [263, "mov rax, [rbp+var_48]"], [264, "mov [rax+0Ch], edx"], [265, "mov rax, [rbp+var_48]"], [266, "mov eax, [rax+30h]"], [267, "lea edx, [rax+1]"], [268, "mov rax, [rbp+var_48]"], [269, "mov [rax+30h], edx"], [270, "mov rax, [rbp+var_48]"], [271, "mov eax, [rax+34h]"], [272, "lea edx, [rax+1]"], [273, "mov rax, [rbp+var_48]"], [274, "mov [rax+34h], edx"], [275, "mov [rbp+var_4], 47h "], [276, "jmp loc_420D6D"], [277, "mov [rbp+var_4], 2Fh "], [278, "jmp loc_420D6D"], [279, "cmp [rbp+var_C], 3Dh "], [280, "jnz short loc_420512"], [281, "mov rax, [rbp+var_48]"], [282, "mov eax, [rax+8]"], [283, "lea edx, [rax+1]"], [284, "mov rax, [rbp+var_48]"], [285, "mov [rax+8], edx"], [286, "mov rax, [rbp+var_48]"], [287, "mov eax, [rax+18h]"], [288, "lea edx, [rax+1]"], [289, "mov rax, [rbp+var_48]"], [290, "mov [rax+18h], edx"], [291, "mov rax, [rbp+var_48]"], [292, "mov eax, [rax+0Ch]"], [293, "lea edx, [rax+1]"], [294, "mov rax, [rbp+var_48]"], [295, "mov [rax+0Ch], edx"], [296, "mov rax, [rbp+var_48]"], [297, "mov eax, [rax+30h]"], [298, "lea edx, [rax+1]"], [299, "mov rax, [rbp+var_48]"], [300, "mov [rax+30h], edx"], [301, "mov rax, [rbp+var_48]"], [302, "mov eax, [rax+34h]"], [303, "lea edx, [rax+1]"], [304, "mov rax, [rbp+var_48]"], [305, "mov [rax+34h], edx"], [306, "mov [rbp+var_4], 48h "], [307, "jmp loc_420D6D"], [308, "mov [rbp+var_4], 30h "], [309, "jmp loc_420D6D"], [310, "cmp [rbp+var_C], 3Dh "], [311, "jnz short loc_420585"], [312, "mov rax, [rbp+var_48]"], [313, "mov eax, [rax+8]"], [314, "lea edx, [rax+1]"], [315, "mov rax, [rbp+var_48]"], [316, "mov [rax+8], edx"], [317, "mov rax, [rbp+var_48]"], [318, "mov eax, [rax+18h]"], [319, "lea edx, [rax+1]"], [320, "mov rax, [rbp+var_48]"], [321, "mov [rax+18h], edx"], [322, "mov rax, [rbp+var_48]"], [323, "mov eax, [rax+0Ch]"], [324, "lea edx, [rax+1]"], [325, "mov rax, [rbp+var_48]"], [326, "mov [rax+0Ch], edx"], [327, "mov rax, [rbp+var_48]"], [328, "mov eax, [rax+30h]"], [329, "lea edx, [rax+1]"], [330, "mov rax, [rbp+var_48]"], [331, "mov [rax+30h], edx"], [332, "mov rax, [rbp+var_48]"], [333, "mov eax, [rax+34h]"], [334, "lea edx, [rax+1]"], [335, "mov rax, [rbp+var_48]"], [336, "mov [rax+34h], edx"], [337, "mov [rbp+var_4], 3Ah "], [338, "jmp loc_420D6D"], [339, "cmp [rbp+var_C], 3Ch "], [340, "jnz loc_420673"], [341, "mov rax, [rbp+var_48]"], [342, "mov eax, [rax+8]"], [343, "lea edx, [rax+1]"], [344, "mov rax, [rbp+var_48]"], [345, "mov [rax+8], edx"], [346, "mov rax, [rbp+var_48]"], [347, "mov eax, [rax+18h]"], [348, "lea edx, [rax+1]"], [349, "mov rax, [rbp+var_48]"], [350, "mov [rax+18h], edx"], [351, "mov rax, [rbp+var_48]"], [352, "mov eax, [rax+0Ch]"], [353, "lea edx, [rax+1]"], [354, "mov rax, [rbp+var_48]"], [355, "mov [rax+0Ch], edx"], [356, "mov rax, [rbp+var_48]"], [357, "mov eax, [rax+30h]"], [358, "lea edx, [rax+1]"], [359, "mov rax, [rbp+var_48]"], [360, "mov [rax+30h], edx"], [361, "mov rax, [rbp+var_48]"], [362, "mov eax, [rax+34h]"], [363, "lea edx, [rax+1]"], [364, "mov rax, [rbp+var_48]"], [365, "mov [rax+34h], edx"], [366, "mov rax, [rbp+var_48]"], [367, "mov rdx, [rax]"], [368, "mov rax, [rbp+var_48]"], [369, "mov eax, [rax+8]"], [370, "mov eax, eax"], [371, "add rax, rdx"], [372, "movzx eax, byte ptr [rax]"], [373, "movsx eax, al"], [374, "mov [rbp+var_C], eax"], [375, "cmp [rbp+var_C], 3Dh "], [376, "jnz short loc_420667"], [377, "mov rax, [rbp+var_48]"], [378, "mov eax, [rax+8]"], [379, "lea edx, [rax+1]"], [380, "mov rax, [rbp+var_48]"], [381, "mov [rax+8], edx"], [382, "mov rax, [rbp+var_48]"], [383, "mov eax, [rax+18h]"], [384, "lea edx, [rax+1]"], [385, "mov rax, [rbp+var_48]"], [386, "mov [rax+18h], edx"], [387, "mov rax, [rbp+var_48]"], [388, "mov eax, [rax+0Ch]"], [389, "lea edx, [rax+1]"], [390, "mov rax, [rbp+var_48]"], [391, "mov [rax+0Ch], edx"], [392, "mov rax, [rbp+var_48]"], [393, "mov eax, [rax+30h]"], [394, "lea edx, [rax+1]"], [395, "mov rax, [rbp+var_48]"], [396, "mov [rax+30h], edx"], [397, "mov rax, [rbp+var_48]"], [398, "mov eax, [rax+34h]"], [399, "lea edx, [rax+1]"], [400, "mov rax, [rbp+var_48]"], [401, "mov [rax+34h], edx"], [402, "mov [rbp+var_4], 4Bh "], [403, "jmp loc_420D6D"], [404, "mov [rbp+var_4], 2Ch "], [405, "jmp loc_420D6D"], [406, "mov [rbp+var_4], 39h "], [407, "jmp loc_420D6D"], [408, "cmp [rbp+var_C], 3Dh "], [409, "jnz short loc_4206E6"], [410, "mov rax, [rbp+var_48]"], [411, "mov eax, [rax+8]"], [412, "lea edx, [rax+1]"], [413, "mov rax, [rbp+var_48]"], [414, "mov [rax+8], edx"], [415, "mov rax, [rbp+var_48]"], [416, "mov eax, [rax+18h]"], [417, "lea edx, [rax+1]"], [418, "mov rax, [rbp+var_48]"], [419, "mov [rax+18h], edx"], [420, "mov rax, [rbp+var_48]"], [421, "mov eax, [rax+0Ch]"], [422, "lea edx, [rax+1]"], [423, "mov rax, [rbp+var_48]"], [424, "mov [rax+0Ch], edx"], [425, "mov rax, [rbp+var_48]"], [426, "mov eax, [rax+30h]"], [427, "lea edx, [rax+1]"], [428, "mov rax, [rbp+var_48]"], [429, "mov [rax+30h], edx"], [430, "mov rax, [rbp+var_48]"], [431, "mov eax, [rax+34h]"], [432, "lea edx, [rax+1]"], [433, "mov rax, [rbp+var_48]"], [434, "mov [rax+34h], edx"], [435, "mov [rbp+var_4], 3Ch "], [436, "jmp loc_420D6D"], [437, "cmp [rbp+var_C], 3Eh "], [438, "jnz loc_4207D4"], [439, "mov rax, [rbp+var_48]"], [440, "mov eax, [rax+8]"], [441, "lea edx, [rax+1]"], [442, "mov rax, [rbp+var_48]"], [443, "mov [rax+8], edx"], [444, "mov rax, [rbp+var_48]"], [445, "mov eax, [rax+18h]"], [446, "lea edx, [rax+1]"], [447, "mov rax, [rbp+var_48]"], [448, "mov [rax+18h], edx"], [449, "mov rax, [rbp+var_48]"], [450, "mov eax, [rax+0Ch]"], [451, "lea edx, [rax+1]"], [452, "mov rax, [rbp+var_48]"], [453, "mov [rax+0Ch], edx"], [454, "mov rax, [rbp+var_48]"], [455, "mov eax, [rax+30h]"], [456, "lea edx, [rax+1]"], [457, "mov rax, [rbp+var_48]"], [458, "mov [rax+30h], edx"], [459, "mov rax, [rbp+var_48]"], [460, "mov eax, [rax+34h]"], [461, "lea edx, [rax+1]"], [462, "mov rax, [rbp+var_48]"], [463, "mov [rax+34h], edx"], [464, "mov rax, [rbp+var_48]"], [465, "mov rdx, [rax]"], [466, "mov rax, [rbp+var_48]"], [467, "mov eax, [rax+8]"], [468, "mov eax, eax"], [469, "add rax, rdx"], [470, "movzx eax, byte ptr [rax]"], [471, "movsx eax, al"], [472, "mov [rbp+var_C], eax"], [473, "cmp [rbp+var_C], 3Dh "], [474, "jnz short loc_4207C8"], [475, "mov rax, [rbp+var_48]"], [476, "mov eax, [rax+8]"], [477, "lea edx, [rax+1]"], [478, "mov rax, [rbp+var_48]"], [479, "mov [rax+8], edx"], [480, "mov rax, [rbp+var_48]"], [481, "mov eax, [rax+18h]"], [482, "lea edx, [rax+1]"], [483, "mov rax, [rbp+var_48]"], [484, "mov [rax+18h], edx"], [485, "mov rax, [rbp+var_48]"], [486, "mov eax, [rax+0Ch]"], [487, "lea edx, [rax+1]"], [488, "mov rax, [rbp+var_48]"], [489, "mov [rax+0Ch], edx"], [490, "mov rax, [rbp+var_48]"], [491, "mov eax, [rax+30h]"], [492, "lea edx, [rax+1]"], [493, "mov rax, [rbp+var_48]"], [494, "mov [rax+30h], edx"], [495, "mov rax, [rbp+var_48]"], [496, "mov eax, [rax+34h]"], [497, "lea edx, [rax+1]"], [498, "mov rax, [rbp+var_48]"], [499, "mov [rax+34h], edx"], [500, "mov [rbp+var_4], 4Ch "], [501, "jmp loc_420D6D"], [502, "mov [rbp+var_4], 2Dh "], [503, "jmp loc_420D6D"], [504, "mov [rbp+var_4], 3Bh "], [505, "jmp loc_420D6D"], [506, "cmp [rbp+var_C], 26h "], [507, "jnz short loc_420847"], [508, "mov rax, [rbp+var_48]"], [509, "mov eax, [rax+8]"], [510, "lea edx, [rax+1]"], [511, "mov rax, [rbp+var_48]"], [512, "mov [rax+8], edx"], [513, "mov rax, [rbp+var_48]"], [514, "mov eax, [rax+18h]"], [515, "lea edx, [rax+1]"], [516, "mov rax, [rbp+var_48]"], [517, "mov [rax+18h], edx"], [518, "mov rax, [rbp+var_48]"], [519, "mov eax, [rax+0Ch]"], [520, "lea edx, [rax+1]"], [521, "mov rax, [rbp+var_48]"], [522, "mov [rax+0Ch], edx"], [523, "mov rax, [rbp+var_48]"], [524, "mov eax, [rax+30h]"], [525, "lea edx, [rax+1]"], [526, "mov rax, [rbp+var_48]"], [527, "mov [rax+30h], edx"], [528, "mov rax, [rbp+var_48]"], [529, "mov eax, [rax+34h]"], [530, "lea edx, [rax+1]"], [531, "mov rax, [rbp+var_48]"], [532, "mov [rax+34h], edx"], [533, "mov [rbp+var_4], 42h "], [534, "jmp loc_420D6D"], [535, "cmp [rbp+var_C], 3Dh "], [536, "jnz short loc_4208AE"], [537, "mov rax, [rbp+var_48]"], [538, "mov eax, [rax+8]"], [539, "lea edx, [rax+1]"], [540, "mov rax, [rbp+var_48]"], [541, "mov [rax+8], edx"], [542, "mov rax, [rbp+var_48]"], [543, "mov eax, [rax+18h]"], [544, "lea edx, [rax+1]"], [545, "mov rax, [rbp+var_48]"], [546, "mov [rax+18h], edx"], [547, "mov rax, [rbp+var_48]"], [548, "mov eax, [rax+0Ch]"], [549, "lea edx, [rax+1]"], [550, "mov rax, [rbp+var_48]"], [551, "mov [rax+0Ch], edx"], [552, "mov rax, [rbp+var_48]"], [553, "mov eax, [rax+30h]"], [554, "lea edx, [rax+1]"], [555, "mov rax, [rbp+var_48]"], [556, "mov [rax+30h], edx"], [557, "mov rax, [rbp+var_48]"], [558, "mov eax, [rax+34h]"], [559, "lea edx, [rax+1]"], [560, "mov rax, [rbp+var_48]"], [561, "mov [rax+34h], edx"], [562, "mov [rbp+var_4], 4Dh "], [563, "jmp loc_420D6D"], [564, "mov [rbp+var_4], 31h "], [565, "jmp loc_420D6D"], [566, "cmp [rbp+var_C], 7Ch "], [567, "jnz short loc_420921"], [568, "mov rax, [rbp+var_48]"], [569, "mov eax, [rax+8]"], [570, "lea edx, [rax+1]"], [571, "mov rax, [rbp+var_48]"], [572, "mov [rax+8], edx"], [573, "mov rax, [rbp+var_48]"], [574, "mov eax, [rax+18h]"], [575, "lea edx, [rax+1]"], [576, "mov rax, [rbp+var_48]"], [577, "mov [rax+18h], edx"], [578, "mov rax, [rbp+var_48]"], [579, "mov eax, [rax+0Ch]"], [580, "lea edx, [rax+1]"], [581, "mov rax, [rbp+var_48]"], [582, "mov [rax+0Ch], edx"], [583, "mov rax, [rbp+var_48]"], [584, "mov eax, [rax+30h]"], [585, "lea edx, [rax+1]"], [586, "mov rax, [rbp+var_48]"], [587, "mov [rax+30h], edx"], [588, "mov rax, [rbp+var_48]"], [589, "mov eax, [rax+34h]"], [590, "lea edx, [rax+1]"], [591, "mov rax, [rbp+var_48]"], [592, "mov [rax+34h], edx"], [593, "mov [rbp+var_4], 43h "], [594, "jmp loc_420D6D"], [595, "cmp [rbp+var_C], 3Dh "], [596, "jnz short loc_420988"], [597, "mov rax, [rbp+var_48]"], [598, "mov eax, [rax+8]"], [599, "lea edx, [rax+1]"], [600, "mov rax, [rbp+var_48]"], [601, "mov [rax+8], edx"], [602, "mov rax, [rbp+var_48]"], [603, "mov eax, [rax+18h]"], [604, "lea edx, [rax+1]"], [605, "mov rax, [rbp+var_48]"], [606, "mov [rax+18h], edx"], [607, "mov rax, [rbp+var_48]"], [608, "mov eax, [rax+0Ch]"], [609, "lea edx, [rax+1]"], [610, "mov rax, [rbp+var_48]"], [611, "mov [rax+0Ch], edx"], [612, "mov rax, [rbp+var_48]"], [613, "mov eax, [rax+30h]"], [614, "lea edx, [rax+1]"], [615, "mov rax, [rbp+var_48]"], [616, "mov [rax+30h], edx"], [617, "mov rax, [rbp+var_48]"], [618, "mov eax, [rax+34h]"], [619, "lea edx, [rax+1]"], [620, "mov rax, [rbp+var_48]"], [621, "mov [rax+34h], edx"], [622, "mov [rbp+var_4], 4Eh "], [623, "jmp loc_420D6D"], [624, "mov [rbp+var_4], 34h "], [625, "jmp loc_420D6D"], [626, "mov eax, [rbp+var_C]"], [627, "mov esi, 0"], [628, "mov edi, eax"], [629, "call sub_41EED4"], [630, "test al, al"], [631, "jz short loc_420A10"], [632, "mov rax, [rbp+var_48]"], [633, "mov eax, [rax+8]"], [634, "lea edx, [rax-1]"], [635, "mov rax, [rbp+var_48]"], [636, "mov [rax+8], edx"], [637, "mov rax, [rbp+var_48]"], [638, "mov eax, [rax+18h]"], [639, "lea edx, [rax-1]"], [640, "mov rax, [rbp+var_48]"], [641, "mov [rax+18h], edx"], [642, "mov rax, [rbp+var_48]"], [643, "mov eax, [rax+0Ch]"], [644, "lea edx, [rax-1]"], [645, "mov rax, [rbp+var_48]"], [646, "mov [rax+0Ch], edx"], [647, "mov rax, [rbp+var_48]"], [648, "mov eax, [rax+30h]"], [649, "lea edx, [rax-1]"], [650, "mov rax, [rbp+var_48]"], [651, "mov [rax+30h], edx"], [652, "mov rax, [rbp+var_48]"], [653, "mov eax, [rax+34h]"], [654, "lea edx, [rax-1]"], [655, "mov rax, [rbp+var_48]"], [656, "mov [rax+34h], edx"], [657, "mov rax, [rbp+var_48]"], [658, "mov rdi, rax"], [659, "call sub_41F94B"], [660, "mov [rbp+var_4], eax"], [661, "jmp loc_420D6D"], [662, "cmp [rbp+var_C], 2Eh "], [663, "jnz loc_420B1E"], [664, "mov rax, [rbp+var_48]"], [665, "mov eax, [rax+8]"], [666, "lea edx, [rax+1]"], [667, "mov rax, [rbp+var_48]"], [668, "mov [rax+8], edx"], [669, "mov rax, [rbp+var_48]"], [670, "mov eax, [rax+18h]"], [671, "lea edx, [rax+1]"], [672, "mov rax, [rbp+var_48]"], [673, "mov [rax+18h], edx"], [674, "mov rax, [rbp+var_48]"], [675, "mov eax, [rax+0Ch]"], [676, "lea edx, [rax+1]"], [677, "mov rax, [rbp+var_48]"], [678, "mov [rax+0Ch], edx"], [679, "mov rax, [rbp+var_48]"], [680, "mov eax, [rax+30h]"], [681, "lea edx, [rax+1]"], [682, "mov rax, [rbp+var_48]"], [683, "mov [rax+30h], edx"], [684, "mov rax, [rbp+var_48]"], [685, "mov eax, [rax+34h]"], [686, "lea edx, [rax+1]"], [687, "mov rax, [rbp+var_48]"], [688, "mov [rax+34h], edx"], [689, "mov rax, [rbp+var_48]"], [690, "mov rdx, [rax]"], [691, "mov rax, [rbp+var_48]"], [692, "mov eax, [rax+8]"], [693, "mov eax, eax"], [694, "add rax, rdx"], [695, "movzx eax, byte ptr [rax]"], [696, "movsx eax, al"], [697, "mov [rbp+var_C], eax"], [698, "cmp [rbp+var_C], 3Ch "], [699, "jz short loc_420A97"], [700, "cmp [rbp+var_C], 2Eh "], [701, "jnz short loc_420B06"], [702, "mov rax, [rbp+var_48]"], [703, "mov eax, [rax+8]"], [704, "lea edx, [rax+1]"], [705, "mov rax, [rbp+var_48]"], [706, "mov [rax+8], edx"], [707, "mov rax, [rbp+var_48]"], [708, "mov eax, [rax+18h]"], [709, "lea edx, [rax+1]"], [710, "mov rax, [rbp+var_48]"], [711, "mov [rax+18h], edx"], [712, "mov rax, [rbp+var_48]"], [713, "mov eax, [rax+0Ch]"], [714, "lea edx, [rax+1]"], [715, "mov rax, [rbp+var_48]"], [716, "mov [rax+0Ch], edx"], [717, "mov rax, [rbp+var_48]"], [718, "mov eax, [rax+30h]"], [719, "lea edx, [rax+1]"], [720, "mov rax, [rbp+var_48]"], [721, "mov [rax+30h], edx"], [722, "mov rax, [rbp+var_48]"], [723, "mov eax, [rax+34h]"], [724, "lea edx, [rax+1]"], [725, "mov rax, [rbp+var_48]"], [726, "mov [rax+34h], edx"], [727, "cmp [rbp+var_C], 3Ch "], [728, "jnz short loc_420AF9"], [729, "mov eax, 37h "], [730, "jmp short loc_420AFE"], [731, "mov eax, 38h "], [732, "mov [rbp+var_4], eax"], [733, "jmp loc_420D6D"], [734, "mov rax, [rbp+var_48]"], [735, "lea rsi, aUnrecognizedRa"], [736, "mov rdi, rax"], [737, "call sub_41F0D2"], [738, "jmp locret_420D88"], [739, "mov [rbp+var_4], 55h "], [740, "jmp loc_420D6D"], [741, "mov [rbp+var_4], 54h "], [742, "jmp loc_420D6D"], [743, "cmp [rbp+var_C], 3Dh "], [744, "jnz loc_420C24"], [745, "mov rax, [rbp+var_48]"], [746, "mov eax, [rax+8]"], [747, "lea edx, [rax+1]"], [748, "mov rax, [rbp+var_48]"], [749, "mov [rax+8], edx"], [750, "mov rax, [rbp+var_48]"], [751, "mov eax, [rax+18h]"], [752, "lea edx, [rax+1]"], [753, "mov rax, [rbp+var_48]"], [754, "mov [rax+18h], edx"], [755, "mov rax, [rbp+var_48]"], [756, "mov eax, [rax+0Ch]"], [757, "lea edx, [rax+1]"], [758, "mov rax, [rbp+var_48]"], [759, "mov [rax+0Ch], edx"], [760, "mov rax, [rbp+var_48]"], [761, "mov eax, [rax+30h]"], [762, "lea edx, [rax+1]"], [763, "mov rax, [rbp+var_48]"], [764, "mov [rax+30h], edx"], [765, "mov rax, [rbp+var_48]"], [766, "mov eax, [rax+34h]"], [767, "lea edx, [rax+1]"], [768, "mov rax, [rbp+var_48]"], [769, "mov [rax+34h], edx"], [770, "mov rax, [rbp+var_48]"], [771, "mov rdx, [rax]"], [772, "mov rax, [rbp+var_48]"], [773, "mov eax, [rax+8]"], [774, "mov eax, eax"], [775, "add rax, rdx"], [776, "movzx eax, byte ptr [rax]"], [777, "movsx eax, al"], [778, "mov [rbp+var_C], eax"], [779, "cmp [rbp+var_C], 3Dh "], [780, "jnz short loc_420C18"], [781, "mov rax, [rbp+var_48]"], [782, "mov eax, [rax+8]"], [783, "lea edx, [rax+1]"], [784, "mov rax, [rbp+var_48]"], [785, "mov [rax+8], edx"], [786, "mov rax, [rbp+var_48]"], [787, "mov eax, [rax+18h]"], [788, "lea edx, [rax+1]"], [789, "mov rax, [rbp+var_48]"], [790, "mov [rax+18h], edx"], [791, "mov rax, [rbp+var_48]"], [792, "mov eax, [rax+0Ch]"], [793, "lea edx, [rax+1]"], [794, "mov rax, [rbp+var_48]"], [795, "mov [rax+0Ch], edx"], [796, "mov rax, [rbp+var_48]"], [797, "mov eax, [rax+30h]"], [798, "lea edx, [rax+1]"], [799, "mov rax, [rbp+var_48]"], [800, "mov [rax+30h], edx"], [801, "mov rax, [rbp+var_48]"], [802, "mov eax, [rax+34h]"], [803, "lea edx, [rax+1]"], [804, "mov rax, [rbp+var_48]"], [805, "mov [rax+34h], edx"], [806, "mov [rbp+var_4], 40h "], [807, "jmp loc_420D6D"], [808, "mov [rbp+var_4], 3Eh "], [809, "jmp loc_420D6D"], [810, "mov [rbp+var_4], 50h "], [811, "jmp loc_420D6D"], [812, "cmp [rbp+var_C], 3Dh "], [813, "jnz short loc_420C97"], [814, "mov rax, [rbp+var_48]"], [815, "mov eax, [rax+8]"], [816, "lea edx, [rax+1]"], [817, "mov rax, [rbp+var_48]"], [818, "mov [rax+8], edx"], [819, "mov rax, [rbp+var_48]"], [820, "mov eax, [rax+18h]"], [821, "lea edx, [rax+1]"], [822, "mov rax, [rbp+var_48]"], [823, "mov [rax+18h], edx"], [824, "mov rax, [rbp+var_48]"], [825, "mov eax, [rax+0Ch]"], [826, "lea edx, [rax+1]"], [827, "mov rax, [rbp+var_48]"], [828, "mov [rax+0Ch], edx"], [829, "mov rax, [rbp+var_48]"], [830, "mov eax, [rax+30h]"], [831, "lea edx, [rax+1]"], [832, "mov rax, [rbp+var_48]"], [833, "mov [rax+30h], edx"], [834, "mov rax, [rbp+var_48]"], [835, "mov eax, [rax+34h]"], [836, "lea edx, [rax+1]"], [837, "mov rax, [rbp+var_48]"], [838, "mov [rax+34h], edx"], [839, "mov [rbp+var_4], 4Fh "], [840, "jmp loc_420D6D"], [841, "mov [rbp+var_4], 35h "], [842, "jmp loc_420D6D"], [843, "cmp [rbp+var_C], 3Dh "], [844, "jnz short loc_420D07"], [845, "mov rax, [rbp+var_48]"], [846, "mov eax, [rax+8]"], [847, "lea edx, [rax+1]"], [848, "mov rax, [rbp+var_48]"], [849, "mov [rax+8], edx"], [850, "mov rax, [rbp+var_48]"], [851, "mov eax, [rax+18h]"], [852, "lea edx, [rax+1]"], [853, "mov rax, [rbp+var_48]"], [854, "mov [rax+18h], edx"], [855, "mov rax, [rbp+var_48]"], [856, "mov eax, [rax+0Ch]"], [857, "lea edx, [rax+1]"], [858, "mov rax, [rbp+var_48]"], [859, "mov [rax+0Ch], edx"], [860, "mov rax, [rbp+var_48]"], [861, "mov eax, [rax+30h]"], [862, "lea edx, [rax+1]"], [863, "mov rax, [rbp+var_48]"], [864, "mov [rax+30h], edx"], [865, "mov rax, [rbp+var_48]"], [866, "mov eax, [rax+34h]"], [867, "lea edx, [rax+1]"], [868, "mov rax, [rbp+var_48]"], [869, "mov [rax+34h], edx"], [870, "mov [rbp+var_4], 41h "], [871, "jmp short loc_420D6D"], [872, "mov [rbp+var_4], 36h "], [873, "jmp short loc_420D6D"], [874, "mov [rbp+var_4], 53h "], [875, "jmp short loc_420D6D"], [876, "mov [rbp+var_4], 59h "], [877, "jmp short loc_420D6D"], [878, "mov [rbp+var_4], 5Ah "], [879, "jmp short loc_420D6D"], [880, "mov [rbp+var_4], 57h "], [881, "jmp short loc_420D6D"], [882, "mov [rbp+var_4], 58h "], [883, "jmp short loc_420D6D"], [884, "mov [rbp+var_4], 52h "], [885, "jmp short loc_420D6D"], [886, "mov [rbp+var_4], 56h "], [887, "jmp short loc_420D6D"], [888, "mov [rbp+var_4], 44h "], [889, "jmp short loc_420D6D"], [890, "mov rax, [rbp+var_48]"], [891, "lea rsi, aUnrecognizedOp"], [892, "mov rdi, rax"], [893, "call sub_41F0D2"], [894, "jmp short locret_420D88"], [895, "mov edx, [rbp+var_4]"], [896, "mov rax, [rbp+var_48]"], [897, "mov [rax+20h], edx"], [898, "mov rax, [rbp+var_48]"], [899, "mov edx, [rax+1Ch]"], [900, "mov rax, [rbp+var_48]"], [901, "mov [rax+38h], edx"], [902, "mov eax, [rbp+var_4]"], [903, "leave"], [904, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 4], [7, 4], [8, 4], [9, 4], [10, 3], [11, 9], [11, 10], [12, 3], [13, 12], [13, 11], [14, 3], [15, 14], [15, 13], [16, 3], [17, 13], [17, 16], [18, 17], [19, 18], [19, 15], [20, 3], [21, 20], [21, 19], [22, 3], [23, 22], [23, 21], [24, 3], [25, 24], [25, 23], [26, 3], [27, 25], [27, 26], [28, 3], [29, 28], [29, 27], [30, 3], [31, 30], [32, 3], [33, 7], [33, 31], [33, 32], [34, 27], [34, 31], [34, 33], [35, 3], [36, 35], [36, 34], [37, 3], [38, 37], [38, 36], [39, 38], [39, 34], [39, 36], [40, 3], [41, 39], [41, 40], [42, 3], [43, 41], [43, 42], [44, 3], [45, 41], [45, 44], [46, 45], [46, 41], [47, 3], [48, 47], [48, 46], [49, 45], [50, 43], [50, 49], [51, 48], [51, 50], [52, 51], [53, 52], [54, 3], [55, 54], [55, 48], [56, 55], [56, 47], [56, 48], [57, 3], [58, 56], [58, 57], [59, 3], [60, 58], [60, 59], [61, 60], [61, 56], [61, 58], [62, 3], [63, 61], [63, 62], [64, 3], [65, 63], [65, 64], [66, 3], [67, 63], [67, 66], [68, 67], [69, 65], [69, 68], [70, 69], [70, 63], [71, 70], [72, 71], [74, 53], [75, 74], [76, 75], [77, 76], [78, 75], [79, 65], [80, 78], [83, 79], [84, 81], [84, 83], [85, 84], [86, 72], [87, 86], [88, 3], [89, 31], [89, 21], [89, 13], [89, 88], [89, 58], [89, 25], [89, 112], [89, 102], [89, 92], [89, 36], [89, 6], [89, 48], [89, 5], [89, 8], [89, 63], [89, 7], [89, 29], [89, 9], [89, 107], [89, 97], [89, 41], [90, 9], [90, 107], [90, 97], [90, 31], [90, 21], [90, 112], [90, 89], [90, 13], [90, 58], [90, 25], [90, 102], [90, 92], [90, 36], [90, 6], [90, 48], [90, 5], [90, 41], [90, 8], [90, 83], [90, 63], [90, 7], [90, 29], [91, 3], [92, 90], [92, 91], [93, 3], [94, 92], [94, 93], [94, 63], [95, 90], [95, 92], [95, 94], [96, 3], [97, 96], [97, 95], [98, 3], [99, 98], [99, 97], [99, 58], [100, 95], [100, 97], [100, 99], [101, 3], [102, 100], [102, 101], [103, 3], [104, 103], [104, 102], [104, 36], [105, 100], [105, 102], [105, 104], [106, 3], [107, 105], [107, 106], [108, 3], [109, 108], [109, 107], [109, 41], [110, 109], [110, 105], [110, 107], [111, 3], [112, 111], [112, 110], [113, 3], [114, 113], [114, 112], [115, 3], [116, 112], [116, 115], [116, 92], [117, 116], [118, 117], [118, 114], [119, 118], [119, 112], [120, 119], [121, 120], [122, 121], [123, 122], [124, 3], [125, 13], [125, 124], [125, 58], [125, 133], [125, 25], [125, 112], [125, 148], [125, 102], [125, 92], [125, 36], [125, 6], [125, 48], [125, 5], [125, 41], [125, 8], [125, 63], [125, 138], [125, 7], [125, 128], [125, 29], [125, 9], [125, 107], [125, 143], [125, 97], [125, 31], [125, 21], [126, 9], [126, 143], [126, 97], [126, 133], [126, 21], [126, 112], [126, 102], [126, 36], [126, 13], [126, 114], [126, 58], [126, 48], [126, 25], [126, 5], [126, 148], [126, 125], [126, 138], [126, 92], [126, 128], [126, 29], [126, 6], [126, 107], [126, 41], [126, 31], [126, 8], [126, 63], [126, 7], [127, 3], [128, 126], [128, 127], [129, 3], [130, 129], [130, 128], [130, 97], [131, 126], [131, 128], [131, 130], [132, 3], [133, 131], [133, 132], [134, 3], [135, 133], [135, 102], [135, 134], [136, 135], [136, 131], [136, 133], [137, 3], [138, 136], [138, 137], [139, 3], [140, 138], [140, 107], [140, 139], [141, 136], [141, 138], [141, 140], [142, 3], [143, 141], [143, 142], [144, 3], [145, 112], [145, 144], [145, 143], [146, 141], [146, 143], [146, 145], [147, 3], [148, 147], [148, 146], [155, 72], [156, 155], [157, 3], [158, 36], [158, 157], [158, 13], [158, 166], [158, 58], [158, 48], [158, 25], [158, 181], [158, 171], [158, 29], [158, 6], [158, 5], [158, 41], [158, 8], [158, 63], [158, 161], [158, 7], [158, 176], [158, 9], [158, 31], [158, 21], [159, 36], [159, 13], [159, 166], [159, 58], [159, 48], [159, 25], [159, 181], [159, 158], [159, 171], [159, 29], [159, 6], [159, 5], [159, 41], [159, 8], [159, 83], [159, 63], [159, 161], [159, 7], [159, 176], [159, 9], [159, 31], [159, 21], [160, 3], [161, 159], [161, 160], [162, 3], [163, 162], [163, 63], [163, 161], [164, 159], [164, 161], [164, 163], [165, 3], [166, 164], [166, 165], [167, 3], [168, 166], [168, 167], [168, 58], [169, 164], [169, 166], [169, 168], [170, 3], [171, 169], [171, 170], [172, 3], [173, 36], [173, 171], [173, 172], [174, 169], [174, 171], [174, 173], [175, 3], [176, 175], [176, 174], [177, 3], [178, 177], [178, 41], [178, 176], [179, 174], [179, 176], [179, 178], [180, 3], [181, 180], [181, 179], [186, 72], [187, 186], [188, 3], [189, 9], [189, 188], [189, 21], [189, 36], [189, 13], [189, 212], [189, 202], [189, 58], [189, 192], [189, 48], [189, 25], [189, 5], [189, 7], [189, 29], [189, 6], [189, 41], [189, 31], [189, 8], [189, 207], [189, 63], [189, 197], [190, 21], [190, 207], [190, 63], [190, 197], [190, 9], [190, 36], [190, 13], [190, 212], [190, 189], [190, 202], [190, 58], [190, 192], [190, 48], [190, 25], [190, 5], [190, 83], [190, 7], [190, 29], [190, 6], [190, 41], [190, 31], [190, 8], [191, 3], [192, 190], [192, 191], [193, 3], [194, 192], [194, 193], [194, 63], [195, 190], [195, 192], [195, 194], [196, 3], [197, 195], [197, 196], [198, 3], [199, 197], [199, 198], [199, 58], [200, 195], [200, 197], [200, 199], [201, 3], [202, 201], [202, 200], [203, 3], [204, 36], [204, 202], [204, 203], [205, 200], [205, 202], [205, 204], [206, 3], [207, 206], [207, 205], [208, 3], [209, 208], [209, 41], [209, 207], [210, 205], [210, 207], [210, 209], [211, 3], [212, 211], [212, 210], [217, 72], [218, 217], [219, 3], [220, 8], [220, 63], [220, 219], [220, 9], [220, 21], [220, 243], [220, 233], [220, 223], [220, 36], [220, 13], [220, 58], [220, 48], [220, 25], [220, 5], [220, 7], [220, 29], [220, 6], [220, 238], [220, 228], [220, 41], [220, 31], [221, 238], [221, 228], [221, 41], [221, 31], [221, 8], [221, 21], [221, 63], [221, 220], [221, 9], [221, 243], [221, 233], [221, 223], [221, 36], [221, 13], [221, 58], [221, 48], [221, 25], [221, 5], [221, 83], [221, 7], [221, 29], [221, 6], [222, 3], [223, 221], [223, 222], [224, 3], [225, 223], [225, 224], [225, 63], [226, 221], [226, 223], [226, 225], [227, 3], [228, 227], [228, 226], [229, 3], [230, 58], [230, 228], [230, 229], [231, 226], [231, 228], [231, 230], [232, 3], [233, 232], [233, 231], [234, 3], [235, 234], [235, 233], [235, 36], [236, 231], [236, 233], [236, 235], [237, 3], [238, 237], [238, 236], [239, 3], [240, 41], [240, 239], [240, 238], [241, 236], [241, 238], [241, 240], [242, 3], [243, 241], [243, 242], [248, 72], [249, 248], [250, 3], [251, 41], [251, 31], [251, 8], [251, 250], [251, 21], [251, 63], [251, 9], [251, 274], [251, 264], [251, 254], [251, 36], [251, 13], [251, 58], [251, 48], [251, 25], [251, 5], [251, 269], [251, 259], [251, 7], [251, 29], [251, 6], [252, 58], [252, 48], [252, 25], [252, 5], [252, 83], [252, 63], [252, 259], [252, 7], [252, 29], [252, 6], [252, 9], [252, 274], [252, 251], [252, 41], [252, 31], [252, 8], [252, 21], [252, 264], [252, 254], [252, 269], [252, 36], [252, 13], [253, 3], [254, 253], [254, 252], [255, 3], [256, 63], [256, 255], [256, 254], [257, 252], [257, 254], [257, 256], [258, 3], [259, 258], [259, 257], [260, 3], [261, 58], [261, 260], [261, 259], [262, 259], [262, 261], [262, 257], [263, 3], [264, 262], [264, 263], [265, 3], [266, 265], [266, 264], [266, 36], [267, 262], [267, 264], [267, 266], [268, 3], [269, 267], [269, 268], [270, 3], [271, 41], [271, 270], [271, 269], [272, 267], [272, 269], [272, 271], [273, 3], [274, 272], [274, 273], [279, 72], [280, 279], [281, 3], [282, 58], [282, 48], [282, 25], [282, 290], [282, 5], [282, 63], [282, 305], [282, 7], [282, 29], [282, 6], [282, 9], [282, 41], [282, 31], [282, 8], [282, 21], [282, 295], [282, 285], [282, 300], [282, 36], [282, 13], [282, 281], [283, 36], [283, 13], [283, 58], [283, 48], [283, 290], [283, 5], [283, 83], [283, 63], [283, 305], [283, 282], [283, 295], [283, 7], [283, 29], [283, 6], [283, 9], [283, 41], [283, 31], [283, 8], [283, 21], [283, 285], [283, 300], [283, 25], [284, 3], [285, 283], [285, 284], [286, 3], [287, 286], [287, 285], [287, 63], [288, 283], [288, 285], [288, 287], [289, 3], [290, 288], [290, 289], [291, 3], [292, 291], [292, 58], [292, 290], [293, 290], [293, 292], [293, 288], [294, 3], [295, 293], [295, 294], [296, 3], [297, 36], [297, 296], [297, 295], [298, 293], [298, 295], [298, 297], [299, 3], [300, 298], [300, 299], [301, 3], [302, 301], [302, 41], [302, 300], [303, 298], [303, 300], [303, 302], [304, 3], [305, 303], [305, 304], [310, 72], [311, 310], [312, 3], [313, 321], [313, 36], [313, 13], [313, 58], [313, 336], [313, 48], [313, 326], [313, 5], [313, 63], [313, 7], [313, 29], [313, 6], [313, 9], [313, 316], [313, 41], [313, 31], [313, 8], [313, 21], [313, 331], [313, 25], [313, 312], [314, 5], [314, 83], [314, 63], [314, 7], [314, 29], [314, 9], [314, 316], [314, 41], [314, 31], [314, 8], [314, 21], [314, 331], [314, 321], [314, 25], [314, 36], [314, 13], [314, 6], [314, 58], [314, 336], [314, 48], [314, 313], [314, 326], [315, 3], [316, 314], [316, 315], [317, 3], [318, 63], [318, 317], [318, 316], [319, 316], [319, 318], [319, 314], [320, 3], [321, 319], [321, 320], [322, 3], [323, 321], [323, 58], [323, 322], [324, 323], [324, 319], [324, 321], [325, 3], [326, 325], [326, 324], [327, 3], [328, 36], [328, 326], [328, 327], [329, 324], [329, 326], [329, 328], [330, 3], [331, 329], [331, 330], [332, 3], [333, 41], [333, 331], [333, 332], [334, 329], [334, 331], [334, 333], [335, 3], [336, 335], [336, 334], [339, 72], [340, 339], [341, 3], [342, 341], [342, 13], [342, 58], [342, 25], [342, 365], [342, 355], [342, 345], [342, 36], [342, 6], [342, 48], [342, 5], [342, 63], [342, 7], [342, 360], [342, 350], [342, 29], [342, 9], [342, 41], [342, 31], [342, 8], [342, 21], [343, 36], [343, 13], [343, 58], [343, 48], [343, 25], [343, 5], [343, 83], [343, 63], [343, 7], [343, 360], [343, 350], [343, 29], [343, 6], [343, 9], [343, 41], [343, 31], [343, 8], [343, 21], [343, 365], [343, 342], [343, 355], [343, 345], [344, 3], [345, 343], [345, 344], [346, 3], [347, 345], [347, 346], [347, 63], [348, 343], [348, 345], [348, 347], [349, 3], [350, 349], [350, 348], [351, 3], [352, 351], [352, 58], [352, 350], [353, 350], [353, 352], [353, 348], [354, 3], [355, 353], [355, 354], [356, 3], [357, 355], [357, 36], [357, 356], [358, 353], [358, 355], [358, 357], [359, 3], [360, 359], [360, 358], [361, 3], [362, 361], [362, 360], [362, 41], [363, 358], [363, 360], [363, 362], [364, 3], [365, 363], [365, 364], [366, 3], [367, 366], [367, 365], [368, 3], [369, 365], [369, 368], [369, 345], [370, 369], [371, 367], [371, 370], [372, 365], [372, 371], [373, 372], [374, 373], [375, 374], [376, 375], [377, 3], [378, 36], [378, 6], [378, 48], [378, 401], [378, 5], [378, 391], [378, 381], [378, 8], [378, 63], [378, 7], [378, 360], [378, 350], [378, 29], [378, 9], [378, 41], [378, 31], [378, 21], [378, 396], [378, 386], [378, 13], [378, 58], [378, 25], [378, 365], [378, 355], [378, 345], [378, 377], [379, 367], [379, 36], [379, 6], [379, 48], [379, 401], [379, 5], [379, 41], [379, 391], [379, 381], [379, 8], [379, 63], [379, 7], [379, 360], [379, 350], [379, 29], [379, 9], [379, 31], [379, 21], [379, 396], [379, 386], [379, 13], [379, 58], [379, 25], [379, 365], [379, 378], [379, 355], [379, 345], [380, 3], [381, 379], [381, 380], [382, 3], [383, 350], [383, 382], [383, 381], [384, 381], [384, 383], [384, 379], [385, 3], [386, 385], [386, 384], [387, 3], [388, 387], [388, 386], [388, 355], [389, 384], [389, 386], [389, 388], [390, 3], [391, 389], [391, 390], [392, 3], [393, 392], [393, 391], [393, 360], [394, 389], [394, 391], [394, 393], [395, 3], [396, 394], [396, 395], [397, 3], [398, 396], [398, 397], [398, 365], [399, 394], [399, 396], [399, 398], [400, 3], [401, 399], [401, 400], [408, 72], [409, 408], [410, 3], [411, 21], [411, 410], [411, 419], [411, 36], [411, 13], [411, 58], [411, 48], [411, 434], [411, 25], [411, 424], [411, 5], [411, 29], [411, 6], [411, 414], [411, 41], [411, 31], [411, 8], [411, 63], [411, 7], [411, 429], [411, 9], [412, 29], [412, 6], [412, 424], [412, 414], [412, 5], [412, 41], [412, 8], [412, 83], [412, 63], [412, 7], [412, 9], [412, 31], [412, 21], [412, 429], [412, 419], [412, 36], [412, 13], [412, 58], [412, 48], [412, 434], [412, 25], [412, 411], [413, 3], [414, 413], [414, 412], [415, 3], [416, 63], [416, 415], [416, 414], [417, 414], [417, 416], [417, 412], [418, 3], [419, 418], [419, 417], [420, 3], [421, 420], [421, 419], [421, 58], [422, 417], [422, 419], [422, 421], [423, 3], [424, 422], [424, 423], [425, 3], [426, 36], [426, 425], [426, 424], [427, 422], [427, 424], [427, 426], [428, 3], [429, 427], [429, 428], [430, 3], [431, 41], [431, 429], [431, 430], [432, 427], [432, 429], [432, 431], [433, 3], [434, 432], [434, 433], [437, 72], [438, 437], [439, 3], [440, 36], [440, 13], [440, 58], [440, 48], [440, 25], [440, 5], [440, 443], [440, 458], [440, 448], [440, 29], [440, 6], [440, 41], [440, 31], [440, 8], [440, 63], [440, 439], [440, 7], [440, 9], [440, 463], [440, 453], [440, 21], [441, 463], [441, 440], [441, 453], [441, 21], [441, 443], [441, 36], [441, 13], [441, 58], [441, 48], [441, 25], [441, 5], [441, 83], [441, 458], [441, 448], [441, 29], [441, 6], [441, 41], [441, 31], [441, 8], [441, 63], [441, 7], [441, 9], [442, 3], [443, 441], [443, 442], [444, 3], [445, 443], [445, 63], [445, 444], [446, 445], [446, 441], [446, 443], [447, 3], [448, 446], [448, 447], [449, 3], [450, 449], [450, 58], [450, 448], [451, 448], [451, 450], [451, 446], [452, 3], [453, 451], [453, 452], [454, 3], [455, 453], [455, 36], [455, 454], [456, 451], [456, 453], [456, 455], [457, 3], [458, 457], [458, 456], [459, 3], [460, 458], [460, 41], [460, 459], [461, 456], [461, 458], [461, 460], [462, 3], [463, 462], [463, 461], [464, 3], [465, 464], [465, 463], [466, 3], [467, 463], [467, 443], [467, 466], [468, 467], [469, 465], [469, 468], [470, 463], [470, 469], [471, 470], [472, 471], [473, 472], [474, 473], [475, 3], [476, 58], [476, 48], [476, 25], [476, 5], [476, 499], [476, 489], [476, 479], [476, 458], [476, 448], [476, 29], [476, 6], [476, 41], [476, 31], [476, 8], [476, 63], [476, 7], [476, 494], [476, 484], [476, 9], [476, 463], [476, 453], [476, 21], [476, 443], [476, 475], [476, 36], [476, 13], [477, 463], [477, 476], [477, 453], [477, 443], [477, 465], [477, 36], [477, 13], [477, 58], [477, 48], [477, 25], [477, 5], [477, 499], [477, 489], [477, 479], [477, 7], [477, 458], [477, 448], [477, 29], [477, 6], [477, 9], [477, 41], [477, 31], [477, 8], [477, 21], [477, 63], [477, 494], [477, 484], [478, 3], [479, 477], [479, 478], [480, 3], [481, 479], [481, 448], [481, 480], [482, 477], [482, 479], [482, 481], [483, 3], [484, 483], [484, 482], [485, 3], [486, 484], [486, 453], [486, 485], [487, 486], [487, 482], [487, 484], [488, 3], [489, 488], [489, 487], [490, 3], [491, 490], [491, 489], [491, 458], [492, 489], [492, 491], [492, 487], [493, 3], [494, 493], [494, 492], [495, 3], [496, 495], [496, 494], [496, 463], [497, 492], [497, 494], [497, 496], [498, 3], [499, 498], [499, 497], [506, 72], [507, 506], [508, 3], [509, 58], [509, 48], [509, 25], [509, 532], [509, 522], [509, 5], [509, 512], [509, 7], [509, 29], [509, 6], [509, 41], [509, 31], [509, 8], [509, 63], [509, 527], [509, 517], [509, 9], [509, 21], [509, 508], [509, 36], [509, 13], [510, 36], [510, 13], [510, 58], [510, 48], [510, 25], [510, 532], [510, 522], [510, 5], [510, 512], [510, 83], [510, 7], [510, 29], [510, 6], [510, 41], [510, 31], [510, 8], [510, 21], [510, 63], [510, 527], [510, 517], [510, 9], [510, 509], [511, 3], [512, 510], [512, 511], [513, 3], [514, 513], [514, 63], [514, 512], [515, 510], [515, 512], [515, 514], [516, 3], [517, 516], [517, 515], [518, 3], [519, 518], [519, 517], [519, 58], [520, 519], [520, 515], [520, 517], [521, 3], [522, 521], [522, 520], [523, 3], [524, 36], [524, 523], [524, 522], [525, 522], [525, 524], [525, 520], [526, 3], [527, 525], [527, 526], [528, 3], [529, 41], [529, 528], [529, 527], [530, 525], [530, 527], [530, 529], [531, 3], [532, 531], [532, 530], [535, 72], [536, 535], [537, 3], [538, 537], [538, 551], [538, 541], [538, 36], [538, 13], [538, 556], [538, 58], [538, 48], [538, 25], [538, 5], [538, 7], [538, 546], [538, 29], [538, 6], [538, 9], [538, 41], [538, 31], [538, 561], [538, 8], [538, 21], [538, 63], [539, 58], [539, 48], [539, 25], [539, 5], [539, 83], [539, 7], [539, 556], [539, 546], [539, 29], [539, 6], [539, 41], [539, 31], [539, 8], [539, 538], [539, 63], [539, 9], [539, 561], [539, 21], [539, 551], [539, 541], [539, 36], [539, 13], [540, 3], [541, 540], [541, 539], [542, 3], [543, 63], [543, 542], [543, 541], [544, 539], [544, 541], [544, 543], [545, 3], [546, 544], [546, 545], [547, 3], [548, 546], [548, 58], [548, 547], [549, 546], [549, 548], [549, 544], [550, 3], [551, 549], [551, 550], [552, 3], [553, 551], [553, 552], [553, 36], [554, 551], [554, 553], [554, 549], [555, 3], [556, 555], [556, 554], [557, 3], [558, 557], [558, 556], [558, 41], [559, 556], [559, 558], [559, 554], [560, 3], [561, 559], [561, 560], [566, 72], [567, 566], [568, 3], [569, 7], [569, 592], [569, 582], [569, 29], [569, 572], [569, 9], [569, 41], [569, 31], [569, 8], [569, 21], [569, 13], [569, 58], [569, 25], [569, 587], [569, 577], [569, 36], [569, 6], [569, 48], [569, 568], [569, 5], [569, 63], [570, 572], [570, 587], [570, 36], [570, 13], [570, 58], [570, 48], [570, 25], [570, 5], [570, 83], [570, 577], [570, 7], [570, 592], [570, 569], [570, 582], [570, 29], [570, 6], [570, 9], [570, 41], [570, 31], [570, 8], [570, 21], [570, 63], [571, 3], [572, 571], [572, 570], [573, 3], [574, 573], [574, 63], [574, 572], [575, 570], [575, 572], [575, 574], [576, 3], [577, 575], [577, 576], [578, 3], [579, 577], [579, 578], [579, 58], [580, 579], [580, 575], [580, 577], [581, 3], [582, 581], [582, 580], [583, 3], [584, 36], [584, 582], [584, 583], [585, 584], [585, 580], [585, 582], [586, 3], [587, 585], [587, 586], [588, 3], [589, 588], [589, 41], [589, 587], [590, 585], [590, 587], [590, 589], [591, 3], [592, 590], [592, 591], [595, 72], [596, 595], [597, 3], [598, 597], [598, 36], [598, 6], [598, 621], [598, 611], [598, 601], [598, 48], [598, 5], [598, 41], [598, 8], [598, 63], [598, 7], [598, 29], [598, 9], [598, 31], [598, 21], [598, 616], [598, 606], [598, 13], [598, 58], [598, 25], [599, 7], [599, 29], [599, 9], [599, 41], [599, 31], [599, 8], [599, 21], [599, 616], [599, 606], [599, 13], [599, 58], [599, 25], [599, 36], [599, 6], [599, 621], [599, 598], [599, 611], [599, 601], [599, 48], [599, 5], [599, 83], [599, 63], [600, 3], [601, 599], [601, 600], [602, 3], [603, 601], [603, 63], [603, 602], [604, 599], [604, 601], [604, 603], [605, 3], [606, 604], [606, 605], [607, 3], [608, 58], [608, 606], [608, 607], [609, 604], [609, 606], [609, 608], [610, 3], [611, 609], [611, 610], [612, 3], [613, 612], [613, 36], [613, 611], [614, 613], [614, 609], [614, 611], [615, 3], [616, 615], [616, 614], [617, 3], [618, 616], [618, 617], [618, 41], [619, 614], [619, 616], [619, 618], [620, 3], [621, 620], [621, 619], [626, 72], [628, 626], [630, 629], [631, 630], [632, 3], [633, 5], [633, 656], [633, 646], [633, 8], [633, 636], [633, 63], [633, 7], [633, 29], [633, 9], [633, 41], [633, 31], [633, 21], [633, 651], [633, 13], [633, 641], [633, 58], [633, 25], [633, 632], [633, 36], [633, 6], [633, 48], [634, 651], [634, 641], [634, 25], [634, 36], [634, 13], [634, 6], [634, 58], [634, 48], [634, 5], [634, 656], [634, 633], [634, 646], [634, 636], [634, 83], [634, 63], [634, 7], [634, 29], [634, 9], [634, 41], [634, 31], [634, 8], [634, 21], [635, 3], [636, 635], [636, 634], [637, 3], [638, 637], [638, 636], [638, 63], [639, 634], [639, 636], [639, 638], [640, 3], [641, 639], [641, 640], [642, 3], [643, 641], [643, 58], [643, 642], [644, 639], [644, 641], [644, 643], [645, 3], [646, 645], [646, 644], [647, 3], [648, 647], [648, 36], [648, 646], [649, 646], [649, 648], [649, 644], [650, 3], [651, 649], [651, 650], [652, 3], [653, 651], [653, 652], [653, 41], [654, 649], [654, 651], [654, 653], [655, 3], [656, 655], [656, 654], [657, 3], [658, 657], [660, 659], [662, 72], [663, 662], [664, 3], [665, 63], [665, 668], [665, 7], [665, 9], [665, 683], [665, 31], [665, 21], [665, 13], [665, 664], [665, 58], [665, 673], [665, 48], [665, 25], [665, 688], [665, 678], [665, 36], [665, 29], [665, 6], [665, 5], [665, 41], [665, 8], [666, 5], [666, 41], [666, 8], [666, 83], [666, 63], [666, 668], [666, 7], [666, 9], [666, 683], [666, 31], [666, 21], [666, 36], [666, 13], [666, 58], [666, 673], [666, 48], [666, 25], [666, 688], [666, 665], [666, 678], [666, 29], [666, 6], [667, 3], [668, 667], [668, 666], [669, 3], [670, 669], [670, 63], [670, 668], [671, 670], [671, 666], [671, 668], [672, 3], [673, 672], [673, 671], [674, 3], [675, 58], [675, 673], [675, 674], [676, 673], [676, 675], [676, 671], [677, 3], [678, 676], [678, 677], [679, 3], [680, 679], [680, 678], [680, 36], [681, 680], [681, 676], [681, 678], [682, 3], [683, 681], [683, 682], [684, 3], [685, 683], [685, 684], [685, 41], [686, 685], [686, 681], [686, 683], [687, 3], [688, 686], [688, 687], [689, 3], [690, 688], [690, 689], [691, 3], [692, 688], [692, 691], [692, 668], [693, 692], [694, 690], [694, 693], [695, 688], [695, 694], [696, 695], [697, 696], [698, 697], [699, 698], [700, 697], [701, 700], [702, 3], [703, 31], [703, 21], [703, 36], [703, 13], [703, 706], [703, 58], [703, 48], [703, 25], [703, 721], [703, 711], [703, 688], [703, 678], [703, 29], [703, 6], [703, 702], [703, 5], [703, 41], [703, 8], [703, 63], [703, 668], [703, 7], [703, 726], [703, 716], [703, 9], [703, 683], [703, 673], [704, 726], [704, 703], [704, 716], [704, 706], [704, 9], [704, 683], [704, 673], [704, 21], [704, 36], [704, 13], [704, 58], [704, 48], [704, 25], [704, 5], [704, 721], [704, 711], [704, 688], [704, 678], [704, 690], [704, 29], [704, 6], [704, 41], [704, 31], [704, 8], [704, 63], [704, 668], [704, 7], [705, 3], [706, 704], [706, 705], [707, 3], [708, 706], [708, 673], [708, 707], [709, 706], [709, 708], [709, 704], [710, 3], [711, 709], [711, 710], [712, 3], [713, 712], [713, 711], [713, 678], [714, 713], [714, 709], [714, 711], [715, 3], [716, 714], [716, 715], [717, 3], [718, 716], [718, 683], [718, 717], [719, 718], [719, 714], [719, 716], [720, 3], [721, 719], [721, 720], [722, 3], [723, 721], [723, 688], [723, 722], [724, 721], [724, 723], [724, 719], [725, 3], [726, 725], [726, 724], [727, 697], [728, 727], [732, 729], [732, 731], [734, 3], [735, 627], [736, 734], [743, 72], [744, 743], [745, 3], [746, 29], [746, 6], [746, 745], [746, 41], [746, 31], [746, 8], [746, 63], [746, 7], [746, 769], [746, 759], [746, 749], [746, 9], [746, 21], [746, 36], [746, 13], [746, 58], [746, 48], [746, 25], [746, 5], [746, 764], [746, 754], [747, 83], [747, 746], [747, 29], [747, 6], [747, 41], [747, 31], [747, 8], [747, 63], [747, 7], [747, 769], [747, 759], [747, 749], [747, 9], [747, 21], [747, 36], [747, 13], [747, 58], [747, 48], [747, 25], [747, 5], [747, 764], [747, 754], [748, 3], [749, 747], [749, 748], [750, 3], [751, 749], [751, 750], [751, 63], [752, 747], [752, 749], [752, 751], [753, 3], [754, 753], [754, 752], [755, 3], [756, 58], [756, 754], [756, 755], [757, 754], [757, 756], [757, 752], [758, 3], [759, 758], [759, 757], [760, 3], [761, 36], [761, 760], [761, 759], [762, 757], [762, 759], [762, 761], [763, 3], [764, 763], [764, 762], [765, 3], [766, 41], [766, 765], [766, 764], [767, 762], [767, 764], [767, 766], [768, 3], [769, 768], [769, 767], [770, 3], [771, 770], [771, 769], [772, 3], [773, 769], [773, 772], [773, 749], [774, 773], [775, 774], [775, 771], [776, 769], [776, 775], [777, 776], [778, 777], [779, 778], [780, 779], [781, 3], [782, 7], [782, 29], [782, 6], [782, 9], [782, 781], [782, 41], [782, 31], [782, 790], [782, 8], [782, 21], [782, 63], [782, 769], [782, 805], [782, 759], [782, 749], [782, 36], [782, 795], [782, 13], [782, 785], [782, 58], [782, 48], [782, 25], [782, 5], [782, 764], [782, 800], [782, 754], [783, 759], [783, 749], [783, 9], [783, 771], [783, 21], [783, 805], [783, 36], [783, 795], [783, 13], [783, 785], [783, 58], [783, 48], [783, 25], [783, 5], [783, 764], [783, 754], [783, 7], [783, 29], [783, 6], [783, 41], [783, 800], [783, 31], [783, 790], [783, 8], [783, 63], [783, 769], [783, 782], [784, 3], [785, 784], [785, 783], [786, 3], [787, 786], [787, 785], [787, 754], [788, 785], [788, 787], [788, 783], [789, 3], [790, 788], [790, 789], [791, 3], [792, 791], [792, 790], [792, 759], [793, 788], [793, 790], [793, 792], [794, 3], [795, 794], [795, 793], [796, 3], [797, 764], [797, 796], [797, 795], [798, 793], [798, 795], [798, 797], [799, 3], [800, 798], [800, 799], [801, 3], [802, 801], [802, 800], [802, 769], [803, 802], [803, 798], [803, 800], [804, 3], [805, 803], [805, 804], [812, 72], [813, 812], [814, 3], [815, 7], [815, 29], [815, 6], [815, 814], [815, 9], [815, 823], [815, 41], [815, 31], [815, 8], [815, 21], [815, 63], [815, 838], [815, 828], [815, 818], [815, 36], [815, 13], [815, 58], [815, 48], [815, 25], [815, 833], [815, 5], [816, 833], [816, 5], [816, 83], [816, 63], [816, 7], [816, 29], [816, 6], [816, 9], [816, 823], [816, 41], [816, 31], [816, 8], [816, 21], [816, 838], [816, 815], [816, 828], [816, 818], [816, 36], [816, 13], [816, 58], [816, 48], [816, 25], [817, 3], [818, 817], [818, 816], [819, 3], [820, 63], [820, 819], [820, 818], [821, 818], [821, 820], [821, 816], [822, 3], [823, 822], [823, 821], [824, 3], [825, 58], [825, 824], [825, 823], [826, 821], [826, 823], [826, 825], [827, 3], [828, 826], [828, 827], [829, 3], [830, 829], [830, 828], [830, 36], [831, 826], [831, 828], [831, 830], [832, 3], [833, 831], [833, 832], [834, 3], [835, 41], [835, 833], [835, 834], [836, 835], [836, 831], [836, 833], [837, 3], [838, 836], [838, 837], [843, 72], [844, 843], [845, 3], [846, 25], [846, 5], [846, 845], [846, 63], [846, 7], [846, 854], [846, 29], [846, 6], [846, 9], [846, 869], [846, 859], [846, 41], [846, 31], [846, 8], [846, 21], [846, 849], [846, 864], [846, 36], [846, 13], [846, 58], [846, 48], [847, 21], [847, 63], [847, 859], [847, 849], [847, 864], [847, 36], [847, 13], [847, 58], [847, 48], [847, 25], [847, 5], [847, 83], [847, 7], [847, 854], [847, 29], [847, 6], [847, 9], [847, 869], [847, 846], [847, 41], [847, 31], [847, 8], [848, 3], [849, 847], [849, 848], [850, 3], [851, 850], [851, 849], [851, 63], [852, 849], [852, 851], [852, 847], [853, 3], [854, 853], [854, 852], [855, 3], [856, 58], [856, 855], [856, 854], [857, 852], [857, 854], [857, 856], [858, 3], [859, 857], [859, 858], [860, 3], [861, 36], [861, 859], [861, 860], [862, 857], [862, 859], [862, 861], [863, 3], [864, 862], [864, 863], [865, 3], [866, 864], [866, 865], [866, 41], [867, 862], [867, 864], [867, 866], [868, 3], [869, 867], [869, 868], [890, 3], [891, 43], [892, 890], [895, 182], [895, 810], [895, 149], [895, 404], [895, 502], [895, 888], [895, 878], [895, 184], [895, 151], [895, 504], [895, 337], [895, 880], [895, 153], [895, 660], [895, 306], [895, 593], [895, 308], [895, 406], [895, 275], [895, 870], [895, 739], [895, 562], [895, 277], [895, 882], [895, 244], [895, 872], [895, 741], [895, 839], [895, 564], [895, 806], [895, 884], [895, 246], [895, 874], [895, 622], [895, 213], [895, 841], [895, 808], [895, 435], [895, 533], [895, 402], [895, 500], [895, 886], [895, 876], [895, 732], [895, 624], [895, 215], [896, 3], [897, 895], [897, 896], [898, 3], [899, 897], [899, 898], [900, 3], [901, 900], [901, 899], [902, 562], [902, 277], [902, 882], [902, 244], [902, 872], [902, 741], [902, 839], [902, 564], [902, 806], [902, 884], [902, 246], [902, 874], [902, 622], [902, 213], [902, 841], [902, 808], [902, 435], [902, 533], [902, 402], [902, 500], [902, 886], [902, 876], [902, 732], [902, 215], [902, 182], [902, 810], [902, 149], [902, 502], [902, 888], [902, 878], [902, 184], [902, 151], [902, 504], [902, 337], [902, 153], [902, 624], [902, 660], [902, 306], [902, 404], [902, 593], [902, 308], [902, 406], [902, 275], [902, 880], [902, 870], [902, 739], [904, 902], [904, 737], [904, 893]]}
| {"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_42009F", "query": "\n\n\n__int64 __fastcall sub_42009F(__int64 a1)\n{\n__int64 v1; // rsi\nunsigned int v2; // eax\nint v3; // eax\nint v5; // [rsp+44h] [rbp-Ch]\nint v6; // [rsp+44h] [rbp-Ch]\nint v7; // [rsp+48h] [rbp-8h]\nunsigned int v8; // [rsp+4Ch] [rbp-4h]\n\n*(_QWORD *)(a1 + 32) = 0LL;\n*(_QWORD *)(a1 + 40) = 0LL;\n*(_QWORD *)(a1 + 48) = 0LL;\n*(_QWORD *)(a1 + 56) = 0LL;\n*(_QWORD *)(a1 + 64) = 0LL;\n*(_DWORD *)(a1 + 44) = *(_DWORD *)(a1 + 12);\n*(_QWORD *)(a1 + 64) = *(unsigned int *)(a1 + 8) + *(_QWORD *)a1;\n*(_DWORD *)(a1 + 36) = *(_DWORD *)(a1 + 20);\n*(_DWORD *)(a1 + 40) = *(_DWORD *)(a1 + 24);\n*(_DWORD *)(a1 + 60) = 0;\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv1 = *(_QWORD *)a1;\nv2 = *(_DWORD *)(a1 + 8);\n*(_DWORD *)(a1 + 8) = v2 + 1;\nv7 = *(char *)(v1 + v2);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 24);\nv5 = *(char *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8));\nswitch ( v7 )\n{\ncase '!':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nif ( *(_BYTE *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8)) == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 64;\n}\nelse\n{\nv8 = 62;\n}\n}\nelse\n{\nv8 = 80;\n}\ngoto LABEL_78;\ncase '%':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 72;\n}\nelse\n{\nv8 = 48;\n}\ngoto LABEL_78;\ncase '&':\nif ( v5 == 38 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 66;\n}\nelse if ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 77;\n}\nelse\n{\nv8 = 49;\n}\ngoto LABEL_78;\ncase '(':\nv8 = 82;\ngoto LABEL_78;\ncase ')':\nv8 = 86;\ngoto LABEL_78;\ncase '*':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 70;\n}\nelse\n{\nv8 = 46;\n}\ngoto LABEL_78;\ncase '+':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 73;\n}\nelse\n{\nv8 = 50;\n}\ngoto LABEL_78;\ncase ',':\nv8 = 84;\ngoto LABEL_78;\ncase '-':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 74;\n}\nelse\n{\nv8 = 51;\n}\ngoto LABEL_78;\ncase '.':\nif ( sub_41EED4(v5, 0) )\n{\n--*(_DWORD *)(a1 + 8);\n--*(_DWORD *)(a1 + 24);\n--*(_DWORD *)(a1 + 12);\n--*(_DWORD *)(a1 + 48);\n--*(_DWORD *)(a1 + 52);\nv8 = sub_41F94B(a1);\n}\nelse if ( v5 == 46 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv6 = *(char *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8));\nif ( v6 != 60 && v6 != 46 )\nreturn sub_41F0D2(a1, \"Unrecognized Range operator\");\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nif ( v6 == 60 )\nv3 = 55;\nelse\nv3 = 56;\nv8 = v3;\n}\nelse\n{\nv8 = 85;\n}\nLABEL_78:\n*(_DWORD *)(a1 + 32) = v8;\n*(_DWORD *)(a1 + 56) = *(_DWORD *)(a1 + 28);\nreturn v8;\ncase '/':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 71;\n}\nelse\n{\nv8 = 47;\n}\ngoto LABEL_78;\ncase ':':\nv8 = 83;\ngoto LABEL_78;\ncase '<':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 58;\n}\nelse if ( v5 == 60 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nif ( *(_BYTE *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8)) == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 75;\n}\nelse\n{\nv8 = 44;\n}\n}\nelse\n{\nv8 = 57;\n}\ngoto LABEL_78;\ncase '=':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nif ( *(_BYTE *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8)) == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 63;\n}\nelse\n{\nv8 = 61;\n}\n}\nelse\n{\nv8 = 69;\n}\ngoto LABEL_78;\ncase '>':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 60;\n}\nelse if ( v5 == 62 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nif ( *(_BYTE *)(*(_QWORD *)a1 + *(unsigned int *)(a1 + 8)) == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 76;\n}\nelse\n{\nv8 = 45;\n}\n}\nelse\n{\nv8 = 59;\n}\ngoto LABEL_78;\ncase '?':\nv8 = 68;\ngoto LABEL_78;\ncase '[':\nv8 = 87;\ngoto LABEL_78;\ncase ']':\nv8 = 88;\ngoto LABEL_78;\ncase '^':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 79;\n}\nelse\n{\nv8 = 53;\n}\ngoto LABEL_78;\ncase '{':\nv8 = 89;\ngoto LABEL_78;\ncase '|':\nif ( v5 == 124 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 67;\n}\nelse if ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 78;\n}\nelse\n{\nv8 = 52;\n}\ngoto LABEL_78;\ncase '}':\nv8 = 90;\ngoto LABEL_78;\ncase '~':\nif ( v5 == 61 )\n{\n++*(_DWORD *)(a1 + 8);\n++*(_DWORD *)(a1 + 24);\n++*(_DWORD *)(a1 + 12);\n++*(_DWORD *)(a1 + 48);\n++*(_DWORD *)(a1 + 52);\nv8 = 65;\n}\nelse\n{\nv8 = 54;\n}\ngoto LABEL_78;\ndefault:\nreturn sub_41F0D2(a1, \"Unrecognized Operator\");\n}\n}\n\n\n\nQ:[a1,v5,v7,v8,sub_42009F,sub_41EED4,sub_41F94B,sub_41F0D2,]", "hints": "[]", "response": "{'a1': 'lexer', 'v5': 'c2', 'v7': 'c', 'v8': 'tok', 'sub_42009F': 'lexer_scan_operator', 'sub_41EED4': 'is_digit', 'sub_41F94B': 'lexer_scan_number', 'sub_41F0D2': 'lexer_error'}"} | [
[
0.8334147334098816,
0.8041282296180725,
0.7875751256942749,
0.7657657861709595,
0.7651334404945374,
0.7632564306259155,
0.7626187205314636,
0.7622900605201721,
0.7622802257537842,
0.7619221806526184,
0.7575325965881348,
0.7568110227584839,
0.756149172782898,
0.7441330552101135,
0.74178147315979,
0.7363836169242859,
0.7332538366317749,
0.7276123762130737,
0.7245354056358337,
0.7206403613090515
],
[
182488,
212842,
93184,
251767,
14202,
233167,
85679,
98209,
173074,
64198,
72828,
183071,
137294,
150942,
245328,
1578,
27468,
216115,
113586,
208493
]
] |
|
bf888s_save_image | db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219 | sergev | baoclone | NA | static void bf888s_save_image(FILE *img)
{
fwrite(radio_ident, 1, 8, img);
fwrite("\xff\xff\xff\xff\xff\xff\xff\xff", 1, 8, img);
fwrite(&radio_mem[0x10], 1, 0x2b0 - 0x10, img);
fwrite("\xff\xff\xff\xff\xff\xff\xff\xff", 1, 8, img);
fwrite("\xff\xff\xff\xff\xff\xff\xff\xff", 1, 8, img);
fwrite(&radio_mem[0x2c0], 1, 0x370 - 0x2c0, img);
fwrite(&radio_mem[0x2b0], 1, 0x10, img);
fwrite(&radio_mem[0x380], 1, 0x3e0 - 0x380, img);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40DAF4", "function_addr": 4250356, "binary_name": "db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 10h"], [3, "mov [rbp+s], rdi"], [4, "mov rax, [rbp+s]"], [5, "mov rcx, rax"], [6, "mov edx, 8"], [7, "mov esi, 1"], [8, "mov edi, offset ptr"], [9, "call _fwrite"], [10, "mov rax, [rbp+s]"], [11, "mov rcx, rax"], [12, "mov edx, 8"], [13, "mov esi, 1"], [14, "mov edi, offset unk_4158ED"], [15, "call _fwrite"], [16, "mov rax, [rbp+s]"], [17, "mov rcx, rax"], [18, "mov edx, 2A0h"], [19, "mov esi, 1"], [20, "mov edi, offset unk_41A9F0"], [21, "call _fwrite"], [22, "mov rax, [rbp+s]"], [23, "mov rcx, rax"], [24, "mov edx, 8"], [25, "mov esi, 1"], [26, "mov edi, offset unk_4158ED"], [27, "call _fwrite"], [28, "mov rax, [rbp+s]"], [29, "mov rcx, rax"], [30, "mov edx, 8"], [31, "mov esi, 1"], [32, "mov edi, offset unk_4158ED"], [33, "call _fwrite"], [34, "mov rax, [rbp+s]"], [35, "mov rcx, rax"], [36, "mov edx, 0B0h"], [37, "mov esi, 1"], [38, "mov edi, offset unk_41ACA0"], [39, "call _fwrite"], [40, "mov rax, [rbp+s]"], [41, "mov rcx, rax"], [42, "mov edx, 10h"], [43, "mov esi, 1"], [44, "mov edi, offset unk_41AC90"], [45, "call _fwrite"], [46, "mov rax, [rbp+s]"], [47, "mov rcx, rax"], [48, "mov edx, 60h "], [49, "mov esi, 1"], [50, "mov edi, offset unk_41AD60"], [51, "call _fwrite"], [52, "nop"], [53, "leave"], [54, "retn"]], "data_dep": [[4, 3], [5, 4], [10, 3], [11, 10], [16, 3], [17, 16], [22, 3], [23, 22], [28, 3], [29, 28], [34, 3], [35, 34], [40, 3], [41, 40], [46, 3], [47, 46], [54, 51]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219_db55e649e2cb5357ba74db4dd5cc89adf17b200bc32f8bf1531f9512b4b7a219.jsonl.gz", "strip_func_name": "sub_40DAF4", "query": "\n\n\nsize_t __fastcall sub_40DAF4(FILE *a1)\n{\nfwrite(ptr, 1uLL, 8uLL, a1);\nfwrite(&unk_4158ED, 1uLL, 8uLL, a1);\nfwrite(&unk_41A9F0, 1uLL, 0x2A0uLL, a1);\nfwrite(&unk_4158ED, 1uLL, 8uLL, a1);\nfwrite(&unk_4158ED, 1uLL, 8uLL, a1);\nfwrite(&unk_41ACA0, 1uLL, 0xB0uLL, a1);\nfwrite(qword_41AC90, 1uLL, 0x10uLL, a1);\nreturn fwrite(&unk_41AD60, 1uLL, 0x60uLL, a1);\n}\n\n\n\nQ:[a1,sub_40DAF4,]", "hints": "[]", "response": "{'a1': 'img', 'sub_40DAF4': 'bf888s_save_image'}"} | [
[
0.8133444786071777,
0.8121476769447327,
0.8090624213218689,
0.8069807291030884,
0.8067803978919983,
0.8061332106590271,
0.8008622527122498,
0.8003474473953247,
0.7989281415939331,
0.7957513332366943,
0.7939954996109009,
0.7916698455810547,
0.7903783321380615,
0.7853020429611206,
0.7847044467926025,
0.776240348815918,
0.7708551287651062,
0.7699617147445679,
0.7677243947982788,
0.7646834254264832
],
[
120732,
217224,
242039,
78684,
251801,
261955,
2000,
100206,
250808,
208997,
18218,
209594,
49261,
73310,
33672,
57163,
151114,
53092,
159329,
800
]
] |
|
FS_SavePackToFile | a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040 | ec- | Quake3e | NA | static qboolean FS_SavePackToFile( const pack_t *pak, FILE *f )
{
const char *namePtr;
const char *pakName;
int i, pakNameLen;
pk3cacheHeader_t pk;
pk3cacheFileItem_t it;
int namesLen, contentLen;
namePtr = (char*)(pak->buildBuffer + pak->numfiles);
pakName = pak->pakFilename;
pakNameLen = (int) strlen( pakName ) + 1;
pakNameLen = PAD( pakNameLen, sizeof( int ) );
namesLen = pakName - namePtr;
// file content length
contentLen = 0;
#if 0
for ( i = 0; i < pak->numfiles; i++ )
{
if ( pak->buildBuffer[ i ].data && pak->buildBuffer[ i ].size )
{
contentLen += sizeof( int ) + PAD( pak->buildBuffer[ i ].size, sizeof( int ) );
}
}
#endif
// pak filename length
pk.pakNameLen = pakNameLen;
// filenames length
pk.namesLen = namesLen;
// number of files
pk.numFiles = pak->numfiles;
// number of checksums
pk.numHeaderLongs = pak->numHeaderLongs;
// content of some files
pk.contentLen = contentLen;
// creation/status change time
pk.ctime = pak->ctime;
// modification time
pk.mtime = pak->mtime;
// pak file size
pk.size = pak->size;
// dump header
fwrite( &pk, sizeof( pk ), 1, f );
// pak filename
fwrite( pakName, pakNameLen, 1, f );
// filenames
fwrite( namePtr, namesLen, 1, f );
// file entries
for ( i = 0; i < pak->numfiles; i++ )
{
it.name = (unsigned long)(pak->buildBuffer[i].name - namePtr);
it.size = pak->buildBuffer[i].size;
it.pos = pak->buildBuffer[i].pos;
fwrite( &it, sizeof( it ), 1, f );
}
// pure checksums, excluding first uninitialized
fwrite( pak->headerLongs + 1, (pak->numHeaderLongs - 1) * sizeof( pak->headerLongs[0] ), 1, f );
#if 0
if ( contentLen )
{
const fileInPack_t *currFile = pak->buildBuffer;
for ( i = 0; i < pak->numfiles; i++, currFile++ )
{
if ( currFile->data && currFile->size ) {
// file index
fwrite( &i, sizeof( i ), 1, f );
// file data
fwrite( currFile->data, PAD( currFile->size, sizeof( int ) ), 1, f );
}
}
}
#endif
return qtrue;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_439662", "function_addr": 4429410, "binary_name": "a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "add rsp, 0FFFFFFFFFFFFFF80h"], [3, "mov [rbp+var_78], rdi"], [4, "mov [rbp+var_80], rsi"], [5, "mov rax, [rbp+var_78]"], [6, "mov rdx, [rax+40h]"], [7, "mov rax, [rbp+var_78]"], [8, "mov eax, [rax+28h]"], [9, "cdqe"], [10, "shl rax, 5"], [11, "add rax, rdx"], [12, "mov [rbp+var_10], rax"], [13, "mov rax, [rbp+var_78]"], [14, "mov rax, [rax]"], [15, "mov [rbp+s], rax"], [16, "mov rax, [rbp+s]"], [17, "mov rdi, rax"], [18, "call _strlen"], [19, "add eax, 1"], [20, "mov [rbp+var_1C], eax"], [21, "mov eax, [rbp+var_1C]"], [22, "add eax, 3"], [23, "and eax, 0FFFFFFFCh"], [24, "mov [rbp+var_1C], eax"], [25, "mov rax, [rbp+s]"], [26, "sub rax, [rbp+var_10]"], [27, "mov [rbp+var_20], eax"], [28, "mov [rbp+var_24], 0"], [29, "mov eax, [rbp+var_1C]"], [30, "mov [rbp+ptr], eax"], [31, "mov eax, [rbp+var_20]"], [32, "mov [rbp+var_4C], eax"], [33, "mov rax, [rbp+var_78]"], [34, "mov eax, [rax+28h]"], [35, "mov [rbp+var_48], eax"], [36, "mov rax, [rbp+var_78]"], [37, "mov eax, [rax+0A8h]"], [38, "mov [rbp+var_44], eax"], [39, "mov eax, [rbp+var_24]"], [40, "mov [rbp+var_40], eax"], [41, "mov rax, [rbp+var_78]"], [42, "mov rax, [rax+78h]"], [43, "mov [rbp+var_3C], rax"], [44, "mov rax, [rbp+var_78]"], [45, "mov rax, [rax+70h]"], [46, "mov [rbp+var_34], rax"], [47, "mov rax, [rbp+var_78]"], [48, "mov rax, [rax+68h]"], [49, "mov [rbp+var_2C], rax"], [50, "mov rdx, [rbp+var_80]"], [51, "lea rax, [rbp+ptr]"], [52, "mov rcx, rdx"], [53, "mov edx, 1"], [54, "mov esi, 2Ch "], [55, "mov rdi, rax"], [56, "call _fwrite"], [57, "mov eax, [rbp+var_1C]"], [58, "movsxd rsi, eax"], [59, "mov rdx, [rbp+var_80]"], [60, "mov rax, [rbp+s]"], [61, "mov rcx, rdx"], [62, "mov edx, 1"], [63, "mov rdi, rax"], [64, "call _fwrite"], [65, "mov eax, [rbp+var_20]"], [66, "movsxd rsi, eax"], [67, "mov rdx, [rbp+var_80]"], [68, "mov rax, [rbp+var_10]"], [69, "mov rcx, rdx"], [70, "mov edx, 1"], [71, "mov rdi, rax"], [72, "call _fwrite"], [73, "mov [rbp+var_4], 0"], [74, "jmp short loc_4397F0"], [75, "mov rax, [rbp+var_78]"], [76, "mov rdx, [rax+40h]"], [77, "mov eax, [rbp+var_4]"], [78, "cdqe"], [79, "shl rax, 5"], [80, "add rax, rdx"], [81, "mov rax, [rax]"], [82, "sub rax, [rbp+var_10]"], [83, "mov [rbp+var_70], rax"], [84, "mov rax, [rbp+var_78]"], [85, "mov rdx, [rax+40h]"], [86, "mov eax, [rbp+var_4]"], [87, "cdqe"], [88, "shl rax, 5"], [89, "add rax, rdx"], [90, "mov rax, [rax+10h]"], [91, "mov [rbp+var_68], rax"], [92, "mov rax, [rbp+var_78]"], [93, "mov rdx, [rax+40h]"], [94, "mov eax, [rbp+var_4]"], [95, "cdqe"], [96, "shl rax, 5"], [97, "add rax, rdx"], [98, "mov rax, [rax+8]"], [99, "mov [rbp+var_60], rax"], [100, "mov rdx, [rbp+var_80]"], [101, "lea rax, [rbp+var_70]"], [102, "mov rcx, rdx"], [103, "mov edx, 1"], [104, "mov esi, 18h"], [105, "mov rdi, rax"], [106, "call _fwrite"], [107, "add [rbp+var_4], 1"], [108, "mov rax, [rbp+var_78]"], [109, "mov eax, [rax+28h]"], [110, "cmp [rbp+var_4], eax"], [111, "jl loc_439778"], [112, "mov rax, [rbp+var_78]"], [113, "mov eax, [rax+0A8h]"], [114, "sub eax, 1"], [115, "cdqe"], [116, "lea rsi, ds:0[rax*4]"], [117, "mov rax, [rbp+var_78]"], [118, "mov rax, [rax+0A0h]"], [119, "lea rdi, [rax+4]"], [120, "mov rax, [rbp+var_80]"], [121, "mov rcx, rax"], [122, "mov edx, 1"], [123, "call _fwrite"], [124, "mov eax, 1"], [125, "leave"], [126, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 3], [8, 7], [10, 8], [11, 6], [11, 10], [12, 11], [13, 3], [14, 13], [15, 14], [16, 15], [17, 16], [19, 18], [20, 19], [21, 20], [22, 21], [23, 22], [24, 23], [25, 15], [26, 25], [26, 12], [27, 26], [29, 24], [30, 29], [31, 27], [32, 31], [33, 3], [34, 33], [35, 34], [36, 3], [37, 36], [38, 37], [39, 28], [40, 39], [41, 3], [42, 41], [43, 42], [44, 3], [45, 44], [46, 45], [47, 3], [48, 47], [49, 48], [50, 4], [51, 30], [51, 48], [52, 50], [55, 51], [57, 24], [58, 57], [59, 4], [60, 15], [61, 59], [63, 60], [65, 27], [66, 65], [67, 4], [68, 12], [69, 67], [71, 68], [75, 3], [76, 75], [77, 107], [77, 73], [79, 77], [80, 76], [80, 79], [81, 80], [82, 81], [82, 12], [83, 82], [84, 3], [85, 84], [86, 73], [86, 107], [88, 86], [89, 88], [89, 85], [90, 89], [91, 90], [92, 3], [93, 92], [94, 73], [94, 107], [96, 94], [97, 96], [97, 93], [98, 97], [99, 98], [100, 4], [101, 83], [101, 98], [102, 100], [105, 101], [107, 73], [107, 107], [108, 3], [109, 108], [110, 109], [110, 107], [110, 73], [111, 110], [112, 3], [113, 112], [114, 113], [116, 104], [116, 66], [117, 3], [118, 117], [119, 105], [119, 71], [119, 118], [120, 4], [121, 120], [126, 124]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040_a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.jsonl.gz", "strip_func_name": "sub_439662", "query": "\n\n\n__int64 __fastcall sub_439662(__int64 a1, FILE *a2)\n{\n__int64 v3[4]; // [rsp+10h] [rbp-70h] BYREF\nint ptr[5]; // [rsp+30h] [rbp-50h] BYREF\n__int64 v5; // [rsp+44h] [rbp-3Ch]\n__int64 v6; // [rsp+4Ch] [rbp-34h]\n__int64 v7; // [rsp+54h] [rbp-2Ch]\nint v8; // [rsp+5Ch] [rbp-24h]\nint v9; // [rsp+60h] [rbp-20h]\nint v10; // [rsp+64h] [rbp-1Ch]\nchar *s; // [rsp+68h] [rbp-18h]\nvoid *v12; // [rsp+70h] [rbp-10h]\nint i; // [rsp+7Ch] [rbp-4h]\n\nv12 = (void *)(*(_QWORD *)(a1 + 64) + 32LL * *(int *)(a1 + 40));\ns = *(char **)a1;\nv10 = (strlen(s) + 4) & 0xFFFFFFFC;\nv9 = (_DWORD)s - (_DWORD)v12;\nv8 = 0;\nptr[0] = v10;\nptr[1] = (_DWORD)s - (_DWORD)v12;\nptr[2] = *(_DWORD *)(a1 + 40);\nptr[3] = *(_DWORD *)(a1 + 168);\nptr[4] = 0;\nv5 = *(_QWORD *)(a1 + 120);\nv6 = *(_QWORD *)(a1 + 112);\nv7 = *(_QWORD *)(a1 + 104);\nfwrite(ptr, 0x2CuLL, 1uLL, a2);\nfwrite(s, v10, 1uLL, a2);\nfwrite(v12, v9, 1uLL, a2);\nfor ( i = 0; i < *(_DWORD *)(a1 + 40); ++i )\n{\nv3[0] = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 32LL * i) - (_QWORD)v12;\nv3[1] = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 32LL * i + 16);\nv3[2] = *(_QWORD *)(*(_QWORD *)(a1 + 64) + 32LL * i + 8);\nfwrite(v3, 0x18uLL, 1uLL, a2);\n}\nfwrite((const void *)(*(_QWORD *)(a1 + 160) + 4LL), 4LL * (*(_DWORD *)(a1 + 168) - 1), 1uLL, a2);\nreturn 1LL;\n}\n\n\n\nQ:[a1,a2,v3,ptr,v8,v9,v10,s,v12,sub_439662,]", "hints": "[]", "response": "{'a1': 'pak', 'a2': 'f', 'v3': 'it', 'ptr': 'pk', 'v8': 'contentLen', 'v9': 'namesLen', 'v10': 'pakNameLen', 's': 'pakName', 'v12': 'namePtr', 'sub_439662': 'FS_SavePackToFile'}"} | [
[
0.7492438554763794,
0.7231377363204956,
0.7229673266410828,
0.7197816371917725,
0.7161261439323425,
0.715907096862793,
0.7080678343772888,
0.7072845697402954,
0.7050825357437134,
0.6962562203407288,
0.6955221891403198,
0.6954073905944824,
0.6938188672065735,
0.6877152323722839,
0.6861302852630615,
0.6853898167610168,
0.6843331456184387,
0.6834356784820557,
0.6831837892532349,
0.6799975633621216
],
[
119652,
19597,
142997,
241707,
154866,
66282,
245217,
203797,
132502,
241495,
127500,
87459,
98231,
196215,
180139,
19459,
248333,
206508,
154359,
57014
]
] |
|
mlx_int_get_visual | d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f | 42Paris | minilibx-linux | NA | int mlx_int_get_visual(t_xvar *xvar)
{
XVisualInfo *vi;
XVisualInfo template;
int nb_item;
xvar->private_cmap = 0;
xvar->visual = DefaultVisual(xvar->display,xvar->screen);
if (xvar->visual->class == TrueColor)
return (0);
template.class = TrueColor;
template.depth = xvar->depth;
if (!(vi = XGetVisualInfo(xvar->display,VisualDepthMask|VisualClassMask,
&template,&nb_item)) )
return (-1);
xvar->visual = vi->visual;
xvar->private_cmap = 1;
return (0);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403DD1", "function_addr": 4210129, "binary_name": "d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 70h"], [3, "mov [rbp+var_68], rdi"], [4, "mov rax, [rbp+var_68]"], [5, "mov dword ptr [rax+28h], 0"], [6, "mov rax, [rbp+var_68]"], [7, "mov rax, [rax]"], [8, "mov rdx, [rax+0E8h]"], [9, "mov rax, [rbp+var_68]"], [10, "mov eax, [rax+10h]"], [11, "cdqe"], [12, "shl rax, 7"], [13, "add rax, rdx"], [14, "mov rdx, [rax+40h]"], [15, "mov rax, [rbp+var_68]"], [16, "mov [rax+18h], rdx"], [17, "mov rax, [rbp+var_68]"], [18, "mov rax, [rax+18h]"], [19, "mov eax, [rax+10h]"], [20, "cmp eax, 4"], [21, "jnz short loc_403E29"], [22, "mov eax, 0"], [23, "jmp short locret_403E87"], [24, "mov [rbp+var_50.c_class], 4"], [25, "mov rax, [rbp+var_68]"], [26, "mov eax, [rax+14h]"], [27, "mov [rbp+var_50.depth], eax"], [28, "mov rax, [rbp+var_68]"], [29, "mov rax, [rax]"], [30, "lea rcx, [rbp+var_54]"], [31, "lea rdx, [rbp+var_50]"], [32, "mov esi, 0Ch"], [33, "mov rdi, rax"], [34, "call _XGetVisualInfo"], [35, "mov [rbp+var_8], rax"], [36, "cmp [rbp+var_8], 0"], [37, "jnz short loc_403E68"], [38, "mov eax, 0FFFFFFFFh"], [39, "jmp short locret_403E87"], [40, "mov rax, [rbp+var_8]"], [41, "mov rdx, [rax]"], [42, "mov rax, [rbp+var_68]"], [43, "mov [rax+18h], rdx"], [44, "mov rax, [rbp+var_68]"], [45, "mov dword ptr [rax+28h], 1"], [46, "mov eax, 0"], [47, "leave"], [48, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 5], [7, 6], [8, 5], [8, 7], [9, 3], [10, 9], [10, 5], [12, 10], [13, 8], [13, 12], [14, 13], [14, 5], [15, 3], [16, 15], [16, 14], [17, 3], [18, 17], [18, 16], [19, 18], [19, 16], [20, 19], [21, 20], [25, 3], [26, 5], [26, 16], [26, 25], [27, 26], [28, 3], [29, 16], [29, 28], [29, 5], [31, 14], [33, 29], [35, 34], [36, 35], [37, 36], [40, 35], [41, 40], [41, 43], [41, 45], [41, 5], [41, 16], [42, 3], [43, 42], [43, 41], [44, 3], [45, 44], [48, 38], [48, 22], [48, 46]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f_d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.jsonl.gz", "strip_func_name": "sub_403DD1", "query": "\n\n\n__int64 __fastcall sub_403DD1(__int64 a1)\n{\nint v2; // [rsp+1Ch] [rbp-54h] BYREF\nXVisualInfo v3; // [rsp+20h] [rbp-50h] BYREF\nXVisualInfo *v4; // [rsp+68h] [rbp-8h]\n\n*(_DWORD *)(a1 + 40) = 0;\n*(_QWORD *)(a1 + 24) = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)a1 + 232LL) + ((__int64)*(int *)(a1 + 16) << 7) + 64);\nif ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 16LL) == 4 )\nreturn 0LL;\nv3.c_class = 4;\nv3.depth = *(_DWORD *)(a1 + 20);\nv4 = XGetVisualInfo(*(Display **)a1, 12LL, &v3, &v2);\nif ( !v4 )\nreturn 0xFFFFFFFFLL;\n*(_QWORD *)(a1 + 24) = v4->visual;\n*(_DWORD *)(a1 + 40) = 1;\nreturn 0LL;\n}\n\n\n\nQ:[a1,v2,v3,v4,sub_403DD1,]", "hints": "[]", "response": "{'a1': 'xvar', 'v2': 'nb_item', 'v3': 'templatea', 'v4': 'vi', 'sub_403DD1': 'mlx_int_get_visual'}"} | [
[
0.7186082005500793,
0.7141388654708862,
0.7034937143325806,
0.703316867351532,
0.6972233057022095,
0.6719903349876404,
0.6703847646713257,
0.6695061922073364,
0.6635692119598389,
0.6602219939231873,
0.6587511301040649,
0.6515423655509949,
0.6501196026802063,
0.6387231349945068,
0.6360558271408081,
0.6357024312019348,
0.6320673227310181,
0.6319126486778259,
0.6308119893074036,
0.6280118227005005
],
[
131249,
118881,
28693,
114064,
237421,
54694,
123233,
227150,
55362,
115113,
82596,
165474,
261048,
51144,
225679,
169922,
183462,
184714,
260870,
91732
]
] |
|
StdioFprintfFP | 001b6d37eda4b0b2e25f571e67a7549b8179adaa5dd1fa31408b780e16287d13 | larryhe | tiny-c-interpreter | NA | void StdioFprintfFP(StdOutStream *Stream, const char *Format, double 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_411E52", "function_addr": 4267602, "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, "movsd [rbp+var_28], xmm0"], [6, "mov rax, [rbp+var_18]"], [7, "mov rax, [rax]"], [8, "test rax, rax"], [9, "jz short loc_411EAE"], [10, "mov rax, [rbp+var_18]"], [11, "mov rax, [rax]"], [12, "mov rcx, [rbp+var_28]"], [13, "mov rdx, [rbp+format]"], [14, "movq xmm0, rcx"], [15, "mov rsi, rdx"], [16, "mov rdi, rax"], [17, "mov eax, 1"], [18, "call _fprintf"], [19, "mov edx, eax"], [20, "mov rax, [rbp+var_18]"], [21, "mov eax, [rax+14h]"], [22, "add edx, eax"], [23, "mov rax, [rbp+var_18]"], [24, "mov [rax+14h], edx"], [25, "jmp loc_411F7E"], [26, "mov rax, [rbp+var_18]"], [27, "mov eax, [rax+10h]"], [28, "test eax, eax"], [29, "js short loc_411F2B"], [30, "mov rax, [rbp+var_18]"], [31, "mov eax, [rax+10h]"], [32, "movsxd rcx, eax"], [33, "mov rax, [rbp+var_18]"], [34, "mov rax, [rax+8]"], [35, "mov rsi, [rbp+var_28]"], [36, "mov rdx, [rbp+format]"], [37, "movq xmm0, rsi"], [38, "mov rsi, rcx"], [39, "mov rdi, rax"], [40, "mov eax, 1"], [41, "call _snprintf"], [42, "mov [rbp+var_8], eax"], [43, "mov rax, [rbp+var_18]"], [44, "mov rdx, [rax+8]"], [45, "mov eax, [rbp+var_8]"], [46, "cdqe"], [47, "add rdx, rax"], [48, "mov rax, [rbp+var_18]"], [49, "mov [rax+8], rdx"], [50, "mov rax, [rbp+var_18]"], [51, "mov eax, [rax+10h]"], [52, "sub eax, [rbp+var_8]"], [53, "mov edx, eax"], [54, "mov rax, [rbp+var_18]"], [55, "mov [rax+10h], edx"], [56, "mov rax, [rbp+var_18]"], [57, "mov edx, [rax+14h]"], [58, "mov eax, [rbp+var_8]"], [59, "add edx, eax"], [60, "mov rax, [rbp+var_18]"], [61, "mov [rax+14h], edx"], [62, "jmp short loc_411F7E"], [63, "mov rax, [rbp+var_18]"], [64, "mov rax, [rax+8]"], [65, "mov rcx, [rbp+var_28]"], [66, "mov rdx, [rbp+format]"], [67, "movq xmm0, rcx"], [68, "mov rsi, rdx"], [69, "mov rdi, rax"], [70, "mov eax, 1"], [71, "call _sprintf"], [72, "mov [rbp+var_4], eax"], [73, "mov rax, [rbp+var_18]"], [74, "mov edx, [rax+14h]"], [75, "mov eax, [rbp+var_4]"], [76, "add edx, eax"], [77, "mov rax, [rbp+var_18]"], [78, "mov [rax+14h], edx"], [79, "mov rax, [rbp+var_18]"], [80, "mov rdx, [rax+8]"], [81, "mov eax, [rbp+var_4]"], [82, "cdqe"], [83, "add rdx, rax"], [84, "mov rax, [rbp+var_18]"], [85, "mov [rax+8], rdx"], [86, "nop"], [87, "leave"], [88, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [9, 8], [10, 3], [11, 10], [12, 5], [13, 4], [14, 12], [15, 13], [16, 11], [19, 18], [20, 3], [21, 20], [22, 19], [22, 21], [23, 3], [24, 23], [24, 22], [26, 3], [27, 26], [28, 27], [29, 28], [30, 3], [31, 30], [32, 31], [33, 3], [34, 33], [35, 5], [36, 4], [37, 35], [38, 32], [39, 34], [42, 41], [43, 3], [44, 43], [45, 42], [47, 45], [47, 44], [48, 3], [49, 48], [49, 47], [50, 3], [51, 50], [51, 49], [52, 42], [52, 51], [53, 52], [54, 3], [55, 54], [55, 53], [56, 3], [57, 56], [57, 55], [58, 42], [59, 57], [59, 58], [60, 3], [61, 60], [61, 59], [63, 3], [64, 63], [65, 5], [66, 4], [67, 65], [68, 66], [69, 64], [72, 71], [73, 3], [74, 73], [75, 72], [76, 74], [76, 75], [77, 3], [78, 77], [78, 76], [79, 3], [80, 78], [80, 79], [81, 72], [83, 80], [83, 81], [84, 3], [85, 84], [85, 83], [88, 60], [88, 23], [88, 84]]}
| {"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_411E52", "query": "\n\n\n__int64 __fastcall sub_411E52(__int64 a1, const char *a2, double 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:[a1,a2,a3,sub_411E52,]", "hints": "[]", "response": "{'a1': 'Stream', 'a2': 'Format', 'a3': 'Value', 'sub_411E52': 'StdioFprintfFP'}"} | [
[
0.699463427066803,
0.6948662996292114,
0.6934404373168945,
0.6814208030700684,
0.6741315126419067,
0.6737814545631409,
0.6705576181411743,
0.668725848197937,
0.6673443913459778,
0.6637890934944153,
0.6630460619926453,
0.6598303318023682,
0.6595308780670166,
0.6593272089958191,
0.6586592793464661,
0.6580182313919067,
0.6563061475753784,
0.6561000347137451,
0.6560904383659363,
0.652620792388916
],
[
231665,
250517,
245211,
263414,
259122,
53942,
157411,
235849,
112236,
130823,
92831,
100875,
190533,
26848,
112864,
82731,
86119,
74239,
159169,
66832
]
] |
|
mlx_int_str_str | d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f | 42Paris | minilibx-linux | NA | int mlx_int_str_str(char *str,char *find,int len)
{
int len_f;
int pos;
char *s;
char *f;
len_f = strlen(find);
if (len_f>len)
return (-1);
pos = 0;
while (*(str+len_f-1))
{
s = str;
f = find;
while (*(f++) == *(s++))
if (!*f)
return (pos);
str ++;
pos ++;
}
return (-1);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40586F", "function_addr": 4216943, "binary_name": "d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.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 rax, [rbp+s]"], [7, "mov rdi, rax"], [8, "call _strlen"], [9, "mov [rbp+var_1C], eax"], [10, "mov eax, [rbp+var_1C]"], [11, "cmp eax, [rbp+var_34]"], [12, "jle short loc_4058A0"], [13, "mov eax, 0FFFFFFFFh"], [14, "jmp short locret_405912"], [15, "mov [rbp+var_4], 0"], [16, "jmp short loc_4058F6"], [17, "mov rax, [rbp+var_28]"], [18, "mov [rbp+var_10], rax"], [19, "mov rax, [rbp+s]"], [20, "mov [rbp+var_18], rax"], [21, "jmp short loc_4058CB"], [22, "mov rax, [rbp+var_18]"], [23, "movzx eax, byte ptr [rax]"], [24, "test al, al"], [25, "jnz short loc_4058CB"], [26, "mov eax, [rbp+var_4]"], [27, "jmp short locret_405912"], [28, "mov rax, [rbp+var_18]"], [29, "lea rdx, [rax+1]"], [30, "mov [rbp+var_18], rdx"], [31, "movzx ecx, byte ptr [rax]"], [32, "mov rax, [rbp+var_10]"], [33, "lea rdx, [rax+1]"], [34, "mov [rbp+var_10], rdx"], [35, "movzx eax, byte ptr [rax]"], [36, "cmp cl, al"], [37, "jz short loc_4058BB"], [38, "add [rbp+var_28], 1"], [39, "add [rbp+var_4], 1"], [40, "mov eax, [rbp+var_1C]"], [41, "cdqe"], [42, "lea rdx, [rax-1]"], [43, "mov rax, [rbp+var_28]"], [44, "add rax, rdx"], [45, "movzx eax, byte ptr [rax]"], [46, "test al, al"], [47, "jnz short loc_4058A9"], [48, "mov eax, 0FFFFFFFFh"], [49, "leave"], [50, "retn"]], "data_dep": [[6, 4], [7, 6], [9, 8], [10, 9], [11, 5], [11, 10], [12, 11], [17, 3], [17, 38], [18, 17], [19, 4], [20, 19], [22, 30], [23, 22], [24, 23], [25, 24], [26, 39], [26, 15], [28, 30], [28, 20], [29, 28], [29, 33], [29, 42], [30, 29], [31, 28], [32, 34], [32, 18], [33, 29], [33, 32], [34, 33], [35, 32], [36, 31], [36, 35], [37, 36], [38, 38], [38, 3], [39, 39], [39, 15], [40, 9], [42, 40], [42, 33], [43, 3], [43, 38], [44, 42], [44, 43], [45, 44], [46, 45], [47, 46], [50, 48], [50, 26], [50, 13]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f_d34d963228b646d76b927241adc86bca0f1524fd669b85830dba0179315ad17f.jsonl.gz", "strip_func_name": "sub_40586F", "query": "\n\n\n__int64 __fastcall sub_40586F(_BYTE *a1, const char *a2, int a3)\n{\nconst char *v4; // rax\nchar v5; // cl\n_BYTE *v6; // rax\nint v9; // [rsp+24h] [rbp-1Ch]\nconst char *v10; // [rsp+28h] [rbp-18h]\n_BYTE *v11; // [rsp+30h] [rbp-10h]\nunsigned int v12; // [rsp+3Ch] [rbp-4h]\n\nv9 = strlen(a2);\nif ( v9 > a3 )\nreturn 0xFFFFFFFFLL;\nv12 = 0;\nwhile ( a1[v9 - 1] )\n{\nv11 = a1;\nv10 = a2;\nwhile ( 1 )\n{\nv4 = v10++;\nv5 = *v4;\nv6 = v11++;\nif ( v5 != *v6 )\nbreak;\nif ( !*v10 )\nreturn v12;\n}\n++a1;\n++v12;\n}\nreturn 0xFFFFFFFFLL;\n}\n\n\n\nQ:[a3,a1,a2,v9,v10,v11,v12,sub_40586F,]", "hints": "[]", "response": "{'a3': 'len', 'a1': 'str', 'a2': 'find', 'v9': 'len_f', 'v10': 'f', 'v11': 's', 'v12': 'pos', 'sub_40586F': 'mlx_int_str_str'}"} | [
[
0.7535478472709656,
0.7483528256416321,
0.7372359037399292,
0.7019554972648621,
0.69060879945755,
0.683800220489502,
0.6830683350563049,
0.6827336549758911,
0.6822830438613892,
0.6822606921195984,
0.6801354885101318,
0.6789530515670776,
0.6786907911300659,
0.6760410666465759,
0.6741390824317932,
0.6725927591323853,
0.6723451614379883,
0.6720127463340759,
0.6714473962783813,
0.6701803803443909
],
[
78294,
97527,
178689,
215788,
114303,
200550,
3252,
123445,
112707,
236680,
92888,
194488,
97995,
59609,
118372,
209871,
198777,
264524,
248300,
245125
]
] |
|
is_sensible_string | 75b9fa26865746d1c239a35d692f18134ca907bd08ea476f975ae902a6c14ae7 | RIOT-OS | Tutorials | NA | int
is_sensible_string(const unsigned char *s, size_t len)
{
if(len > 0) {
if (s[0] == 0x60) {
/* Possibly IPv6 packet with default traffic class, assume non-printable */
return 0;
}
}
int ret = 0;
for (size_t i = 0; i < len; i++) {
if (s[i] == '\r' || s[i] == '\n' || s[i] == '\t') {
continue;
}
else if (s[i] < ' ' || '~' < s[i]) {
return 0;
}
/* only return 1 if the string contains at least one letter or number */
if('A' <= s[i] && s[i] <= 'Z') {
ret = 1;
}
else if('a' <= s[i] && s[i] <= 'z') {
ret = 1;
}
else if('0' <= s[i] && s[i] <= '9') {
ret = 1;
}
}
return ret;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402686", "function_addr": 4204166, "binary_name": "75b9fa26865746d1c239a35d692f18134ca907bd08ea476f975ae902a6c14ae7.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, "cmp [rbp+var_20], 0"], [5, "jz short loc_4026AE"], [6, "mov rax, [rbp+var_18]"], [7, "movzx eax, byte ptr [rax]"], [8, "cmp al, 60h "], [9, "jnz short loc_4026AE"], [10, "mov eax, 0"], [11, "jmp loc_4027D0"], [12, "mov [rbp+var_4], 0"], [13, "mov [rbp+var_10], 0"], [14, "jmp loc_4027BF"], [15, "mov rdx, [rbp+var_18]"], [16, "mov rax, [rbp+var_10]"], [17, "add rax, rdx"], [18, "movzx eax, byte ptr [rax]"], [19, "cmp al, 0Dh"], [20, "jz loc_4027B9"], [21, "mov rdx, [rbp+var_18]"], [22, "mov rax, [rbp+var_10]"], [23, "add rax, rdx"], [24, "movzx eax, byte ptr [rax]"], [25, "cmp al, 0Ah"], [26, "jz loc_4027B9"], [27, "mov rdx, [rbp+var_18]"], [28, "mov rax, [rbp+var_10]"], [29, "add rax, rdx"], [30, "movzx eax, byte ptr [rax]"], [31, "cmp al, 9"], [32, "jz loc_4027B9"], [33, "mov rdx, [rbp+var_18]"], [34, "mov rax, [rbp+var_10]"], [35, "add rax, rdx"], [36, "movzx eax, byte ptr [rax]"], [37, "cmp al, 1Fh"], [38, "jbe short loc_402728"], [39, "mov rdx, [rbp+var_18]"], [40, "mov rax, [rbp+var_10]"], [41, "add rax, rdx"], [42, "movzx eax, byte ptr [rax]"], [43, "cmp al, 7Eh "], [44, "jbe short loc_402732"], [45, "mov eax, 0"], [46, "jmp loc_4027D0"], [47, "mov rdx, [rbp+var_18]"], [48, "mov rax, [rbp+var_10]"], [49, "add rax, rdx"], [50, "movzx eax, byte ptr [rax]"], [51, "cmp al, 40h "], [52, "jbe short loc_40275F"], [53, "mov rdx, [rbp+var_18]"], [54, "mov rax, [rbp+var_10]"], [55, "add rax, rdx"], [56, "movzx eax, byte ptr [rax]"], [57, "cmp al, 5Ah "], [58, "ja short loc_40275F"], [59, "mov [rbp+var_4], 1"], [60, "jmp short loc_4027BA"], [61, "mov rdx, [rbp+var_18]"], [62, "mov rax, [rbp+var_10]"], [63, "add rax, rdx"], [64, "movzx eax, byte ptr [rax]"], [65, "cmp al, 60h "], [66, "jbe short loc_40278C"], [67, "mov rdx, [rbp+var_18]"], [68, "mov rax, [rbp+var_10]"], [69, "add rax, rdx"], [70, "movzx eax, byte ptr [rax]"], [71, "cmp al, 7Ah "], [72, "ja short loc_40278C"], [73, "mov [rbp+var_4], 1"], [74, "jmp short loc_4027BA"], [75, "mov rdx, [rbp+var_18]"], [76, "mov rax, [rbp+var_10]"], [77, "add rax, rdx"], [78, "movzx eax, byte ptr [rax]"], [79, "cmp al, 2Fh "], [80, "jbe short loc_4027BA"], [81, "mov rdx, [rbp+var_18]"], [82, "mov rax, [rbp+var_10]"], [83, "add rax, rdx"], [84, "movzx eax, byte ptr [rax]"], [85, "cmp al, 39h "], [86, "ja short loc_4027BA"], [87, "mov [rbp+var_4], 1"], [88, "jmp short loc_4027BA"], [89, "nop"], [90, "add [rbp+var_10], 1"], [91, "mov rax, [rbp+var_10]"], [92, "cmp rax, [rbp+var_20]"], [93, "jb loc_4026C2"], [94, "mov eax, [rbp+var_4]"], [95, "pop rbp"], [96, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 2], [7, 6], [8, 7], [9, 8], [15, 2], [16, 13], [16, 90], [17, 16], [17, 15], [18, 17], [19, 18], [20, 19], [21, 2], [22, 90], [22, 13], [23, 22], [23, 21], [24, 23], [25, 24], [26, 25], [27, 2], [28, 13], [28, 90], [29, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 2], [34, 13], [34, 90], [35, 33], [35, 34], [36, 35], [37, 36], [38, 37], [39, 2], [40, 13], [40, 90], [41, 40], [41, 39], [42, 41], [43, 42], [44, 43], [47, 2], [48, 90], [48, 13], [49, 48], [49, 47], [50, 49], [51, 50], [52, 51], [53, 2], [54, 13], [54, 90], [55, 54], [55, 53], [56, 55], [57, 56], [58, 57], [61, 2], [62, 90], [62, 13], [63, 61], [63, 62], [64, 63], [65, 64], [66, 65], [67, 2], [68, 13], [68, 90], [69, 67], [69, 68], [70, 69], [71, 70], [72, 71], [75, 2], [76, 90], [76, 13], [77, 76], [77, 75], [78, 77], [79, 78], [80, 79], [81, 2], [82, 90], [82, 13], [83, 82], [83, 81], [84, 83], [85, 84], [86, 85], [90, 90], [90, 13], [91, 13], [91, 90], [92, 3], [92, 91], [93, 92], [94, 12], [94, 87], [94, 73], [94, 59], [95, 0], [96, 10], [96, 94], [96, 45]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/75b9fa26865746d1c239a35d692f18134ca907bd08ea476f975ae902a6c14ae7_75b9fa26865746d1c239a35d692f18134ca907bd08ea476f975ae902a6c14ae7.jsonl.gz", "strip_func_name": "sub_402686", "query": "\n\n\n__int64 __fastcall sub_402686(_BYTE *a1, unsigned __int64 a2)\n{\nunsigned __int64 i; // [rsp+10h] [rbp-10h]\nunsigned int v4; // [rsp+1Ch] [rbp-4h]\n\nif ( a2 && *a1 == 96 )\nreturn 0LL;\nv4 = 0;\nfor ( i = 0LL; i < a2; ++i )\n{\nif ( a1[i] != 13 && a1[i] != 10 && a1[i] != 9 )\n{\nif ( a1[i] <= 0x1Fu || a1[i] > 0x7Eu )\nreturn 0LL;\nif ( a1[i] <= 0x40u || a1[i] > 0x5Au )\n{\nif ( a1[i] <= 0x60u || a1[i] > 0x7Au )\n{\nif ( a1[i] > 0x2Fu && a1[i] <= 0x39u )\nv4 = 1;\n}\nelse\n{\nv4 = 1;\n}\n}\nelse\n{\nv4 = 1;\n}\n}\n}\nreturn v4;\n}\n\n\n\nQ:[a1,a2,sub_402686,]", "hints": "[]", "response": "{'a1': 's', 'a2': 'len', 'sub_402686': 'is_sensible_string'}"} | [
[
0.8514917492866516,
0.8462662696838379,
0.8287619352340698,
0.8271640539169312,
0.7959581613540649,
0.786059558391571,
0.7838336229324341,
0.7748633623123169,
0.7538612484931946,
0.752916693687439,
0.7516356110572815,
0.7491568922996521,
0.7470632195472717,
0.745799720287323,
0.7452826499938965,
0.7396143674850464,
0.7392981052398682,
0.7376040816307068,
0.728162407875061,
0.7268285751342773
],
[
124187,
161071,
237352,
42493,
52051,
125632,
14029,
42947,
198080,
264472,
209332,
186311,
123324,
154766,
155416,
53344,
50424,
39391,
207850,
182153
]
] |
|
print_status | 2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567 | solusipse | fiche | NA | static void print_status(const char *format, ...) {
va_list args;
va_start(args, format);
printf("[Fiche][STATUS] ");
vprintf(format, args);
printf("\n");
va_end(args);
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4017A2", "function_addr": 4200354, "binary_name": "2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.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_4017FB"], [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 edi, offset aFicheStatus"], [26, "mov eax, 0"], [27, "call _printf"], [28, "lea rdx, [rbp+arg]"], [29, "mov rax, [rbp+format]"], [30, "mov rsi, rdx"], [31, "mov rdi, rax"], [32, "call _vprintf"], [33, "mov edi, 0Ah"], [34, "call _putchar"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[10, 9], [21, 9], [22, 21], [23, 21], [24, 23], [28, 19], [29, 3], [30, 28], [31, 29], [37, 34]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567_2f9a70287dba42e5f72b74bacaaa190f03def97bf7d7c0c64d2141f0330e0567.jsonl.gz", "strip_func_name": "sub_4017A2", "query": "\n\n\nint sub_4017A2(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;\nprintf(\"[Fiche][STATUS] \");\nvprintf(a1, arg);\nreturn putchar(10);\n}\n\n\n\nQ:[a1,arg,sub_4017A2,]", "hints": "[]", "response": "{'a1': 'format', 'arg': 'args', 'sub_4017A2': 'print_status'}"} | [
[
0.8215377926826477,
0.8003911375999451,
0.7989528179168701,
0.7981812953948975,
0.7751211524009705,
0.7591400742530823,
0.7588171362876892,
0.7530355453491211,
0.7412806153297424,
0.7256976366043091,
0.72454833984375,
0.7098389863967896,
0.7051330208778381,
0.7051068544387817,
0.7039855718612671,
0.7031963467597961,
0.70243239402771,
0.6992529630661011,
0.6985011696815491,
0.6979807615280151
],
[
157197,
121817,
112999,
119662,
82297,
185272,
27220,
75465,
203786,
259568,
25873,
182889,
228751,
251996,
185125,
229133,
38930,
221992,
232672,
34324
]
] |
|
set_monitor | e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c | evilpan | Airkiss | NA | int set_monitor( struct priv_linux *dev, char *iface, int fd )
{
int pid, status, unused;
struct iwreq wrq;
char strbuf[512];
if( strcmp(iface,"prism0") == 0 )
{
dev->wl = wiToolsPath("wl");
if( ( pid = fork() ) == 0 )
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execl( dev->wl, "wl", "monitor", "1", NULL);
exit( 1 );
}
waitpid( pid, &status, 0 );
if( WIFEXITED(status) )
return( WEXITSTATUS(status) );
return( 1 );
}
else if (strncmp(iface, "rtap", 4) == 0 )
{
return 0;
}
else
{
switch(dev->drivertype) {
case DT_WLANNG:
if( ( pid = fork() ) == 0 )
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execl( dev->wlanctlng, "wlanctl-ng", iface,
"lnxreq_wlansniff", "enable=true",
"prismheader=true", "wlanheader=false",
"stripfcs=true", "keepwepflags=true",
"6", NULL );
exit( 1 );
}
waitpid( pid, &status, 0 );
if( WIFEXITED(status) )
return( WEXITSTATUS(status) );
return( 1 );
break;
case DT_ORINOCO:
if( ( pid = fork() ) == 0 )
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execlp( dev->iwpriv, "iwpriv", iface,
"monitor", "1", "1", NULL );
exit( 1 );
}
waitpid( pid, &status, 0 );
if( WIFEXITED(status) )
return( WEXITSTATUS(status) );
return 1;
break;
case DT_ACX:
if( ( pid = fork() ) == 0 )
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execlp( dev->iwpriv, "iwpriv", iface,
"monitor", "2", "1", NULL );
exit( 1 );
}
waitpid( pid, &status, 0 );
if( WIFEXITED(status) )
return( WEXITSTATUS(status) );
return 1;
break;
case DT_MAC80211_RT:
snprintf(strbuf, sizeof(strbuf) - 1, "ifconfig %s down", iface);
if (system(strbuf) == 0)
printf("down iface %s\n", iface);
snprintf(strbuf, sizeof(strbuf) - 1, "iw %s set type monitor", iface);
if (system(strbuf) == 0)
printf("set iface %s type to monitor\n", iface);
snprintf(strbuf, sizeof(strbuf) - 1, "ifconfig %s up", iface);
if (system(strbuf) == 0)
printf("up iface %s\n", iface);
return 0;
default:
break;
}
memset( &wrq, 0, sizeof( struct iwreq ) );
strncpy( wrq.ifr_name, iface, IFNAMSIZ );
wrq.u.mode = IW_MODE_MONITOR;
if( ioctl( fd, SIOCSIWMODE, &wrq ) < 0 )
{
perror( "ioctl(SIOCSIWMODE) failed" );
return( 1 );
}
if(dev->drivertype == DT_AT76USB)
{
sleep(3);
}
}
/* couple of iwprivs to enable the prism header */
if( ! fork() ) /* hostap */
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execlp( "iwpriv", "iwpriv", iface, "monitor_type", "1", NULL );
exit( 1 );
}
wait( NULL );
if( ! fork() ) /* r8180 */
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execlp( "iwpriv", "iwpriv", iface, "prismhdr", "1", NULL );
exit( 1 );
}
wait( NULL );
if( ! fork() ) /* prism54 */
{
close( 0 ); close( 1 ); close( 2 ); unused = chdir( "/" );
execlp( "iwpriv", "iwpriv", iface, "set_prismhdr", "1", NULL );
exit( 1 );
}
wait( NULL );
return( 0 );
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_405576", "function_addr": 4216182, "binary_name": "e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 250h"], [3, "mov [rbp+var_238], rdi"], [4, "mov [rbp+s1], rsi"], [5, "mov [rbp+fd], edx"], [6, "mov rax, [rbp+s1]"], [7, "mov esi, offset s2"], [8, "mov rdi, rax"], [9, "call _strcmp"], [10, "test eax, eax"], [11, "jnz loc_40566E"], [12, "mov edi, offset aWl"], [13, "call sub_403A67"], [14, "mov rdx, [rbp+var_238]"], [15, "mov [rdx+50h], rax"], [16, "call _fork"], [17, "mov [rbp+pid], eax"], [18, "cmp [rbp+pid], 0"], [19, "jnz short loc_405636"], [20, "mov edi, 0"], [21, "call _close"], [22, "mov edi, 1"], [23, "call _close"], [24, "mov edi, 2"], [25, "call _close"], [26, "mov edi, offset path"], [27, "call _chdir"], [28, "mov [rbp+var_8], eax"], [29, "mov rax, [rbp+var_238]"], [30, "mov rax, [rax+50h]"], [31, "mov r8d, 0"], [32, "mov ecx, offset a1"], [33, "mov edx, offset aMonitor"], [34, "mov esi, offset aWl"], [35, "mov rdi, rax"], [36, "mov eax, 0"], [37, "call _execl"], [38, "mov edi, 1"], [39, "call _exit"], [40, "lea rcx, [rbp+stat_loc]"], [41, "mov eax, [rbp+pid]"], [42, "mov edx, 0"], [43, "mov rsi, rcx"], [44, "mov edi, eax"], [45, "call _waitpid"], [46, "mov eax, [rbp+stat_loc]"], [47, "and eax, 7Fh"], [48, "test eax, eax"], [49, "jnz short loc_405664"], [50, "mov eax, [rbp+stat_loc]"], [51, "sar eax, 8"], [52, "movzx eax, al"], [53, "jmp locret_405C11"], [54, "mov eax, 1"], [55, "jmp locret_405C11"], [56, "mov rax, [rbp+s1]"], [57, "mov edx, 4"], [58, "mov esi, offset aRtap"], [59, "mov rdi, rax"], [60, "call _strncmp"], [61, "test eax, eax"], [62, "jnz short loc_405695"], [63, "mov eax, 0"], [64, "jmp locret_405C11"], [65, "mov rax, [rbp+var_238]"], [66, "mov eax, [rax+18h]"], [67, "cmp eax, 9"], [68, "jz loc_40591C"], [69, "cmp eax, 9"], [70, "ja loc_405A22"], [71, "cmp eax, 8"], [72, "jz loc_405862"], [73, "cmp eax, 8"], [74, "ja loc_405A22"], [75, "cmp eax, 1"], [76, "jz short loc_4056D6"], [77, "cmp eax, 6"], [78, "jz loc_4057A8"], [79, "jmp loc_405A22"], [80, "call _fork"], [81, "mov [rbp+pid], eax"], [82, "cmp [rbp+pid], 0"], [83, "jnz loc_405770"], [84, "mov edi, 0"], [85, "call _close"], [86, "mov edi, 1"], [87, "call _close"], [88, "mov edi, 2"], [89, "call _close"], [90, "mov edi, offset path"], [91, "call _chdir"], [92, "mov [rbp+var_8], eax"], [93, "mov rax, [rbp+var_238]"], [94, "mov rax, [rax+30h]"], [95, "mov rdx, [rbp+s1]"], [96, "sub rsp, 8"], [97, "push 0"], [98, "push offset a6"], [99, "push offset aKeepwepflagsTr"], [100, "push offset aStripfcsTrue"], [101, "push offset aWlanheaderFals"], [102, "mov r9d, offset aPrismheaderTru"], [103, "mov r8d, offset aEnableTrue"], [104, "mov ecx, offset aLnxreqWlansnif"], [105, "mov esi, offset aWlanctlNg"], [106, "mov rdi, rax"], [107, "mov eax, 0"], [108, "call _execl"], [109, "add rsp, 30h"], [110, "mov edi, 1"], [111, "call _exit"], [112, "lea rcx, [rbp+stat_loc]"], [113, "mov eax, [rbp+pid]"], [114, "mov edx, 0"], [115, "mov rsi, rcx"], [116, "mov edi, eax"], [117, "call _waitpid"], [118, "mov eax, [rbp+stat_loc]"], [119, "and eax, 7Fh"], [120, "test eax, eax"], [121, "jnz short loc_40579E"], [122, "mov eax, [rbp+stat_loc]"], [123, "sar eax, 8"], [124, "movzx eax, al"], [125, "jmp locret_405C11"], [126, "mov eax, 1"], [127, "jmp locret_405C11"], [128, "call _fork"], [129, "mov [rbp+pid], eax"], [130, "cmp [rbp+pid], 0"], [131, "jnz short loc_40582A"], [132, "mov edi, 0"], [133, "call _close"], [134, "mov edi, 1"], [135, "call _close"], [136, "mov edi, 2"], [137, "call _close"], [138, "mov edi, offset path"], [139, "call _chdir"], [140, "mov [rbp+var_8], eax"], [141, "mov rax, [rbp+var_238]"], [142, "mov rax, [rax+38h]"], [143, "mov rdx, [rbp+s1]"], [144, "sub rsp, 8"], [145, "push 0"], [146, "mov r9d, offset a1"], [147, "mov r8d, offset a1"], [148, "mov ecx, offset aMonitor"], [149, "mov esi, offset arg"], [150, "mov rdi, rax"], [151, "mov eax, 0"], [152, "call _execlp"], [153, "add rsp, 10h"], [154, "mov edi, 1"], [155, "call _exit"], [156, "lea rcx, [rbp+stat_loc]"], [157, "mov eax, [rbp+pid]"], [158, "mov edx, 0"], [159, "mov rsi, rcx"], [160, "mov edi, eax"], [161, "call _waitpid"], [162, "mov eax, [rbp+stat_loc]"], [163, "and eax, 7Fh"], [164, "test eax, eax"], [165, "jnz short loc_405858"], [166, "mov eax, [rbp+stat_loc]"], [167, "sar eax, 8"], [168, "movzx eax, al"], [169, "jmp locret_405C11"], [170, "mov eax, 1"], [171, "jmp locret_405C11"], [172, "call _fork"], [173, "mov [rbp+pid], eax"], [174, "cmp [rbp+pid], 0"], [175, "jnz short loc_4058E4"], [176, "mov edi, 0"], [177, "call _close"], [178, "mov edi, 1"], [179, "call _close"], [180, "mov edi, 2"], [181, "call _close"], [182, "mov edi, offset path"], [183, "call _chdir"], [184, "mov [rbp+var_8], eax"], [185, "mov rax, [rbp+var_238]"], [186, "mov rax, [rax+38h]"], [187, "mov rdx, [rbp+s1]"], [188, "sub rsp, 8"], [189, "push 0"], [190, "mov r9d, offset a1"], [191, "mov r8d, offset a2"], [192, "mov ecx, offset aMonitor"], [193, "mov esi, offset arg"], [194, "mov rdi, rax"], [195, "mov eax, 0"], [196, "call _execlp"], [197, "add rsp, 10h"], [198, "mov edi, 1"], [199, "call _exit"], [200, "lea rcx, [rbp+stat_loc]"], [201, "mov eax, [rbp+pid]"], [202, "mov edx, 0"], [203, "mov rsi, rcx"], [204, "mov edi, eax"], [205, "call _waitpid"], [206, "mov eax, [rbp+stat_loc]"], [207, "and eax, 7Fh"], [208, "test eax, eax"], [209, "jnz short loc_405912"], [210, "mov eax, [rbp+stat_loc]"], [211, "sar eax, 8"], [212, "movzx eax, al"], [213, "jmp locret_405C11"], [214, "mov eax, 1"], [215, "jmp locret_405C11"], [216, "mov rdx, [rbp+s1]"], [217, "lea rax, [rbp+s]"], [218, "mov rcx, rdx"], [219, "mov edx, offset aIfconfigSDown"], [220, "mov esi, 1FFh"], [221, "mov rdi, rax"], [222, "mov eax, 0"], [223, "call _snprintf"], [224, "lea rax, [rbp+s]"], [225, "mov rdi, rax"], [226, "call _system"], [227, "test eax, eax"], [228, "jnz short loc_405970"], [229, "mov rax, [rbp+s1]"], [230, "mov rsi, rax"], [231, "mov edi, offset aDownIfaceS"], [232, "mov eax, 0"], [233, "call _printf"], [234, "mov rdx, [rbp+s1]"], [235, "lea rax, [rbp+s]"], [236, "mov rcx, rdx"], [237, "mov edx, offset aIwSSetTypeMoni"], [238, "mov esi, 1FFh"], [239, "mov rdi, rax"], [240, "mov eax, 0"], [241, "call _snprintf"], [242, "lea rax, [rbp+s]"], [243, "mov rdi, rax"], [244, "call _system"], [245, "test eax, eax"], [246, "jnz short loc_4059C4"], [247, "mov rax, [rbp+s1]"], [248, "mov rsi, rax"], [249, "mov edi, offset aSetIfaceSTypeT"], [250, "mov eax, 0"], [251, "call _printf"], [252, "mov rdx, [rbp+s1]"], [253, "lea rax, [rbp+s]"], [254, "mov rcx, rdx"], [255, "mov edx, offset aIfconfigSUp"], [256, "mov esi, 1FFh"], [257, "mov rdi, rax"], [258, "mov eax, 0"], [259, "call _snprintf"], [260, "lea rax, [rbp+s]"], [261, "mov rdi, rax"], [262, "call _system"], [263, "test eax, eax"], [264, "jnz short loc_405A18"], [265, "mov rax, [rbp+s1]"], [266, "mov rsi, rax"], [267, "mov edi, offset aUpIfaceS"], [268, "mov eax, 0"], [269, "call _printf"], [270, "mov eax, 0"], [271, "jmp locret_405C11"], [272, "nop"], [273, "lea rax, [rbp+dest]"], [274, "mov edx, 20h "], [275, "mov esi, 0"], [276, "mov rdi, rax"], [277, "call _memset"], [278, "mov rcx, [rbp+s1]"], [279, "lea rax, [rbp+dest]"], [280, "mov edx, 10h"], [281, "mov rsi, rcx"], [282, "mov rdi, rax"], [283, "call _strncpy"], [284, "mov [rbp+var_20], 6"], [285, "lea rdx, [rbp+dest]"], [286, "mov eax, [rbp+fd]"], [287, "mov esi, 8B06h"], [288, "mov edi, eax"], [289, "mov eax, 0"], [290, "call _ioctl"], [291, "test eax, eax"], [292, "jns short loc_405A8E"], [293, "mov edi, offset aIoctlSiocsiwmo"], [294, "call _perror"], [295, "mov eax, 1"], [296, "jmp locret_405C11"], [297, "mov rax, [rbp+var_238]"], [298, "mov eax, [rax+18h]"], [299, "cmp eax, 0Ah"], [300, "jnz short loc_405AA7"], [301, "mov edi, 3"], [302, "call _sleep"], [303, "call _fork"], [304, "test eax, eax"], [305, "jnz short loc_405B14"], [306, "mov edi, 0"], [307, "call _close"], [308, "mov edi, 1"], [309, "call _close"], [310, "mov edi, 2"], [311, "call _close"], [312, "mov edi, offset path"], [313, "call _chdir"], [314, "mov [rbp+var_8], eax"], [315, "mov rax, [rbp+s1]"], [316, "mov r9d, 0"], [317, "mov r8d, offset a1"], [318, "mov ecx, offset aMonitorType"], [319, "mov rdx, rax"], [320, "mov esi, offset arg"], [321, "mov edi, offset arg"], [322, "mov eax, 0"], [323, "call _execlp"], [324, "mov edi, 1"], [325, "call _exit"], [326, "mov edi, 0"], [327, "call _wait"], [328, "call _fork"], [329, "test eax, eax"], [330, "jnz short loc_405B8B"], [331, "mov edi, 0"], [332, "call _close"], [333, "mov edi, 1"], [334, "call _close"], [335, "mov edi, 2"], [336, "call _close"], [337, "mov edi, offset path"], [338, "call _chdir"], [339, "mov [rbp+var_8], eax"], [340, "mov rax, [rbp+s1]"], [341, "mov r9d, 0"], [342, "mov r8d, offset a1"], [343, "mov ecx, offset aPrismhdr"], [344, "mov rdx, rax"], [345, "mov esi, offset arg"], [346, "mov edi, offset arg"], [347, "mov eax, 0"], [348, "call _execlp"], [349, "mov edi, 1"], [350, "call _exit"], [351, "mov edi, 0"], [352, "call _wait"], [353, "call _fork"], [354, "test eax, eax"], [355, "jnz short loc_405C02"], [356, "mov edi, 0"], [357, "call _close"], [358, "mov edi, 1"], [359, "call _close"], [360, "mov edi, 2"], [361, "call _close"], [362, "mov edi, offset path"], [363, "call _chdir"], [364, "mov [rbp+var_8], eax"], [365, "mov rax, [rbp+s1]"], [366, "mov r9d, 0"], [367, "mov r8d, offset a1"], [368, "mov ecx, offset aSetPrismhdr"], [369, "mov rdx, rax"], [370, "mov esi, offset arg"], [371, "mov edi, offset arg"], [372, "mov eax, 0"], [373, "call _execlp"], [374, "mov edi, 1"], [375, "call _exit"], [376, "mov edi, 0"], [377, "call _wait"], [378, "mov eax, 0"], [379, "leave"], [380, "retn"]], "data_dep": [[6, 4], [8, 6], [10, 9], [11, 10], [14, 3], [15, 14], [15, 13], [17, 16], [18, 17], [19, 18], [28, 27], [29, 3], [30, 29], [30, 15], [35, 30], [41, 17], [43, 40], [44, 41], [47, 46], [48, 47], [49, 48], [51, 50], [52, 51], [56, 4], [59, 56], [61, 60], [62, 61], [65, 3], [66, 65], [67, 66], [68, 67], [69, 66], [70, 69], [71, 66], [72, 71], [73, 66], [74, 73], [75, 66], [76, 75], [77, 66], [78, 77], [81, 80], [82, 81], [83, 82], [92, 91], [93, 3], [94, 93], [95, 4], [96, 2], [106, 94], [109, 96], [113, 81], [115, 112], [116, 113], [119, 118], [120, 119], [121, 120], [123, 122], [124, 123], [129, 128], [130, 129], [131, 130], [140, 139], [141, 3], [142, 141], [143, 4], [144, 2], [150, 142], [153, 144], [157, 129], [159, 156], [160, 157], [163, 162], [164, 163], [165, 164], [167, 166], [168, 167], [173, 172], [174, 173], [175, 174], [184, 183], [185, 3], [186, 185], [187, 4], [188, 2], [194, 186], [197, 188], [201, 173], [203, 200], [204, 201], [207, 206], [208, 207], [209, 208], [211, 210], [212, 211], [216, 4], [217, 66], [218, 216], [221, 217], [224, 223], [225, 224], [227, 226], [228, 227], [229, 4], [230, 229], [234, 4], [235, 227], [235, 233], [236, 234], [239, 235], [242, 241], [243, 242], [245, 244], [246, 245], [247, 4], [248, 247], [252, 4], [253, 251], [253, 245], [254, 252], [257, 253], [260, 259], [261, 260], [263, 262], [264, 263], [265, 4], [266, 265], [273, 66], [276, 273], [278, 4], [279, 277], [281, 278], [282, 279], [285, 280], [286, 5], [288, 286], [291, 290], [292, 291], [297, 3], [298, 297], [299, 298], [300, 299], [304, 303], [305, 304], [314, 313], [315, 4], [319, 315], [329, 328], [330, 329], [339, 338], [340, 4], [344, 340], [354, 353], [355, 354], [364, 363], [365, 4], [369, 365], [380, 212], [380, 214], [380, 52], [380, 54], [380, 63], [380, 168], [380, 378], [380, 170], [380, 124], [380, 295], [380, 270], [380, 126]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c_e05238542beb7fd3cd8f18da4bb027f31dc48935803de6613fee4a662bd4058c.jsonl.gz", "strip_func_name": "sub_405576", "query": "\n\n\n__int64 __fastcall sub_405576(__int64 a1, const char *a2, int a3)\n{\n__int64 result; // rax\nunsigned int v4; // eax\nchar s[512]; // [rsp+20h] [rbp-230h] BYREF\nchar dest[16]; // [rsp+220h] [rbp-30h] BYREF\nint v8; // [rsp+230h] [rbp-20h]\nint stat_loc; // [rsp+244h] [rbp-Ch] BYREF\nint v10; // [rsp+248h] [rbp-8h]\n__pid_t pid; // [rsp+24Ch] [rbp-4h]\n\nif ( !strcmp(a2, \"prism0\") )\n{\n*(_QWORD *)(a1 + 80) = sub_403A67(\"wl\");\npid = fork();\nif ( !pid )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexecl(*(const char **)(a1 + 80), \"wl\", \"monitor\", \"1\", 0LL);\nexit(1);\n}\nwaitpid(pid, &stat_loc, 0);\nif ( (stat_loc & 0x7F) != 0 )\nresult = 1LL;\nelse\nresult = BYTE1(stat_loc);\nreturn result;\n}\nif ( !strncmp(a2, \"rtap\", 4uLL) )\nreturn 0LL;\nv4 = *(_DWORD *)(a1 + 24);\nif ( v4 == 9 )\n{\nsnprintf(s, 0x1FFuLL, \"ifconfig %s down\", a2);\nif ( !system(s) )\nprintf(\"down iface %s\\n\", a2);\nsnprintf(s, 0x1FFuLL, \"iw %s set type monitor\", a2);\nif ( !system(s) )\nprintf(\"set iface %s type to monitor\\n\", a2);\nsnprintf(s, 0x1FFuLL, \"ifconfig %s up\", a2);\nif ( !system(s) )\nprintf(\"up iface %s\\n\", a2);\nresult = 0LL;\n}\nelse\n{\nif ( v4 > 9 )\ngoto LABEL_37;\nswitch ( v4 )\n{\ncase 8u:\npid = fork();\nif ( !pid )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexeclp(*(const char **)(a1 + 56), \"iwpriv\", a2, \"monitor\", \"2\", \"1\", 0LL);\nexit(1);\n}\nwaitpid(pid, &stat_loc, 0);\nif ( (stat_loc & 0x7F) != 0 )\nresult = 1LL;\nelse\nresult = BYTE1(stat_loc);\nbreak;\ncase 1u:\npid = fork();\nif ( !pid )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexecl(\n*(const char **)(a1 + 48),\n\"wlanctl-ng\",\na2,\n\"lnxreq_wlansniff\",\n\"enable=true\",\n\"prismheader=true\",\n\"wlanheader=false\",\n\"stripfcs=true\",\n\"keepwepflags=true\",\n\"6\",\n0LL);\nexit(1);\n}\nwaitpid(pid, &stat_loc, 0);\nif ( (stat_loc & 0x7F) != 0 )\nresult = 1LL;\nelse\nresult = BYTE1(stat_loc);\nbreak;\ncase 6u:\npid = fork();\nif ( !pid )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexeclp(*(const char **)(a1 + 56), \"iwpriv\", a2, \"monitor\", \"1\", \"1\", 0LL);\nexit(1);\n}\nwaitpid(pid, &stat_loc, 0);\nif ( (stat_loc & 0x7F) != 0 )\nresult = 1LL;\nelse\nresult = BYTE1(stat_loc);\nbreak;\ndefault:\nLABEL_37:\nmemset(dest, 0, 0x20uLL);\nstrncpy(dest, a2, 0x10uLL);\nv8 = 6;\nif ( ioctl(a3, 0x8B06uLL, dest) >= 0 )\n{\nif ( *(_DWORD *)(a1 + 24) == 10 )\nsleep(3u);\nif ( !fork() )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexeclp(\"iwpriv\", \"iwpriv\", a2, \"monitor_type\", \"1\", 0LL);\nexit(1);\n}\nwait(0LL);\nif ( !fork() )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexeclp(\"iwpriv\", \"iwpriv\", a2, \"prismhdr\", \"1\", 0LL);\nexit(1);\n}\nwait(0LL);\nif ( !fork() )\n{\nclose(0);\nclose(1);\nclose(2);\nv10 = chdir(\"/\");\nexeclp(\"iwpriv\", \"iwpriv\", a2, \"set_prismhdr\", \"1\", 0LL);\nexit(1);\n}\nwait(0LL);\nresult = 0LL;\n}\nelse\n{\nperror(\"ioctl(SIOCSIWMODE) failed\");\nresult = 1LL;\n}\nreturn result;\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,s,dest,stat_loc,v10,sub_405576,sub_403A67,]", "hints": "[]", "response": "{'a3': 'fd', 'a1': 'dev', 'a2': 'iface', 's': 'strbuf', 'dest': 'wrq', 'stat_loc': 'status', 'v10': 'unused', 'sub_405576': 'set_monitor', 'sub_403A67': 'wiToolsPath'}"} | [
[
0.7654384970664978,
0.7240147590637207,
0.7068523168563843,
0.6967191696166992,
0.6964929103851318,
0.6938239336013794,
0.6923340559005737,
0.6921311616897583,
0.6873375773429871,
0.6859991550445557,
0.6844115853309631,
0.6806085109710693,
0.6800504922866821,
0.6797668933868408,
0.6786346435546875,
0.6784166693687439,
0.6749222874641418,
0.6745744943618774,
0.6734320521354675,
0.6723275780677795
],
[
3413,
75565,
129727,
111376,
191649,
244159,
194548,
212669,
90526,
202183,
263331,
37210,
72409,
118942,
259192,
160704,
73244,
237114,
50868,
260616
]
] |
|
utf8proc_iterate | f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b | 0x09 | hfsfuse | NA | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_iterate(
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_int32_t *dst
) {
utf8proc_int32_t uc;
const utf8proc_uint8_t *end;
*dst = -1;
if (!strlen) return 0;
end = str + ((strlen < 0) ? 4 : strlen);
uc = *str++;
if (uc < 0x80) {
*dst = uc;
return 1;
}
// Must be between 0xc2 and 0xf4 inclusive to be valid
if ((utf8proc_uint32_t)(uc - 0xc2) > (0xf4-0xc2)) return UTF8PROC_ERROR_INVALIDUTF8;
if (uc < 0xe0) { // 2-byte sequence
// Must have valid continuation character
if (str >= end || !utf_cont(*str)) return UTF8PROC_ERROR_INVALIDUTF8;
*dst = ((uc & 0x1f)<<6) | (*str & 0x3f);
return 2;
}
if (uc < 0xf0) { // 3-byte sequence
if ((str + 1 >= end) || !utf_cont(*str) || !utf_cont(str[1]))
return UTF8PROC_ERROR_INVALIDUTF8;
// Check for surrogate chars
if (uc == 0xed && *str > 0x9f)
return UTF8PROC_ERROR_INVALIDUTF8;
uc = ((uc & 0xf)<<12) | ((*str & 0x3f)<<6) | (str[1] & 0x3f);
if (uc < 0x800)
return UTF8PROC_ERROR_INVALIDUTF8;
*dst = uc;
return 3;
}
// 4-byte sequence
// Must have 3 valid continuation characters
if ((str + 2 >= end) || !utf_cont(*str) || !utf_cont(str[1]) || !utf_cont(str[2]))
return UTF8PROC_ERROR_INVALIDUTF8;
// Make sure in correct range (0x10000 - 0x10ffff)
if (uc == 0xf0) {
if (*str < 0x90) return UTF8PROC_ERROR_INVALIDUTF8;
} else if (uc == 0xf4) {
if (*str > 0x8f) return UTF8PROC_ERROR_INVALIDUTF8;
}
*dst = ((uc & 7)<<18) | ((*str & 0x3f)<<12) | ((str[1] & 0x3f)<<6) | (str[2] & 0x3f);
return 4;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40F69A", "function_addr": 4257434, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.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 [rbp+var_28], rdx"], [5, "mov rax, [rbp+var_28]"], [6, "mov dword ptr [rax], 0FFFFFFFFh"], [7, "cmp [rbp+var_20], 0"], [8, "jnz short loc_40F6C5"], [9, "mov eax, 0"], [10, "jmp loc_40F951"], [11, "cmp [rbp+var_20], 0"], [12, "js short loc_40F6D2"], [13, "mov rax, [rbp+var_20]"], [14, "jmp short loc_40F6D7"], [15, "mov eax, 4"], [16, "mov rdx, [rbp+var_18]"], [17, "add rax, rdx"], [18, "mov [rbp+var_8], rax"], [19, "mov rax, [rbp+var_18]"], [20, "lea rdx, [rax+1]"], [21, "mov [rbp+var_18], rdx"], [22, "movzx eax, byte ptr [rax]"], [23, "movzx eax, al"], [24, "mov [rbp+var_C], eax"], [25, "cmp [rbp+var_C], 7Fh"], [26, "jg short loc_40F710"], [27, "mov rax, [rbp+var_28]"], [28, "mov edx, [rbp+var_C]"], [29, "mov [rax], edx"], [30, "mov eax, 1"], [31, "jmp loc_40F951"], [32, "mov eax, [rbp+var_C]"], [33, "sub eax, 0C2h"], [34, "cmp eax, 32h "], [35, "jbe short loc_40F729"], [36, "mov rax, 0FFFFFFFFFFFFFFFDh"], [37, "jmp loc_40F951"], [38, "cmp [rbp+var_C], 0DFh"], [39, "jg short loc_40F78A"], [40, "mov rax, [rbp+var_18]"], [41, "cmp rax, [rbp+var_8]"], [42, "jnb short loc_40F752"], [43, "mov rax, [rbp+var_18]"], [44, "movzx eax, byte ptr [rax]"], [45, "movzx eax, al"], [46, "and eax, 0C0h"], [47, "cmp eax, 80h"], [48, "jz short loc_40F75E"], [49, "mov rax, 0FFFFFFFFFFFFFFFDh"], [50, "jmp loc_40F951"], [51, "mov eax, [rbp+var_C]"], [52, "shl eax, 6"], [53, "and eax, 7C0h"], [54, "mov edx, eax"], [55, "mov rax, [rbp+var_18]"], [56, "movzx eax, byte ptr [rax]"], [57, "movzx eax, al"], [58, "and eax, 3Fh"], [59, "or edx, eax"], [60, "mov rax, [rbp+var_28]"], [61, "mov [rax], edx"], [62, "mov eax, 2"], [63, "jmp loc_40F951"], [64, "cmp [rbp+var_C], 0EFh"], [65, "jg loc_40F85C"], [66, "mov rax, [rbp+var_18]"], [67, "add rax, 1"], [68, "cmp [rbp+var_8], rax"], [69, "jbe short loc_40F7D5"], [70, "mov rax, [rbp+var_18]"], [71, "movzx eax, byte ptr [rax]"], [72, "movzx eax, al"], [73, "and eax, 0C0h"], [74, "cmp eax, 80h"], [75, "jnz short loc_40F7D5"], [76, "mov rax, [rbp+var_18]"], [77, "add rax, 1"], [78, "movzx eax, byte ptr [rax]"], [79, "movzx eax, al"], [80, "and eax, 0C0h"], [81, "cmp eax, 80h"], [82, "jz short loc_40F7E1"], [83, "mov rax, 0FFFFFFFFFFFFFFFDh"], [84, "jmp loc_40F951"], [85, "cmp [rbp+var_C], 0EDh"], [86, "jnz short loc_40F801"], [87, "mov rax, [rbp+var_18]"], [88, "movzx eax, byte ptr [rax]"], [89, "cmp al, 9Fh"], [90, "jbe short loc_40F801"], [91, "mov rax, 0FFFFFFFFFFFFFFFDh"], [92, "jmp loc_40F951"], [93, "mov eax, [rbp+var_C]"], [94, "shl eax, 0Ch"], [95, "movzx edx, ax"], [96, "mov rax, [rbp+var_18]"], [97, "movzx eax, byte ptr [rax]"], [98, "movzx eax, al"], [99, "shl eax, 6"], [100, "and eax, 0FC0h"], [101, "or edx, eax"], [102, "mov rax, [rbp+var_18]"], [103, "add rax, 1"], [104, "movzx eax, byte ptr [rax]"], [105, "movzx eax, al"], [106, "and eax, 3Fh"], [107, "or eax, edx"], [108, "mov [rbp+var_C], eax"], [109, "cmp [rbp+var_C], 7FFh"], [110, "jg short loc_40F849"], [111, "mov rax, 0FFFFFFFFFFFFFFFDh"], [112, "jmp loc_40F951"], [113, "mov rax, [rbp+var_28]"], [114, "mov edx, [rbp+var_C]"], [115, "mov [rax], edx"], [116, "mov eax, 3"], [117, "jmp loc_40F951"], [118, "mov rax, [rbp+var_18]"], [119, "add rax, 2"], [120, "cmp [rbp+var_8], rax"], [121, "jbe short loc_40F8B4"], [122, "mov rax, [rbp+var_18]"], [123, "movzx eax, byte ptr [rax]"], [124, "movzx eax, al"], [125, "and eax, 0C0h"], [126, "cmp eax, 80h"], [127, "jnz short loc_40F8B4"], [128, "mov rax, [rbp+var_18]"], [129, "add rax, 1"], [130, "movzx eax, byte ptr [rax]"], [131, "movzx eax, al"], [132, "and eax, 0C0h"], [133, "cmp eax, 80h"], [134, "jnz short loc_40F8B4"], [135, "mov rax, [rbp+var_18]"], [136, "add rax, 2"], [137, "movzx eax, byte ptr [rax]"], [138, "movzx eax, al"], [139, "and eax, 0C0h"], [140, "cmp eax, 80h"], [141, "jz short loc_40F8C0"], [142, "mov rax, 0FFFFFFFFFFFFFFFDh"], [143, "jmp loc_40F951"], [144, "cmp [rbp+var_C], 0F0h"], [145, "jnz short loc_40F8DD"], [146, "mov rax, [rbp+var_18]"], [147, "movzx eax, byte ptr [rax]"], [148, "cmp al, 8Fh"], [149, "ja short loc_40F8FA"], [150, "mov rax, 0FFFFFFFFFFFFFFFDh"], [151, "jmp short loc_40F951"], [152, "cmp [rbp+var_C], 0F4h"], [153, "jnz short loc_40F8FA"], [154, "mov rax, [rbp+var_18]"], [155, "movzx eax, byte ptr [rax]"], [156, "cmp al, 8Fh"], [157, "jbe short loc_40F8FA"], [158, "mov rax, 0FFFFFFFFFFFFFFFDh"], [159, "jmp short loc_40F951"], [160, "mov eax, [rbp+var_C]"], [161, "shl eax, 12h"], [162, "and eax, 1C0000h"], [163, "mov edx, eax"], [164, "mov rax, [rbp+var_18]"], [165, "movzx eax, byte ptr [rax]"], [166, "movzx eax, al"], [167, "shl eax, 0Ch"], [168, "and eax, 3F000h"], [169, "or edx, eax"], [170, "mov rax, [rbp+var_18]"], [171, "add rax, 1"], [172, "movzx eax, byte ptr [rax]"], [173, "movzx eax, al"], [174, "shl eax, 6"], [175, "and eax, 0FC0h"], [176, "or edx, eax"], [177, "mov rax, [rbp+var_18]"], [178, "add rax, 2"], [179, "movzx eax, byte ptr [rax]"], [180, "movzx eax, al"], [181, "and eax, 3Fh"], [182, "or edx, eax"], [183, "mov rax, [rbp+var_28]"], [184, "mov [rax], edx"], [185, "mov eax, 4"], [186, "pop rbp"], [187, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 3], [8, 7], [11, 3], [12, 11], [13, 3], [16, 2], [17, 16], [17, 13], [17, 15], [18, 17], [19, 2], [20, 19], [20, 16], [20, 6], [21, 20], [22, 19], [22, 6], [23, 22], [24, 23], [25, 24], [26, 25], [27, 4], [28, 24], [29, 27], [29, 28], [32, 24], [33, 32], [34, 33], [35, 34], [38, 24], [39, 38], [40, 21], [41, 40], [41, 18], [42, 41], [43, 21], [44, 43], [44, 6], [45, 44], [46, 45], [47, 46], [48, 47], [51, 24], [52, 51], [53, 52], [54, 53], [55, 21], [56, 55], [56, 61], [56, 6], [57, 56], [58, 57], [59, 54], [59, 58], [60, 4], [61, 60], [61, 59], [64, 24], [65, 64], [66, 21], [67, 66], [68, 67], [68, 18], [69, 68], [70, 21], [71, 6], [71, 70], [72, 71], [73, 72], [74, 73], [75, 74], [76, 21], [77, 76], [78, 77], [78, 6], [79, 78], [80, 79], [81, 80], [82, 81], [85, 24], [86, 85], [87, 21], [88, 87], [88, 6], [89, 88], [90, 89], [93, 24], [94, 93], [95, 94], [96, 21], [97, 96], [97, 6], [98, 97], [99, 98], [100, 99], [101, 100], [101, 95], [102, 21], [103, 102], [104, 6], [104, 103], [105, 104], [106, 105], [107, 106], [107, 101], [108, 107], [109, 108], [110, 109], [113, 4], [114, 108], [115, 114], [115, 113], [118, 21], [119, 118], [120, 119], [120, 18], [121, 120], [122, 21], [123, 6], [123, 122], [124, 123], [125, 124], [126, 125], [127, 126], [128, 21], [129, 128], [130, 6], [130, 129], [131, 130], [132, 131], [133, 132], [134, 133], [135, 21], [136, 135], [137, 6], [137, 136], [138, 137], [139, 138], [140, 139], [141, 140], [144, 24], [145, 144], [146, 21], [147, 146], [147, 6], [148, 147], [149, 148], [152, 24], [153, 152], [154, 21], [155, 6], [155, 154], [156, 155], [157, 156], [160, 24], [161, 160], [162, 161], [163, 162], [164, 21], [165, 184], [165, 164], [165, 6], [166, 165], [167, 166], [168, 167], [169, 163], [169, 168], [170, 21], [171, 170], [172, 6], [172, 184], [172, 171], [173, 172], [174, 173], [175, 174], [176, 169], [176, 175], [177, 21], [178, 177], [179, 178], [179, 6], [179, 184], [180, 179], [181, 180], [182, 181], [182, 176], [183, 4], [184, 182], [184, 183], [186, 0], [187, 30], [187, 158], [187, 185], [187, 142], [187, 9], [187, 91], [187, 36], [187, 150], [187, 116], [187, 111], [187, 83], [187, 49], [187, 62]]}
| {"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_40F69A", "query": "\n\n\n__int64 __fastcall sub_40F69A(unsigned __int8 *a1, __int64 a2, _DWORD *a3)\n{\n__int64 result; // rax\n__int64 v4; // rax\n_BYTE *v5; // [rsp+10h] [rbp-18h]\nunsigned int v6; // [rsp+1Ch] [rbp-Ch]\nint v7; // [rsp+1Ch] [rbp-Ch]\nunsigned __int64 v8; // [rsp+20h] [rbp-8h]\n\n*a3 = -1;\nif ( !a2 )\nreturn 0LL;\nif ( a2 < 0 )\nv4 = 4LL;\nelse\nv4 = a2;\nv8 = (unsigned __int64)&a1[v4];\nv5 = a1 + 1;\nv6 = *a1;\nif ( v6 <= 0x7F )\n{\n*a3 = v6;\nreturn 1LL;\n}\nif ( v6 - 194 > 0x32 )\nreturn -3LL;\nif ( *a1 > 0xDFu )\n{\nif ( *a1 > 0xEFu )\n{\nif ( v8 <= (unsigned __int64)(a1 + 3) || (*v5 & 0xC0) != 128 || (a1[2] & 0xC0) != 128 || (a1[3] & 0xC0) != 128 )\nreturn -3LL;\nif ( v6 == 240 )\n{\nif ( *v5 <= 0x8Fu )\nreturn -3LL;\n}\nelse if ( v6 == 244 && *v5 > 0x8Fu )\n{\nreturn -3LL;\n}\n*a3 = a1[3] & 0x3F | (a1[2] << 6) & 0xFC0 | (a1[1] << 12) & 0x3F000 | (v6 << 18) & 0x1C0000;\nresult = 4LL;\n}\nelse if ( v8 > (unsigned __int64)(a1 + 2) && (*v5 & 0xC0) == 128 && (a1[2] & 0xC0) == 128 )\n{\nif ( v6 == 237 && *v5 > 0x9Fu )\n{\nresult = -3LL;\n}\nelse\n{\nv7 = (a1[1] << 6) & 0xFC0 | (unsigned __int16)((_WORD)v6 << 12) | a1[2] & 0x3F;\nif ( v7 > 2047 )\n{\n*a3 = v7;\nresult = 3LL;\n}\nelse\n{\nresult = -3LL;\n}\n}\n}\nelse\n{\nresult = -3LL;\n}\n}\nelse if ( (unsigned __int64)v5 < v8 && (*v5 & 0xC0) == 128 )\n{\n*a3 = *v5 & 0x3F | ((_WORD)v6 << 6) & 0x7C0;\nresult = 2LL;\n}\nelse\n{\nresult = -3LL;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,v5,v6,v8,sub_40F69A,]", "hints": "[]", "response": "{'a3': 'dst', 'a1': 'str', 'a2': 'strlen', 'v5': 'stra', 'v6': 'uc', 'v8': 'end', 'sub_40F69A': 'utf8proc_iterate'}"} | [
[
0.8205735683441162,
0.81010901927948,
0.8073393106460571,
0.7893326282501221,
0.7754430770874023,
0.7722073793411255,
0.7714147567749023,
0.7711148262023926,
0.7682356834411621,
0.766282320022583,
0.7652038931846619,
0.7649522423744202,
0.7612099051475525,
0.7511049509048462,
0.7503058910369873,
0.7488019466400146,
0.7459161877632141,
0.743151843547821,
0.7413586974143982,
0.7412847280502319
],
[
257247,
104703,
97044,
147120,
95120,
129751,
150257,
240312,
188953,
166544,
234163,
225664,
64200,
93839,
39353,
254793,
77891,
18790,
105591,
9968
]
] |
|
hfs_read_pread | f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b | 0x09 | hfsfuse | NA | static inline int hfs_read_pread(struct hfs_device* dev, void* outbytes, uint64_t length, uint64_t offset) {
char* outbuf = outbytes;
ssize_t ret = 0;
uint64_t rem = length % dev->blksize;
length -= rem;
while(length && (ret = hfs_pread(dev->fd,outbuf,length,offset)) > 0) {
if((ret = min((ssize_t)length,ret)) <= 0)
break;
outbuf += ret;
offset += ret;
length -= ret;
}
if(ret < 0)
return -errno;
if(rem) {
char buf[dev->blksize];
ret = hfs_pread(dev->fd,buf,dev->blksize,offset);
if((ret = min((ssize_t)rem,ret)) > 0)
memcpy(outbuf,buf,ret);
}
if(ret < 0)
return -errno;
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403C8D", "function_addr": 4209805, "binary_name": "f61ed8ef6ab5ad7275499f10ef94c8c2326a67232c2cc9190dbdb630ddbc2c7b.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, 58h"], [8, "mov [rbp+var_68], rdi"], [9, "mov [rbp+var_70], rsi"], [10, "mov [rbp+nbytes], rdx"], [11, "mov [rbp+offset], rcx"], [12, "mov rax, [rbp+var_70]"], [13, "mov [rbp+buf], rax"], [14, "mov [rbp+n], 0"], [15, "mov rax, [rbp+var_68]"], [16, "mov eax, [rax+4]"], [17, "mov ecx, eax"], [18, "mov rax, [rbp+nbytes]"], [19, "mov edx, 0"], [20, "div rcx"], [21, "mov [rbp+var_48], rdx"], [22, "mov rax, [rbp+var_48]"], [23, "sub [rbp+nbytes], rax"], [24, "jmp short loc_403D11"], [25, "mov rax, [rbp+nbytes]"], [26, "cmp [rbp+n], rax"], [27, "cmovle rax, [rbp+n]"], [28, "mov [rbp+n], rax"], [29, "cmp [rbp+n], 0"], [30, "jle short loc_403D3E"], [31, "mov rax, [rbp+n]"], [32, "add [rbp+buf], rax"], [33, "mov rax, [rbp+n]"], [34, "add [rbp+offset], rax"], [35, "mov rax, [rbp+n]"], [36, "sub [rbp+nbytes], rax"], [37, "cmp [rbp+nbytes], 0"], [38, "jz short loc_403D3F"], [39, "mov rcx, [rbp+offset]"], [40, "mov rax, [rbp+var_68]"], [41, "mov eax, [rax]"], [42, "mov rdx, [rbp+nbytes]"], [43, "mov rsi, [rbp+buf]"], [44, "mov edi, eax"], [45, "call _pread64"], [46, "mov [rbp+n], rax"], [47, "cmp [rbp+n], 0"], [48, "jg short loc_403CE1"], [49, "jmp short loc_403D3F"], [50, "nop"], [51, "cmp [rbp+n], 0"], [52, "jns short loc_403D54"], [53, "call ___errno_location"], [54, "mov eax, [rax]"], [55, "neg eax"], [56, "jmp loc_403E2A"], [57, "cmp [rbp+var_48], 0"], [58, "jz loc_403E13"], [59, "mov rax, rsp"], [60, "mov rbx, rax"], [61, "mov rax, [rbp+var_68]"], [62, "mov eax, [rax+4]"], [63, "mov edx, eax"], [64, "sub rdx, 1"], [65, "mov [rbp+var_50], rdx"], [66, "mov edx, eax"], [67, "mov r14, rdx"], [68, "mov r15d, 0"], [69, "mov edx, eax"], [70, "mov r12, rdx"], [71, "mov r13d, 0"], [72, "mov edx, eax"], [73, "mov eax, 10h"], [74, "sub rax, 1"], [75, "add rax, rdx"], [76, "mov edi, 10h"], [77, "mov edx, 0"], [78, "div rdi"], [79, "imul rax, 10h"], [80, "sub rsp, rax"], [81, "mov rax, rsp"], [82, "add rax, 0"], [83, "mov [rbp+src], rax"], [84, "mov rdx, [rbp+offset]"], [85, "mov rax, [rbp+var_68]"], [86, "mov eax, [rax+4]"], [87, "mov edi, eax"], [88, "mov rax, [rbp+var_68]"], [89, "mov eax, [rax]"], [90, "mov rsi, [rbp+src]"], [91, "mov rcx, rdx"], [92, "mov rdx, rdi"], [93, "mov edi, eax"], [94, "call _pread64"], [95, "mov [rbp+n], rax"], [96, "mov rax, [rbp+var_48]"], [97, "cmp [rbp+n], rax"], [98, "cmovle rax, [rbp+n]"], [99, "mov [rbp+n], rax"], [100, "cmp [rbp+n], 0"], [101, "jle short loc_403E10"], [102, "mov rdx, [rbp+n]"], [103, "mov rcx, [rbp+src]"], [104, "mov rax, [rbp+buf]"], [105, "mov rsi, rcx"], [106, "mov rdi, rax"], [107, "call _memcpy"], [108, "mov rsp, rbx"], [109, "cmp [rbp+n], 0"], [110, "jns short loc_403E25"], [111, "call ___errno_location"], [112, "mov eax, [rax]"], [113, "neg eax"], [114, "jmp short loc_403E2A"], [115, "mov eax, 0"], [116, "lea rsp, [rbp-28h]"], [117, "pop rbx"], [118, "pop r12"], [119, "pop r13"], [120, "pop r14"], [121, "pop r15"], [122, "pop rbp"], [123, "retn"]], "data_dep": [[12, 9], [13, 12], [14, 11], [15, 8], [16, 15], [17, 16], [18, 10], [19, 11], [20, 17], [21, 19], [22, 21], [23, 22], [23, 10], [24, 11], [25, 23], [25, 36], [26, 25], [26, 46], [27, 46], [28, 27], [29, 28], [30, 29], [31, 28], [32, 32], [32, 13], [32, 31], [33, 28], [34, 33], [35, 28], [36, 36], [36, 35], [36, 23], [37, 23], [37, 36], [38, 37], [40, 8], [41, 40], [42, 36], [42, 23], [43, 32], [43, 13], [44, 41], [46, 45], [47, 46], [48, 47], [51, 28], [51, 46], [51, 14], [52, 51], [54, 53], [55, 54], [57, 21], [58, 57], [59, 7], [60, 59], [61, 8], [62, 61], [63, 62], [64, 63], [65, 64], [66, 62], [67, 66], [69, 62], [70, 69], [72, 62], [74, 73], [75, 72], [75, 74], [78, 76], [79, 75], [80, 7], [80, 79], [81, 80], [82, 81], [83, 82], [85, 8], [86, 85], [87, 86], [88, 8], [89, 88], [90, 83], [91, 84], [92, 87], [93, 89], [95, 94], [96, 21], [97, 95], [97, 96], [98, 95], [99, 98], [100, 99], [101, 100], [102, 99], [103, 83], [104, 32], [104, 13], [105, 103], [106, 104], [108, 60], [109, 99], [109, 28], [109, 46], [109, 14], [110, 109], [112, 111], [113, 112], [116, 108], [116, 7], [117, 6], [118, 5], [119, 4], [120, 3], [121, 2], [122, 0], [123, 113], [123, 115], [123, 55]]}
| {"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_403C8D", "query": "\n\n\n__int64 __fastcall sub_403C8D(int *a1, void *a2, size_t a3, __off64_t a4)\n{\n__int64 v4; // rax\n__int64 result; // rax\nunsigned int v6; // eax\nvoid *v7; // rsp\n__int64 v8; // rax\n__off64_t offset; // [rsp+0h] [rbp-80h] BYREF\nsize_t nbytes; // [rsp+8h] [rbp-78h]\nvoid *v11; // [rsp+10h] [rbp-70h]\nint *v12; // [rsp+18h] [rbp-68h]\nvoid *src; // [rsp+28h] [rbp-58h]\n__int64 v14; // [rsp+30h] [rbp-50h]\n__int64 v15; // [rsp+38h] [rbp-48h]\nvoid *buf; // [rsp+40h] [rbp-40h]\nsize_t n; // [rsp+48h] [rbp-38h]\n\nv12 = a1;\nv11 = a2;\nnbytes = a3;\noffset = a4;\nbuf = a2;\nn = 0LL;\nv15 = a3 % (unsigned int)a1[1];\nfor ( nbytes = a3 - v15; nbytes; nbytes -= n )\n{\nn = pread64(*v12, buf, nbytes, offset);\nif ( (__int64)n <= 0 )\nbreak;\nv4 = nbytes;\nif ( (__int64)n <= (__int64)nbytes )\nv4 = n;\nn = v4;\nif ( v4 <= 0 )\nbreak;\nbuf = (char *)buf + n;\noffset += n;\n}\nif ( (n & 0x8000000000000000LL) != 0LL )\nreturn (unsigned int)-*__errno_location();\nif ( v15 )\n{\nv6 = v12[1];\nv14 = v6 - 1LL;\nv7 = alloca(16 * (((unsigned __int64)v6 + 15) / 0x10));\nsrc = &offset;\nn = pread64(*v12, &offset, (unsigned int)v12[1], offset);\nv8 = v15;\nif ( (__int64)n <= v15 )\nv8 = n;\nn = v8;\nif ( v8 > 0 )\nmemcpy(buf, src, n);\n}\nif ( (n & 0x8000000000000000LL) == 0LL )\nresult = 0LL;\nelse\nresult = (unsigned int)-*__errno_location();\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,offset,nbytes,v11,v12,src,v15,buf,sub_403C8D,]", "hints": "[]", "response": "{'a3': 'length', 'a4': 'offset', 'a1': 'dev', 'a2': 'outbytes', 'offset': 'offseta', 'nbytes': 'lengtha', 'v11': 'outbytesa', 'v12': 'deva', 'src': 'p_buf', 'v15': 'rem', 'buf': 'outbuf', 'sub_403C8D': 'hfs_read_pread'}"} | [
[
0.762733519077301,
0.7538428902626038,
0.7305489778518677,
0.7273579835891724,
0.7213687896728516,
0.718267560005188,
0.7178242206573486,
0.7149794101715088,
0.7085376977920532,
0.705153226852417,
0.7006176114082336,
0.6973169445991516,
0.6918449401855469,
0.6906479001045227,
0.688899040222168,
0.685823917388916,
0.681981086730957,
0.6815279126167297,
0.6812310218811035,
0.6807830929756165
],
[
12637,
159958,
75764,
238655,
91131,
244997,
75008,
64504,
184425,
136640,
245599,
162851,
20289,
218838,
100134,
199230,
145115,
132551,
225279,
142033
]
] |
|
term_set_parity | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | int
term_set_parity (int fd, enum parity_e parity)
{
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 (parity) {
case P_EVEN:
tiop->c_cflag &= ~PARODD;
tiop->c_cflag |= PARENB;
break;
case P_ODD:
tiop->c_cflag |= PARENB | PARODD;
break;
case P_NONE:
tiop->c_cflag &= ~(PARENB | PARODD);
break;
default:
term_errno = TERM_EPARITY;
rval = -1;
break;
}
if ( rval < 0 ) break;
} while (0);
return rval;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407207", "function_addr": 4223495, "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_40723B"], [12, "mov [rbp+var_4], 0FFFFFFFFh"], [13, "jmp loc_4072E9"], [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], 2"], [27, "jz short loc_4072A9"], [28, "cmp [rbp+var_18], 2"], [29, "ja short loc_4072D3"], [30, "cmp [rbp+var_18], 0"], [31, "jz short loc_4072BE"], [32, "cmp [rbp+var_18], 1"], [33, "jnz short loc_4072D3"], [34, "mov rax, [rbp+var_10]"], [35, "mov eax, [rax+8]"], [36, "and ah, 0FDh"], [37, "mov edx, eax"], [38, "mov rax, [rbp+var_10]"], [39, "mov [rax+8], edx"], [40, "mov rax, [rbp+var_10]"], [41, "mov eax, [rax+8]"], [42, "or ah, 1"], [43, "mov edx, eax"], [44, "mov rax, [rbp+var_10]"], [45, "mov [rax+8], edx"], [46, "jmp short loc_4072E5"], [47, "mov rax, [rbp+var_10]"], [48, "mov eax, [rax+8]"], [49, "or ah, 3"], [50, "mov edx, eax"], [51, "mov rax, [rbp+var_10]"], [52, "mov [rax+8], edx"], [53, "jmp short loc_4072E5"], [54, "mov rax, [rbp+var_10]"], [55, "mov eax, [rax+8]"], [56, "and ah, 0FCh"], [57, "mov edx, eax"], [58, "mov rax, [rbp+var_10]"], [59, "mov [rax+8], edx"], [60, "jmp short loc_4072E5"], [61, "mov cs:dword_40CBA0, 0Dh"], [62, "mov [rbp+var_4], 0FFFFFFFFh"], [63, "nop"], [64, "cmp [rbp+var_4], 0"], [65, "mov eax, [rbp+var_4]"], [66, "leave"], [67, "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, 25], [35, 34], [36, 35], [37, 36], [38, 25], [39, 38], [39, 37], [40, 25], [41, 40], [41, 39], [42, 41], [43, 42], [44, 25], [45, 43], [45, 44], [47, 25], [48, 47], [49, 48], [50, 49], [51, 25], [52, 51], [52, 50], [54, 25], [55, 54], [56, 55], [57, 56], [58, 25], [59, 58], [59, 57], [64, 5], [64, 62], [65, 12], [65, 5], [65, 62], [67, 65]]}
| {"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_407207", "query": "\n\n\n__int64 __fastcall sub_407207(int a1, unsigned int a2)\n{\nint v2; // eax\nint v3; // eax\nint v5; // [rsp+10h] [rbp-8h]\nunsigned int v6; // [rsp+14h] [rbp-4h]\n\nv6 = 0;\nv5 = sub_4065BD(a1);\nif ( v5 < 0 )\nreturn (unsigned int)-1;\nif ( a2 == 2 )\n{\nv3 = *((_DWORD *)&unk_40D18C + 11 * v5);\nBYTE1(v3) |= 3u;\n*((_DWORD *)&unk_40D18C + 11 * v5) = v3;\n}\nelse if ( a2 > 2 )\n{\ndword_40CBA0 = 13;\nv6 = -1;\n}\nelse\n{\nv2 = *((_DWORD *)&unk_40D18C + 11 * v5);\nif ( a2 )\n{\nBYTE1(v2) &= 0xFDu;\n*((_DWORD *)&unk_40D18C + 11 * v5) = v2;\nv2 = *((_DWORD *)&unk_40D18C + 11 * v5);\nBYTE1(v2) |= 1u;\n}\nelse\n{\nBYTE1(v2) &= 0xFCu;\n}\n*((_DWORD *)&unk_40D18C + 11 * v5) = v2;\n}\nreturn v6;\n}\n\n\n\nQ:[a1,a2,v6,sub_407207,sub_4065BD,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'parity', 'v6': 'rval', 'sub_407207': 'term_set_parity', 'sub_4065BD': 'term_find'}"} | [
[
0.7374081015586853,
0.7142708897590637,
0.7084400057792664,
0.7044587135314941,
0.7013368010520935,
0.6916174292564392,
0.6897343993186951,
0.6869201064109802,
0.6839271187782288,
0.683759331703186,
0.6793599128723145,
0.6771799325942993,
0.6760683059692383,
0.6717059016227722,
0.6681727170944214,
0.6568006277084351,
0.6532663106918335,
0.6523081660270691,
0.6512617468833923,
0.6482876539230347
],
[
202569,
253040,
2093,
164210,
175052,
134253,
58168,
188579,
218322,
88438,
231336,
83033,
102680,
201591,
55017,
51796,
243138,
160081,
202083,
249170
]
] |
|
Info_Validate | a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040 | ec- | Quake3e | NA | qboolean Info_Validate( const char *s )
{
for ( ;; )
{
switch ( *s++ )
{
case '\0':
return qtrue;
case '\"':
case ';':
return qfalse;
default:
break;
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_44F41C", "function_addr": 4518940, "binary_name": "a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov rax, [rbp+var_8]"], [4, "lea rdx, [rax+1]"], [5, "mov [rbp+var_8], rdx"], [6, "movzx eax, byte ptr [rax]"], [7, "movsx eax, al"], [8, "cmp eax, 3Bh "], [9, "jz short loc_44F452"], [10, "cmp eax, 3Bh "], [11, "jg short loc_44F459"], [12, "test eax, eax"], [13, "jz short loc_44F44B"], [14, "cmp eax, 22h "], [15, "jz short loc_44F452"], [16, "jmp short loc_44F459"], [17, "mov eax, 1"], [18, "jmp short loc_44F45C"], [19, "mov eax, 0"], [20, "jmp short loc_44F45C"], [21, "nop"], [22, "jmp short loc_44F424"], [23, "pop rbp"], [24, "retn"]], "data_dep": [[3, 2], [3, 5], [4, 4], [4, 3], [5, 4], [6, 3], [7, 6], [8, 7], [9, 8], [10, 7], [11, 10], [12, 7], [13, 12], [14, 12], [15, 14], [23, 0], [24, 17], [24, 19]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040_a91e99690f74daed4feb0b6d699a9687bf799c0a24e7161094cca3df1499a040.jsonl.gz", "strip_func_name": "sub_44F41C", "query": "\n\n\n__int64 __fastcall sub_44F41C(char *a1)\n{\nchar *v1; // rax\nint v2; // eax\n\nwhile ( 1 )\n{\nv1 = a1++;\nv2 = *v1;\nif ( v2 == 59 )\nbreak;\nif ( v2 <= 59 )\n{\nif ( !v2 )\nreturn 1LL;\nif ( v2 == 34 )\nbreak;\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a1,sub_44F41C,]", "hints": "[]", "response": "{'a1': 's', 'sub_44F41C': 'Info_Validate'}"} | [
[
0.909426212310791,
0.8206017017364502,
0.8056804537773132,
0.7938948273658752,
0.7697153687477112,
0.7689437866210938,
0.7654699087142944,
0.7650082111358643,
0.7621172666549683,
0.7601935267448425,
0.7587414979934692,
0.7550402283668518,
0.7523763179779053,
0.7477244138717651,
0.7431273460388184,
0.7421707510948181,
0.7419368624687195,
0.7407485246658325,
0.7400344610214233,
0.7391437888145447
],
[
123276,
40973,
245152,
84892,
204079,
194125,
191938,
15845,
240699,
228410,
136981,
222027,
252567,
60805,
142336,
13230,
231126,
151053,
56055,
55899
]
] |
|
arm_negate_q15 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_negate_q15(
const q15_t * pSrc,
q15_t * pDst,
uint32_t blockSize)
{
uint32_t blkCnt; /* Loop counter */
q15_t in; /* Temporary input variable */
#if defined (ARM_MATH_LOOPUNROLL)
#if defined (ARM_MATH_DSP)
q31_t in1; /* Temporary input variables */
#endif
/* Loop unrolling: Compute 4 outputs at a time */
blkCnt = blockSize >> 2U;
while (blkCnt > 0U)
{
/* C = -A */
#if defined (ARM_MATH_DSP)
/* Negate and store result in destination buffer (2 samples at a time). */
in1 = read_q15x2_ia ((q15_t **) &pSrc);
write_q15x2_ia (&pDst, __QSUB16(0, in1));
in1 = read_q15x2_ia ((q15_t **) &pSrc);
write_q15x2_ia (&pDst, __QSUB16(0, in1));
#else
in = *pSrc++;
*pDst++ = (in == (q15_t) 0x8000) ? (q15_t) 0x7fff : -in;
in = *pSrc++;
*pDst++ = (in == (q15_t) 0x8000) ? (q15_t) 0x7fff : -in;
in = *pSrc++;
*pDst++ = (in == (q15_t) 0x8000) ? (q15_t) 0x7fff : -in;
in = *pSrc++;
*pDst++ = (in == (q15_t) 0x8000) ? (q15_t) 0x7fff : -in;
#endif
/* 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 */
/* Negate and store result in destination buffer. */
in = *pSrc++;
*pDst++ = (in == (q15_t) 0x8000) ? (q15_t) 0x7fff : -in;
/* Decrement loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4201A0", "function_addr": 4325792, "binary_name": "3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec.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 [rbp+var_24], edx"], [5, "mov eax, [rbp+var_24]"], [6, "mov [rbp+var_4], eax"], [7, "jmp short loc_4201F4"], [8, "mov rax, [rbp+var_18]"], [9, "lea rdx, [rax+2]"], [10, "mov [rbp+var_18], rdx"], [11, "movzx eax, word ptr [rax]"], [12, "mov [rbp+var_6], ax"], [13, "cmp [rbp+var_6], 8000h"], [14, "jz short loc_4201DC"], [15, "movzx eax, [rbp+var_6]"], [16, "neg eax"], [17, "mov ecx, eax"], [18, "jmp short loc_4201E1"], [19, "mov ecx, 7FFFh"], [20, "mov rax, [rbp+var_20]"], [21, "lea rdx, [rax+2]"], [22, "mov [rbp+var_20], rdx"], [23, "mov [rax], cx"], [24, "sub [rbp+var_4], 1"], [25, "cmp [rbp+var_4], 0"], [26, "jnz short loc_4201B7"], [27, "nop"], [28, "nop"], [29, "pop rbp"], [30, "retn"]], "data_dep": [[5, 4], [6, 5], [8, 2], [8, 10], [9, 8], [9, 23], [9, 21], [10, 9], [11, 8], [11, 23], [12, 11], [13, 12], [14, 13], [15, 12], [16, 15], [17, 16], [20, 22], [20, 3], [21, 9], [21, 23], [21, 20], [22, 21], [23, 19], [23, 17], [23, 20], [24, 6], [24, 24], [25, 6], [25, 24], [26, 25], [29, 0], [30, 5], [30, 20]]}
| {"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_4201A0", "query": "\n\n\nunsigned __int64 __fastcall sub_4201A0(_WORD *a1, _WORD *a2, unsigned int a3)\n{\nunsigned __int64 result; // rax\n_WORD *v4; // rax\nint v5; // ecx\nunsigned int i; // [rsp+20h] [rbp-4h]\n\nresult = a3;\nfor ( i = a3; i; --i )\n{\nv4 = a1++;\nif ( *v4 == 0x8000 )\nLOWORD(v5) = 0x7FFF;\nelse\nv5 = -(unsigned __int16)*v4;\nresult = (unsigned __int64)a2++;\n*(_WORD *)result = v5;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a1,a2,sub_4201A0,]", "hints": "[]", "response": "{'a3': 'blockSize', 'a1': 'pSrc', 'a2': 'pDst', 'sub_4201A0': 'arm_negate_q15'}"} | [
[
0.791574239730835,
0.791369616985321,
0.788430392742157,
0.7810122966766357,
0.7759989500045776,
0.7653917670249939,
0.7556325197219849,
0.7491645812988281,
0.7433928847312927,
0.7377465963363647,
0.7334923148155212,
0.7334367036819458,
0.7306056022644043,
0.7301270961761475,
0.7250534892082214,
0.7222877740859985,
0.7221571207046509,
0.7206616997718811,
0.7199096083641052,
0.7183331251144409
],
[
201384,
52224,
154538,
149033,
125659,
105898,
24772,
248408,
43845,
88667,
63939,
151509,
21500,
97233,
32213,
199963,
254024,
137066,
20441,
41438
]
] |
|
do_ssb_entry | ee35dc7ef3ff6ade837c204cca8b632578bdff95a5af2743ef87e3c7f8444b40 | alibaba | LVS | NA | static int do_ssb_entry(const char *filename,
struct ssb_device_id *id, char *alias)
{
id->vendor = TO_NATIVE(id->vendor);
id->coreid = TO_NATIVE(id->coreid);
id->revision = TO_NATIVE(id->revision);
strcpy(alias, "ssb:");
ADD(alias, "v", id->vendor != SSB_ANY_VENDOR, id->vendor);
ADD(alias, "id", id->coreid != SSB_ANY_ID, id->coreid);
ADD(alias, "rev", id->revision != SSB_ANY_REV, id->revision);
add_wildcard(alias);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A2E1", "function_addr": 4236001, "binary_name": "ee35dc7ef3ff6ade837c204cca8b632578bdff95a5af2743ef87e3c7f8444b40.elf_extract.pkl\n"}, "code": [[0, "push rbx"], [1, "sub rsp, 20h"], [2, "mov [rsp+28h+var_10], rdi"], [3, "mov [rsp+28h+var_18], rsi"], [4, "mov [rsp+28h+s], rdx"], [5, "mov rax, [rsp+28h+var_18]"], [6, "movzx edx, word ptr [rax]"], [7, "mov rax, [rsp+28h+var_18]"], [8, "mov [rax], dx"], [9, "mov rax, [rsp+28h+var_18]"], [10, "movzx edx, word ptr [rax+2]"], [11, "mov rax, [rsp+28h+var_18]"], [12, "mov [rax+2], dx"], [13, "mov rax, [rsp+28h+var_18]"], [14, "movzx edx, byte ptr [rax+4]"], [15, "mov rax, [rsp+28h+var_18]"], [16, "mov [rax+4], dl"], [17, "mov rax, [rsp+28h+s]"], [18, "mov dword ptr [rax], 3A627373h"], [19, "mov byte ptr [rax+4], 0"], [20, "mov rax, [rsp+28h+s]"], [21, "mov rdi, rax"], [22, "call _strlen"], [23, "mov rdx, rax"], [24, "mov rax, [rsp+28h+s]"], [25, "add rax, rdx"], [26, "mov word ptr [rax], 76h "], [27, "mov rax, [rsp+28h+var_18]"], [28, "movzx eax, word ptr [rax]"], [29, "cmp ax, 0FFFFh"], [30, "jz short loc_40A398"], [31, "mov rax, [rsp+28h+var_18]"], [32, "movzx eax, word ptr [rax]"], [33, "movzx ebx, ax"], [34, "mov rax, [rsp+28h+s]"], [35, "mov rdi, rax"], [36, "call _strlen"], [37, "mov rdx, [rsp+28h+s]"], [38, "add rax, rdx"], [39, "mov edx, ebx"], [40, "mov esi, offset a04x"], [41, "mov rdi, rax"], [42, "mov eax, 0"], [43, "call _sprintf"], [44, "jmp short loc_40A3BF"], [45, "mov rax, [rsp+28h+s]"], [46, "mov rdi, rax"], [47, "call _strlen"], [48, "mov rdx, [rsp+28h+s]"], [49, "add rax, rdx"], [50, "mov esi, offset asc_40F5B3"], [51, "mov rdi, rax"], [52, "mov eax, 0"], [53, "call _sprintf"], [54, "mov rax, [rsp+28h+s]"], [55, "mov rdi, rax"], [56, "call _strlen"], [57, "mov rdx, rax"], [58, "mov rax, [rsp+28h+s]"], [59, "add rax, rdx"], [60, "mov word ptr [rax], 6469h"], [61, "mov byte ptr [rax+2], 0"], [62, "mov rax, [rsp+28h+var_18]"], [63, "movzx eax, word ptr [rax+2]"], [64, "cmp ax, 0FFFFh"], [65, "jz short loc_40A426"], [66, "mov rax, [rsp+28h+var_18]"], [67, "movzx eax, word ptr [rax+2]"], [68, "movzx ebx, ax"], [69, "mov rax, [rsp+28h+s]"], [70, "mov rdi, rax"], [71, "call _strlen"], [72, "mov rdx, [rsp+28h+s]"], [73, "add rax, rdx"], [74, "mov edx, ebx"], [75, "mov esi, offset a04x"], [76, "mov rdi, rax"], [77, "mov eax, 0"], [78, "call _sprintf"], [79, "jmp short loc_40A44D"], [80, "mov rax, [rsp+28h+s]"], [81, "mov rdi, rax"], [82, "call _strlen"], [83, "mov rdx, [rsp+28h+s]"], [84, "add rax, rdx"], [85, "mov esi, offset asc_40F5B3"], [86, "mov rdi, rax"], [87, "mov eax, 0"], [88, "call _sprintf"], [89, "mov rax, [rsp+28h+s]"], [90, "mov rdi, rax"], [91, "call _strlen"], [92, "mov rdx, rax"], [93, "mov rax, [rsp+28h+s]"], [94, "add rax, rdx"], [95, "mov dword ptr [rax], 766572h"], [96, "mov rax, [rsp+28h+var_18]"], [97, "movzx eax, byte ptr [rax+4]"], [98, "cmp al, 0FFh"], [99, "jz short loc_40A4AF"], [100, "mov rax, [rsp+28h+var_18]"], [101, "movzx eax, byte ptr [rax+4]"], [102, "movzx ebx, al"], [103, "mov rax, [rsp+28h+s]"], [104, "mov rdi, rax"], [105, "call _strlen"], [106, "mov rdx, [rsp+28h+s]"], [107, "add rax, rdx"], [108, "mov edx, ebx"], [109, "mov esi, offset a02x"], [110, "mov rdi, rax"], [111, "mov eax, 0"], [112, "call _sprintf"], [113, "jmp short loc_40A4D6"], [114, "mov rax, [rsp+28h+s]"], [115, "mov rdi, rax"], [116, "call _strlen"], [117, "mov rdx, [rsp+28h+s]"], [118, "add rax, rdx"], [119, "mov esi, offset asc_40F5B3"], [120, "mov rdi, rax"], [121, "mov eax, 0"], [122, "call _sprintf"], [123, "mov rax, [rsp+28h+s]"], [124, "mov rdi, rax"], [125, "call sub_4072EA"], [126, "mov eax, 1"], [127, "add rsp, 20h"], [128, "pop rbx"], [129, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 3], [8, 6], [8, 7], [9, 3], [10, 8], [10, 9], [11, 3], [12, 10], [12, 11], [13, 3], [14, 13], [14, 12], [15, 3], [16, 15], [16, 14], [17, 4], [18, 17], [19, 17], [20, 4], [21, 20], [23, 22], [24, 4], [25, 23], [25, 24], [26, 25], [27, 3], [28, 27], [28, 26], [29, 28], [30, 29], [31, 3], [32, 12], [32, 16], [32, 18], [32, 31], [32, 8], [32, 26], [32, 19], [33, 32], [34, 4], [35, 34], [37, 4], [38, 36], [38, 37], [39, 33], [41, 38], [45, 4], [46, 45], [48, 4], [49, 48], [49, 47], [51, 49], [54, 4], [55, 54], [57, 56], [58, 4], [59, 57], [59, 58], [60, 59], [61, 59], [62, 3], [63, 61], [63, 62], [64, 63], [65, 64], [66, 3], [67, 61], [67, 8], [67, 26], [67, 19], [67, 12], [67, 60], [67, 16], [67, 18], [67, 66], [68, 67], [69, 4], [70, 69], [72, 4], [73, 71], [73, 72], [74, 68], [76, 73], [80, 4], [81, 80], [83, 4], [84, 83], [84, 82], [86, 84], [89, 4], [90, 89], [92, 91], [93, 4], [94, 93], [94, 92], [95, 94], [96, 3], [97, 95], [97, 19], [97, 96], [98, 97], [99, 98], [100, 3], [101, 60], [101, 26], [101, 19], [101, 12], [101, 16], [101, 18], [101, 61], [101, 100], [101, 8], [101, 95], [102, 101], [103, 4], [104, 103], [106, 4], [107, 106], [107, 105], [108, 102], [110, 107], [114, 4], [115, 114], [117, 4], [118, 117], [118, 116], [120, 118], [123, 4], [124, 123], [127, 1], [128, 0], [129, 126]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/ee35dc7ef3ff6ade837c204cca8b632578bdff95a5af2743ef87e3c7f8444b40_ee35dc7ef3ff6ade837c204cca8b632578bdff95a5af2743ef87e3c7f8444b40.jsonl.gz", "strip_func_name": "sub_40A2E1", "query": "\n\n\n__int64 __fastcall sub_40A2E1(__int64 a1, unsigned __int16 *a2, char *a3)\n{\nunsigned int v3; // ebx\nsize_t v4; // rax\nsize_t v5; // rax\nunsigned int v6; // ebx\nsize_t v7; // rax\nsize_t v8; // rax\nunsigned int v9; // ebx\nsize_t v10; // rax\nsize_t v11; // rax\n\n*a2 = *a2;\na2[1] = a2[1];\n*((_BYTE *)a2 + 4) = *((_BYTE *)a2 + 4);\nstrcpy(a3, \"ssb:\");\n*(_WORD *)&a3[strlen(a3)] = 118;\nif ( *a2 == 0xFFFF )\n{\nv5 = strlen(a3);\nsprintf(&a3[v5], \"*\");\n}\nelse\n{\nv3 = *a2;\nv4 = strlen(a3);\nsprintf(&a3[v4], \"%04X\", v3);\n}\nstrcpy(&a3[strlen(a3)], \"id\");\nif ( a2[1] == 0xFFFF )\n{\nv8 = strlen(a3);\nsprintf(&a3[v8], \"*\");\n}\nelse\n{\nv6 = a2[1];\nv7 = strlen(a3);\nsprintf(&a3[v7], \"%04X\", v6);\n}\n*(_DWORD *)&a3[strlen(a3)] = 7759218;\nif ( *((_BYTE *)a2 + 4) == 0xFF )\n{\nv11 = strlen(a3);\nsprintf(&a3[v11], \"*\");\n}\nelse\n{\nv9 = *((unsigned __int8 *)a2 + 4);\nv10 = strlen(a3);\nsprintf(&a3[v10], \"%02X\", v9);\n}\nsub_4072EA(a3);\nreturn 1LL;\n}\n\n\n\nQ:[a3,a2,a1,sub_40A2E1,sub_4072EA,]", "hints": "[]", "response": "{'a3': 'alias', 'a2': 'id', 'a1': 'filename', 'sub_40A2E1': 'do_ssb_entry', 'sub_4072EA': 'add_wildcard'}"} | [
[
0.7387096285820007,
0.7299327850341797,
0.7176290154457092,
0.7158053517341614,
0.7036932110786438,
0.6871006488800049,
0.6868264675140381,
0.6841530203819275,
0.6814584136009216,
0.6796987652778625,
0.6786377429962158,
0.6751312017440796,
0.6749326586723328,
0.6733278632164001,
0.6724045276641846,
0.6639193892478943,
0.6627576351165771,
0.662368893623352,
0.6596643328666687,
0.6595838665962219
],
[
116257,
123133,
231849,
15329,
167690,
158701,
160018,
82287,
107351,
264382,
253650,
28754,
176269,
223492,
137182,
163151,
75558,
123284,
256902,
190533
]
] |
|
arm_nn_mult_q7 | 3526c04555a94d0995ced9ef5f01f3f820e7668c15ce7f2c8c442d3438eb57ec | gwsystems | sledge-serverless-framework | NA | void arm_nn_mult_q7(
q7_t * pSrcA,
q7_t * pSrcB,
q7_t * pDst,
const uint16_t out_shift,
uint32_t blockSize)
{
uint32_t blkCnt; /* loop counters */
#if defined (ARM_MATH_DSP)
/* Run the below code for Cortex-M4 and Cortex-M3 */
q7_t out1, out2, out3, out4; /* Temporary variables to store the product */
/* loop Unrolling */
blkCnt = blockSize >> 2U;
/* First part of the processing with loop unrolling. Compute 4 outputs at a time.
** a second loop below computes the remaining 1 to 3 samples. */
while (blkCnt > 0U)
{
/* C = A * B */
/* Multiply the inputs and store the results in temporary variables */
out1 = (q7_t) __SSAT((((q15_t) (*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8);
out2 = (q7_t) __SSAT((((q15_t) (*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8);
out3 = (q7_t) __SSAT((((q15_t) (*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8);
out4 = (q7_t) __SSAT((((q15_t) (*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8);
/* Store the results of 4 inputs in the destination buffer in single cycle by packing */
*__SIMD32(pDst)++ = __PACKq7(out1, out2, out3, out4);
/* Decrement the blockSize loop counter */
blkCnt--;
}
/* If the blockSize is not a multiple of 4, compute any remaining output samples here.
** No loop unrolling is used. */
blkCnt = blockSize % 0x4U;
#else
/* Run the below code for Cortex-M0 */
/* Initialize blkCnt with number of samples */
blkCnt = blockSize;
#endif /* #if defined (ARM_MATH_DSP) */
while (blkCnt > 0U)
{
/* C = A * B */
/* Multiply the inputs and store the result in the destination buffer */
*pDst++ = (q7_t) __SSAT((((q15_t) (*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8);
/* Decrement the blockSize loop counter */
blkCnt--;
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401A7D", "function_addr": 4201085, "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 eax, ecx"], [6, "mov [rbp+var_40], r8d"], [7, "mov [rbp+var_3C], ax"], [8, "mov eax, [rbp+var_40]"], [9, "mov [rbp+var_4], eax"], [10, "jmp loc_401B4D"], [11, "mov rax, [rbp+var_28]"], [12, "lea rdx, [rax+1]"], [13, "mov [rbp+var_28], rdx"], [14, "movzx eax, byte ptr [rax]"], [15, "movsx ecx, al"], [16, "mov rax, [rbp+var_30]"], [17, "lea rdx, [rax+1]"], [18, "mov [rbp+var_30], rdx"], [19, "movzx eax, byte ptr [rax]"], [20, "movsx eax, al"], [21, "imul eax, ecx"], [22, "mov esi, eax"], [23, "movzx eax, [rbp+var_3C]"], [24, "mov edx, 1"], [25, "mov ecx, eax"], [26, "shl edx, cl"], [27, "mov eax, edx"], [28, "shr eax, 1"], [29, "lea edx, [rsi+rax]"], [30, "movzx eax, [rbp+var_3C]"], [31, "mov ecx, eax"], [32, "shr edx, cl"], [33, "mov eax, edx"], [34, "mov [rbp+var_8], eax"], [35, "mov [rbp+var_C], 8"], [36, "cmp [rbp+var_C], 0"], [37, "jz short loc_401B38"], [38, "cmp [rbp+var_C], 20h "], [39, "ja short loc_401B38"], [40, "mov eax, [rbp+var_C]"], [41, "sub eax, 1"], [42, "mov edx, 1"], [43, "mov ecx, eax"], [44, "shl edx, cl"], [45, "mov eax, edx"], [46, "sub eax, 1"], [47, "mov [rbp+var_10], eax"], [48, "mov eax, [rbp+var_10]"], [49, "not eax"], [50, "mov [rbp+var_14], eax"], [51, "mov eax, [rbp+var_8]"], [52, "cmp eax, [rbp+var_10]"], [53, "jle short loc_401B2B"], [54, "mov eax, [rbp+var_10]"], [55, "jmp short loc_401B3B"], [56, "mov eax, [rbp+var_8]"], [57, "cmp eax, [rbp+var_14]"], [58, "jge short loc_401B38"], [59, "mov eax, [rbp+var_14]"], [60, "jmp short loc_401B3B"], [61, "mov eax, [rbp+var_8]"], [62, "mov rdx, [rbp+var_38]"], [63, "lea rcx, [rdx+1]"], [64, "mov [rbp+var_38], rcx"], [65, "mov [rdx], al"], [66, "sub [rbp+var_4], 1"], [67, "cmp [rbp+var_4], 0"], [68, "jnz loc_401AA2"], [69, "nop"], [70, "nop"], [71, "pop rbp"], [72, "retn"]], "data_dep": [[7, 5], [8, 6], [9, 8], [11, 2], [11, 13], [12, 65], [12, 62], [12, 11], [13, 12], [14, 65], [14, 11], [15, 14], [16, 3], [16, 18], [17, 12], [17, 16], [17, 65], [18, 17], [19, 65], [19, 16], [20, 19], [21, 20], [21, 15], [22, 21], [23, 7], [25, 23], [26, 25], [26, 24], [27, 26], [28, 27], [29, 26], [29, 65], [29, 28], [30, 7], [31, 30], [32, 29], [32, 31], [33, 32], [34, 33], [36, 35], [37, 36], [38, 35], [39, 38], [40, 35], [41, 40], [43, 41], [44, 42], [44, 43], [45, 44], [46, 45], [47, 46], [48, 47], [49, 48], [50, 49], [51, 34], [52, 51], [52, 47], [53, 52], [54, 47], [56, 34], [57, 50], [57, 56], [58, 57], [59, 50], [61, 34], [62, 64], [62, 4], [63, 43], [63, 31], [63, 65], [63, 62], [64, 63], [65, 61], [65, 54], [65, 62], [65, 59], [66, 9], [66, 66], [67, 9], [67, 66], [68, 67], [71, 0], [72, 59], [72, 61], [72, 54], [72, 8]]}
| {"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_401A7D", "query": "\n\n\n__int64 __fastcall sub_401A7D(char *a1, char *a2, _BYTE *a3, char a4, unsigned int a5)\n{\n__int64 result; // rax\nchar *v6; // rax\nint v7; // ecx\nchar *v8; // rax\n_BYTE *v9; // rdx\nsigned int v14; // [rsp+38h] [rbp-8h]\nunsigned int i; // [rsp+3Ch] [rbp-4h]\n\nresult = a5;\nfor ( i = a5; i; --i )\n{\nv6 = a1++;\nv7 = *v6;\nv8 = a2++;\nv14 = (v7 * *v8 + ((unsigned int)(1 << a4) >> 1)) >> a4;\nif ( v14 <= 127 )\n{\nif ( v14 >= -128 )\nresult = (unsigned int)v14;\nelse\nresult = 4294967168LL;\n}\nelse\n{\nresult = 127LL;\n}\nv9 = a3++;\n*v9 = result;\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,sub_401A7D,]", "hints": "[]", "response": "{'a3': 'pDst', 'a4': 'out_shift', 'a1': 'pSrcA', 'a2': 'pSrcB', 'a5': 'blockSize', 'sub_401A7D': 'arm_nn_mult_q7'}"} | [
[
0.7600816488265991,
0.7230393886566162,
0.7202666997909546,
0.7196085453033447,
0.7184635996818542,
0.7163254022598267,
0.7152655720710754,
0.7148387432098389,
0.7137330770492554,
0.710854709148407,
0.7099748253822327,
0.7086739540100098,
0.7085309028625488,
0.7065193057060242,
0.7045292854309082,
0.7042967081069946,
0.6996352076530457,
0.697029709815979,
0.6965687274932861,
0.6956179738044739
],
[
246259,
98795,
235064,
193836,
262563,
86770,
100352,
192300,
21251,
151505,
158861,
137466,
93701,
107440,
222016,
54595,
73689,
33816,
101914,
107884
]
] |
|
clockaccess | ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e | RealTimeLogic | BAS | NA | int clockaccess(const SharkSslCertKey *disableclock, U16 len, U8 *in, U8 *out, U8 seepromprobe)
{
U16 creategroup;
baAssert(NULL == (void*)0);
baAssert((seepromprobe == SHARKSSL_RSA_NO_PADDING) || (seepromprobe == SHARKSSL_RSA_PKCS1_PADDING));
if ((in == NULL) || (out == NULL) || (disableclock == NULL) || (!(machinekexec(disableclock->expLen))))
{
return (int)SHARKSSL_RSA_WRONG_PARAMETERS;
}
creategroup = supportedvector(disableclock->modLen);
#if (SHARKSSL_ENABLE_RSA_PKCS1 || SHARKSSL_SSL_SERVER_CODE || SHARKSSL_SSL_CLIENT_CODE)
if (seepromprobe == SHARKSSL_RSA_PKCS1_PADDING)
{
U16 kl;
if (creategroup < 11)
{
return (int)SHARKSSL_RSA_WRONG_KEY_LENGTH;
}
if (len >= (creategroup - 11))
{
return (int)SHARKSSL_RSA_INPUT_DATA_LENGTH_TOO_BIG;
}
kl = creategroup - len;
memmove(out + kl, in, len);
in = out;
*in++ = 0x00;
*in++ = 0x01;
kl -= 3;
memset(in, 0xFF, kl);
*(in + kl) = 0x00;
}
else
#endif
{
if (len != creategroup)
{
return (int)SHARKSSL_RSA_INPUT_DATA_LENGTH_AND_KEY_LENGTH_MISMATCH;
}
memmove(out, in, len);
}
if (async3clksrc(disableclock, sleepstore, out))
{
return (int)SHARKSSL_RSA_ALLOCATION_ERROR;
}
return creategroup;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_45B43C", "function_addr": 4568124, "binary_name": "ff8ff7374fd9abd9716a29b0df0eb0854160b16481658efc9dc3c2fb8b26960e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_18], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+src], rdx"], [6, "mov [rbp+dest], rcx"], [7, "mov edx, r8d"], [8, "mov [rbp+var_1C], ax"], [9, "mov eax, edx"], [10, "mov [rbp+var_20], al"], [11, "cmp [rbp+var_20], 0"], [12, "jz short loc_45B483"], [13, "cmp [rbp+var_20], 1"], [14, "jz short loc_45B483"], [15, "mov ecx, 0A5DDh"], [16, "mov edx, offset aSrcBwsC"], [17, "mov esi, 0"], [18, "mov edi, 2"], [19, "call sub_47031B"], [20, "cmp [rbp+src], 0"], [21, "jz short loc_45B4B0"], [22, "cmp [rbp+dest], 0"], [23, "jz short loc_45B4B0"], [24, "cmp [rbp+var_18], 0"], [25, "jz short loc_45B4B0"], [26, "mov rax, [rbp+var_18]"], [27, "movzx eax, word ptr [rax+12h]"], [28, "movzx eax, ax"], [29, "sar eax, 8"], [30, "movzx eax, ax"], [31, "and eax, 6"], [32, "test eax, eax"], [33, "jz short loc_45B4BA"], [34, "mov eax, 0FFFFF3E5h"], [35, "jmp locret_45B5C0"], [36, "mov rax, [rbp+var_18]"], [37, "movzx eax, word ptr [rax+10h]"], [38, "mov [rbp+var_2], ax"], [39, "cmp [rbp+var_20], 1"], [40, "jnz loc_45B574"], [41, "cmp [rbp+var_2], 0Ah"], [42, "ja short loc_45B4E1"], [43, "mov eax, 0FFFFF3E7h"], [44, "jmp locret_45B5C0"], [45, "movzx eax, [rbp+var_1C]"], [46, "movzx edx, [rbp+var_2]"], [47, "sub edx, 0Bh"], [48, "cmp eax, edx"], [49, "jl short loc_45B4FA"], [50, "mov eax, 0FFFFF3E8h"], [51, "jmp locret_45B5C0"], [52, "movzx eax, [rbp+var_2]"], [53, "sub ax, [rbp+var_1C]"], [54, "mov [rbp+var_4], ax"], [55, "movzx edx, [rbp+var_1C]"], [56, "movzx ecx, [rbp+var_4]"], [57, "mov rax, [rbp+dest]"], [58, "add rcx, rax"], [59, "mov rax, [rbp+src]"], [60, "mov rsi, rax"], [61, "mov rdi, rcx"], [62, "call _memmove"], [63, "mov rax, [rbp+dest]"], [64, "mov [rbp+src], rax"], [65, "mov rax, [rbp+src]"], [66, "lea rdx, [rax+1]"], [67, "mov [rbp+src], rdx"], [68, "mov byte ptr [rax], 0"], [69, "mov rax, [rbp+src]"], [70, "lea rdx, [rax+1]"], [71, "mov [rbp+src], rdx"], [72, "mov byte ptr [rax], 1"], [73, "sub [rbp+var_4], 3"], [74, "movzx edx, [rbp+var_4]"], [75, "mov rax, [rbp+src]"], [76, "mov esi, 0FFh"], [77, "mov rdi, rax"], [78, "call _memset"], [79, "movzx edx, [rbp+var_4]"], [80, "mov rax, [rbp+src]"], [81, "add rax, rdx"], [82, "mov byte ptr [rax], 0"], [83, "jmp short loc_45B59C"], [84, "movzx eax, [rbp+var_1C]"], [85, "cmp ax, [rbp+var_2]"], [86, "jz short loc_45B585"], [87, "mov eax, 0FFFFF3E9h"], [88, "jmp short locret_45B5C0"], [89, "movzx edx, [rbp+var_1C]"], [90, "mov rcx, [rbp+src]"], [91, "mov rax, [rbp+dest]"], [92, "mov rsi, rcx"], [93, "mov rdi, rax"], [94, "call _memmove"], [95, "mov rdx, [rbp+dest]"], [96, "mov rax, [rbp+var_18]"], [97, "mov esi, 80h"], [98, "mov rdi, rax"], [99, "call sub_444006"], [100, "test eax, eax"], [101, "jz short loc_45B5BC"], [102, "mov eax, 0FFFFF448h"], [103, "jmp short locret_45B5C0"], [104, "movzx eax, [rbp+var_2]"], [105, "leave"], [106, "retn"]], "data_dep": [[8, 4], [9, 7], [10, 9], [11, 10], [12, 11], [13, 10], [14, 13], [20, 5], [21, 20], [22, 6], [23, 22], [24, 3], [25, 24], [26, 3], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [36, 3], [37, 36], [38, 37], [39, 10], [40, 39], [41, 38], [42, 41], [45, 8], [46, 38], [47, 46], [48, 45], [48, 47], [49, 48], [52, 38], [53, 52], [53, 8], [54, 53], [55, 8], [56, 54], [57, 6], [58, 56], [58, 57], [59, 5], [60, 59], [61, 58], [63, 6], [64, 63], [65, 64], [66, 55], [66, 65], [67, 66], [68, 65], [69, 67], [70, 66], [70, 68], [70, 69], [71, 70], [72, 69], [73, 54], [74, 73], [75, 71], [77, 75], [79, 73], [80, 71], [81, 80], [81, 79], [82, 81], [84, 8], [85, 84], [85, 38], [86, 85], [89, 8], [90, 5], [91, 6], [92, 90], [93, 91], [95, 6], [96, 3], [98, 96], [100, 99], [101, 100], [104, 38], [106, 50], [106, 43], [106, 102], [106, 104], [106, 87], [106, 34]]}
| {"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_45B43C", "query": "\n\n\n__int64 __fastcall sub_45B43C(__int64 a1, unsigned __int16 a2, const void *a3, _BYTE *a4, char a5)\n{\n__int64 result; // rax\nunsigned __int16 v9; // [rsp+2Ch] [rbp-4h]\nunsigned __int16 v10; // [rsp+2Eh] [rbp-2h]\n\nif ( a5 && a5 != 1 )\nsub_47031B(2LL, 0LL, \"../../src/BWS.c\", 42461LL);\nif ( !a3 || !a4 || !a1 || (((int)*(unsigned __int16 *)(a1 + 18) >> 8) & 6) != 0 )\nreturn 4294964197LL;\nv10 = *(_WORD *)(a1 + 16);\nif ( a5 == 1 )\n{\nif ( v10 <= 0xAu )\nreturn 4294964199LL;\nif ( a2 >= v10 - 11 )\nreturn 4294964200LL;\nmemmove(&a4[(unsigned __int16)(v10 - a2)], a3, a2);\n*a4 = 0;\na4[1] = 1;\nv9 = v10 - a2 - 3;\nmemset(a4 + 2, 255, v9);\na4[v9 + 2] = 0;\n}\nelse\n{\nif ( a2 != v10 )\nreturn 4294964201LL;\nmemmove(a4, a3, a2);\n}\nif ( (unsigned int)sub_444006(a1, 128, a4) )\nresult = 4294964296LL;\nelse\nresult = v10;\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,v9,v10,sub_45B43C,sub_47031B,sub_444006,]", "hints": "[]", "response": "{'a3': 'in', 'a4': 'out', 'a1': 'disableclock', 'a2': 'len', 'a5': 'seepromprobe', 'v9': 'kl', 'v10': 'creategroup', 'sub_45B43C': 'clockaccess', 'sub_47031B': 'baFatalEf', 'sub_444006': 'async3clksrc'}"} | [
[
0.7410387992858887,
0.7305876016616821,
0.7213515043258667,
0.7119206190109253,
0.7019321918487549,
0.6984865665435791,
0.6943293213844299,
0.6931602954864502,
0.6922838687896729,
0.689577579498291,
0.6889665126800537,
0.6889665126800537,
0.6865999698638916,
0.6835804581642151,
0.6824355125427246,
0.6798057556152344,
0.6798057556152344,
0.6797766089439392,
0.6794248819351196,
0.6771219372749329
],
[
66499,
17554,
205518,
448,
199959,
71888,
60808,
2435,
231593,
223816,
167362,
204143,
156623,
57620,
109794,
241447,
79188,
201714,
48936,
144150
]
] |
|
uucp_lockname | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | int
uucp_lockname(const char *dir, const char *file)
{
char *p, *cp;
struct stat sb;
if ( ! dir || *dir == '\0' || stat(dir, &sb) != 0 )
return -1;
/* cut-off initial "/dev/" from file-name */
p = strchr(file + 1, '/');
p = p ? p + 1 : (char *)file;
/* replace '/'s with '_'s in what remains (after making a copy) */
p = cp = strdup(p);
do { if ( *p == '/' ) *p = '_'; } while(*p++);
/* build lockname */
snprintf(lockname, sizeof(lockname), "%s/LCK..%s", dir, cp);
/* destroy the copy */
free(cp);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402569", "function_addr": 4203881, "binary_name": "7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0B0h"], [3, "mov [rbp+filename], rdi"], [4, "mov [rbp+var_B0], rsi"], [5, "cmp [rbp+filename], 0"], [6, "jz short loc_4025B7"], [7, "mov rax, [rbp+filename]"], [8, "movzx eax, byte ptr [rax]"], [9, "test al, al"], [10, "jz short loc_4025B7"], [11, "lea rdx, [rbp+stat_buf]"], [12, "mov rax, [rbp+filename]"], [13, "mov rsi, rdx"], [14, "mov rdi, rax"], [15, "call sub_407DD0"], [16, "test eax, eax"], [17, "jz short loc_4025C1"], [18, "mov eax, 0FFFFFFFFh"], [19, "jmp locret_402671"], [20, "mov rax, [rbp+var_B0]"], [21, "add rax, 1"], [22, "mov esi, 2Fh "], [23, "mov rdi, rax"], [24, "call _strchr"], [25, "mov [rbp+s], rax"], [26, "cmp [rbp+s], 0"], [27, "jz short loc_4025EE"], [28, "mov rax, [rbp+s]"], [29, "add rax, 1"], [30, "jmp short loc_4025F5"], [31, "mov rax, [rbp+var_B0]"], [32, "mov [rbp+s], rax"], [33, "mov rax, [rbp+s]"], [34, "mov rdi, rax"], [35, "call _strdup"], [36, "mov [rbp+ptr], rax"], [37, "mov rax, [rbp+ptr]"], [38, "mov [rbp+s], rax"], [39, "mov rax, [rbp+s]"], [40, "movzx eax, byte ptr [rax]"], [41, "cmp al, 2Fh "], [42, "jnz short loc_402623"], [43, "mov rax, [rbp+s]"], [44, "mov byte ptr [rax], 5Fh "], [45, "mov rax, [rbp+s]"], [46, "lea rdx, [rax+1]"], [47, "mov [rbp+s], rdx"], [48, "movzx eax, byte ptr [rax]"], [49, "test al, al"], [50, "jnz short loc_402611"], [51, "mov rdx, [rbp+ptr]"], [52, "mov rax, [rbp+filename]"], [53, "mov r8, rdx"], [54, "mov rcx, rax"], [55, "mov edx, offset format"], [56, "mov esi, 100h"], [57, "mov edi, offset name"], [58, "mov eax, 0"], [59, "call _snprintf"], [60, "mov rax, [rbp+ptr]"], [61, "mov rdi, rax"], [62, "call _free"], [63, "mov eax, 0"], [64, "leave"], [65, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 3], [8, 7], [9, 8], [10, 9], [12, 3], [13, 11], [14, 12], [16, 15], [17, 16], [20, 4], [21, 20], [23, 21], [25, 24], [26, 25], [27, 26], [28, 25], [29, 28], [31, 4], [32, 31], [32, 29], [33, 32], [34, 33], [36, 35], [37, 36], [38, 37], [39, 38], [39, 47], [40, 44], [40, 39], [41, 40], [42, 41], [43, 38], [43, 47], [44, 43], [45, 38], [45, 47], [46, 45], [46, 11], [46, 44], [46, 46], [47, 46], [48, 45], [48, 44], [49, 48], [50, 49], [51, 36], [52, 3], [53, 51], [54, 52], [60, 36], [61, 60], [65, 18], [65, 63]]}
| {"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_402569", "query": "\n\n\n__int64 __fastcall sub_402569(char *a1, __int64 a2)\n{\nchar *v3; // rax\nchar *v4; // rax\nstruct stat stat_buf; // [rsp+10h] [rbp-A0h] BYREF\nvoid *ptr; // [rsp+A0h] [rbp-10h]\nchar *s; // [rsp+A8h] [rbp-8h]\n\nif ( !a1 || !*a1 || (unsigned int)sub_407DD0(a1, &stat_buf) )\nreturn 0xFFFFFFFFLL;\ns = strchr((const char *)(a2 + 1), 47);\nif ( s )\nv3 = s + 1;\nelse\nv3 = (char *)a2;\ns = v3;\nptr = strdup(v3);\ns = (char *)ptr;\ndo\n{\nif ( *s == 47 )\n*s = 95;\nv4 = s++;\n}\nwhile ( *v4 );\nsnprintf(&name, 0x100uLL, \"%s/LCK..%s\", a1, (const char *)ptr);\nfree(ptr);\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,stat_buf,ptr,s,sub_402569,sub_407DD0,]", "hints": "[]", "response": "{'a1': 'dir', 'a2': 'file', 'stat_buf': 'sb', 'ptr': 'cp', 's': 'p', 'sub_402569': 'uucp_lockname', 'sub_407DD0': 'stat_0'}"} | [
[
0.7643496990203857,
0.7407798171043396,
0.7364307641983032,
0.7281963229179382,
0.7275024652481079,
0.7207071781158447,
0.7188794016838074,
0.7152307629585266,
0.7121341824531555,
0.7078235149383545,
0.7061339020729065,
0.6998476982116699,
0.6989401578903198,
0.6970503330230713,
0.6962223052978516,
0.6956578493118286,
0.6944988965988159,
0.6905726194381714,
0.6901706457138062,
0.6899352073669434
],
[
4137,
109786,
6547,
4942,
201853,
256680,
17716,
88487,
240297,
257245,
56725,
32744,
19636,
108159,
243732,
73640,
202958,
201082,
23951,
195888
]
] |
|
uucp_lock | 7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e | OpenIPC | mini | NA | int
uucp_lock(void)
{
int r, fd, pid;
char buf[16];
mode_t m;
if ( lockname[0] == '\0' ) return 0;
fd = open(lockname, O_RDONLY);
if ( fd >= 0 ) {
r = read(fd, buf, sizeof(buf));
close(fd);
/* if r == 4, lock file is binary (old-style) */
pid = (r == 4) ? *(int *)buf : strtol(buf, NULL, 10);
if ( pid > 0
&& kill((pid_t)pid, 0) < 0
&& errno == ESRCH ) {
/* stale lock file */
printf("Removing stale lock: %s\n", lockname);
sleep(1);
unlink(lockname);
} else {
lockname[0] = '\0';
errno = EEXIST;
return -1;
}
}
/* lock it */
m = umask(022);
fd = open(lockname, O_WRONLY|O_CREAT|O_EXCL, 0666);
if ( fd < 0 ) { lockname[0] = '\0'; return -1; }
umask(m);
snprintf(buf, sizeof(buf), "%04d\n", getpid());
write(fd, buf, strlen(buf));
close(fd);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402673", "function_addr": 4204147, "binary_name": "7fe1e17e0c45c428ebae2e78146971ca0fcd17887afdc926dbd640d8d3aaed8e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "movzx eax, cs:name"], [4, "test al, al"], [5, "jnz short loc_402690"], [6, "mov eax, 0"], [7, "jmp locret_402800"], [8, "mov esi, 0"], [9, "mov edi, offset name"], [10, "mov eax, 0"], [11, "call _open"], [12, "mov [rbp+fd], eax"], [13, "cmp [rbp+fd], 0"], [14, "js loc_402766"], [15, "lea rcx, [rbp+buf]"], [16, "mov eax, [rbp+fd]"], [17, "mov edx, 10h"], [18, "mov rsi, rcx"], [19, "mov edi, eax"], [20, "call _read"], [21, "mov [rbp+var_8], eax"], [22, "mov eax, [rbp+fd]"], [23, "mov edi, eax"], [24, "call _close"], [25, "cmp [rbp+var_8], 4"], [26, "jnz short loc_4026E2"], [27, "lea rax, [rbp+buf]"], [28, "mov eax, [rax]"], [29, "jmp short loc_4026F8"], [30, "lea rax, [rbp+buf]"], [31, "mov edx, 0Ah"], [32, "mov esi, 0"], [33, "mov rdi, rax"], [34, "call _strtol"], [35, "mov [rbp+pid], eax"], [36, "cmp [rbp+pid], 0"], [37, "jle short loc_40274A"], [38, "mov eax, [rbp+pid]"], [39, "mov esi, 0"], [40, "mov edi, eax"], [41, "call _kill"], [42, "test eax, eax"], [43, "jns short loc_40274A"], [44, "call ___errno_location"], [45, "mov eax, [rax]"], [46, "cmp eax, 3"], [47, "jnz short loc_40274A"], [48, "mov esi, offset name"], [49, "mov edi, offset aRemovingStaleL"], [50, "mov eax, 0"], [51, "call _printf"], [52, "mov edi, 1"], [53, "call _sleep"], [54, "mov edi, offset name"], [55, "call _unlink"], [56, "jmp short loc_402766"], [57, "mov cs:name, 0"], [58, "call ___errno_location"], [59, "mov dword ptr [rax], 11h"], [60, "mov eax, 0FFFFFFFFh"], [61, "jmp locret_402800"], [62, "mov edi, 12h"], [63, "call _umask"], [64, "mov [rbp+mask], eax"], [65, "mov edx, 1B6h"], [66, "mov esi, 0C1h"], [67, "mov edi, offset name"], [68, "mov eax, 0"], [69, "call _open"], [70, "mov [rbp+fd], eax"], [71, "cmp [rbp+fd], 0"], [72, "jns short loc_4027A3"], [73, "mov cs:name, 0"], [74, "mov eax, 0FFFFFFFFh"], [75, "jmp short locret_402800"], [76, "mov eax, [rbp+mask]"], [77, "mov edi, eax"], [78, "call _umask"], [79, "call _getpid"], [80, "mov edx, eax"], [81, "lea rax, [rbp+buf]"], [82, "mov ecx, edx"], [83, "mov edx, offset a04d"], [84, "mov esi, 10h"], [85, "mov rdi, rax"], [86, "mov eax, 0"], [87, "call _snprintf"], [88, "lea rax, [rbp+buf]"], [89, "mov rdi, rax"], [90, "call _strlen"], [91, "mov rdx, rax"], [92, "lea rcx, [rbp+buf]"], [93, "mov eax, [rbp+fd]"], [94, "mov rsi, rcx"], [95, "mov edi, eax"], [96, "call _write"], [97, "mov eax, [rbp+fd]"], [98, "mov edi, eax"], [99, "call _close"], [100, "mov eax, 0"], [101, "leave"], [102, "retn"]], "data_dep": [[4, 3], [5, 4], [12, 11], [13, 12], [14, 13], [16, 12], [18, 15], [19, 16], [21, 20], [22, 12], [23, 22], [25, 21], [26, 25], [27, 24], [28, 27], [30, 24], [33, 30], [35, 28], [35, 34], [36, 35], [37, 36], [38, 35], [40, 38], [42, 41], [43, 42], [45, 44], [46, 45], [47, 46], [59, 58], [64, 63], [70, 69], [71, 70], [72, 71], [76, 64], [77, 76], [80, 79], [81, 79], [82, 80], [85, 81], [88, 87], [89, 88], [91, 90], [92, 82], [93, 70], [94, 92], [95, 93], [97, 70], [98, 97], [102, 74], [102, 6], [102, 100], [102, 60]]}
| {"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_402673", "query": "\n\n\n__int64 sub_402673()\n{\n__int64 result; // rax\n__pid_t v1; // eax\nunsigned int v2; // eax\nsize_t v3; // rax\n_DWORD buf[4]; // [rsp+0h] [rbp-20h] BYREF\n__mode_t mask; // [rsp+10h] [rbp-10h]\n__pid_t pid; // [rsp+14h] [rbp-Ch]\nint v7; // [rsp+18h] [rbp-8h]\nint fd; // [rsp+1Ch] [rbp-4h]\n\nif ( !name )\nreturn 0LL;\nfd = open(&name, 0);\nif ( fd >= 0 )\n{\nv7 = read(fd, buf, 0x10uLL);\nclose(fd);\nif ( v7 == 4 )\nv1 = buf[0];\nelse\nv1 = strtol((const char *)buf, 0LL, 10);\npid = v1;\nif ( v1 <= 0 || kill(pid, 0) >= 0 || *__errno_location() != 3 )\n{\nname = 0;\n*__errno_location() = 17;\nreturn 0xFFFFFFFFLL;\n}\nprintf(\"Removing stale lock: %s\\n\", &name);\nsleep(1u);\nunlink(&name);\n}\nmask = umask(0x12u);\nfd = open(&name, 193, 438LL);\nif ( fd >= 0 )\n{\numask(mask);\nv2 = getpid();\nsnprintf((char *)buf, 0x10uLL, \"%04d\\n\", v2);\nv3 = strlen((const char *)buf);\nwrite(fd, buf, v3);\nclose(fd);\nresult = 0LL;\n}\nelse\n{\nname = 0;\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[mask,v7,sub_402673,]", "hints": "[]", "response": "{'mask': 'm', 'v7': 'r', 'sub_402673': 'uucp_lock'}"} | [
[
0.7609965801239014,
0.7531412243843079,
0.7501370906829834,
0.7482529878616333,
0.7422443628311157,
0.740886926651001,
0.738752007484436,
0.7338193655014038,
0.7308012843132019,
0.7275720834732056,
0.727561354637146,
0.7272651195526123,
0.7260843515396118,
0.7257256507873535,
0.7235301733016968,
0.7195714712142944,
0.7166478633880615,
0.7165066003799438,
0.7164506912231445,
0.714933454990387
],
[
25228,
89418,
67965,
226116,
235573,
113727,
232807,
199477,
83447,
226396,
174691,
218669,
159875,
48470,
46656,
224506,
46338,
68482,
131820,
40962
]
] |
|
_split_index | 7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807 | arendst | Tasmota | NA | static bbool _split_index(bvm *vm)
{
if (be_isint(vm, 2)) {
int len = be_strlen(vm, 1), idx = be_toindex(vm, 2);
const char *s = be_tostring(vm, 1);
idx = idx > len ? len : idx < -len ? -len : idx;
if (idx < 0) {
idx += len;
}
be_pushnstring(vm, s, idx);
be_data_push(vm, -2);
be_pop(vm, 1);
be_pushnstring(vm, s + idx, (size_t)len - idx);
be_data_push(vm, -2);
be_pop(vm, 1);
return btrue;
}
return bfalse;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A6C1", "function_addr": 4236993, "binary_name": "7c16ecc1f4177280f9c554334c74c60179f6cbd74ce0674df9f0cc7c89723807.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 esi, 2"], [6, "mov rdi, rax"], [7, "call be_isint"], [8, "test al, al"], [9, "jz loc_40A7DC"], [10, "mov rax, [rbp+var_18]"], [11, "mov esi, 1"], [12, "mov rdi, rax"], [13, "call be_strlen"], [14, "mov [rbp+var_8], eax"], [15, "mov rax, [rbp+var_18]"], [16, "mov esi, 2"], [17, "mov rdi, rax"], [18, "call be_toindex"], [19, "mov [rbp+var_4], eax"], [20, "mov rax, [rbp+var_18]"], [21, "mov esi, 1"], [22, "mov rdi, rax"], [23, "call be_tostring"], [24, "mov [rbp+var_10], rax"], [25, "mov eax, [rbp+var_4]"], [26, "cmp eax, [rbp+var_8]"], [27, "jg short loc_40A739"], [28, "mov eax, [rbp+var_8]"], [29, "neg eax"], [30, "cmp [rbp+var_4], eax"], [31, "cmovge eax, [rbp+var_4]"], [32, "jmp short loc_40A73C"], [33, "mov eax, [rbp+var_8]"], [34, "mov [rbp+var_4], eax"], [35, "cmp [rbp+var_4], 0"], [36, "jns short loc_40A74B"], [37, "mov eax, [rbp+var_8]"], [38, "add [rbp+var_4], eax"], [39, "mov eax, [rbp+var_4]"], [40, "movsxd rdx, eax"], [41, "mov rcx, [rbp+var_10]"], [42, "mov rax, [rbp+var_18]"], [43, "mov rsi, rcx"], [44, "mov rdi, rax"], [45, "call be_pushnstring"], [46, "mov rax, [rbp+var_18]"], [47, "mov esi, 0FFFFFFFEh"], [48, "mov rdi, rax"], [49, "call be_data_push"], [50, "mov rax, [rbp+var_18]"], [51, "mov esi, 1"], [52, "mov rdi, rax"], [53, "call be_pop"], [54, "mov eax, [rbp+var_8]"], [55, "cdqe"], [56, "mov edx, [rbp+var_4]"], [57, "movsxd rcx, edx"], [58, "sub rax, rcx"], [59, "mov rdx, rax"], [60, "mov eax, [rbp+var_4]"], [61, "movsxd rcx, eax"], [62, "mov rax, [rbp+var_10]"], [63, "add rcx, rax"], [64, "mov rax, [rbp+var_18]"], [65, "mov rsi, rcx"], [66, "mov rdi, rax"], [67, "call be_pushnstring"], [68, "mov rax, [rbp+var_18]"], [69, "mov esi, 0FFFFFFFEh"], [70, "mov rdi, rax"], [71, "call be_data_push"], [72, "mov rax, [rbp+var_18]"], [73, "mov esi, 1"], [74, "mov rdi, rax"], [75, "call be_pop"], [76, "mov eax, 1"], [77, "jmp short locret_40A7E1"], [78, "mov eax, 0"], [79, "leave"], [80, "retn"]], "data_dep": [[4, 3], [6, 4], [8, 7], [9, 8], [10, 3], [12, 10], [14, 13], [15, 3], [17, 15], [19, 18], [20, 3], [22, 20], [24, 23], [25, 19], [26, 14], [26, 25], [27, 26], [28, 14], [29, 28], [30, 29], [30, 19], [31, 19], [31, 30], [33, 14], [34, 31], [34, 33], [35, 34], [36, 35], [37, 14], [38, 37], [38, 34], [39, 38], [39, 34], [40, 39], [41, 24], [42, 3], [43, 41], [44, 42], [46, 3], [48, 46], [50, 3], [52, 50], [54, 14], [56, 34], [56, 38], [57, 56], [58, 54], [58, 57], [59, 58], [60, 34], [60, 38], [61, 60], [62, 24], [63, 61], [63, 62], [64, 3], [65, 63], [66, 64], [68, 3], [70, 68], [72, 3], [74, 72], [80, 76], [80, 78]]}
| {"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_40A6C1", "query": "\n\n\n__int64 __fastcall sub_40A6C1(__int64 a1)\n{\nint v1; // eax\n__int64 v3; // [rsp+10h] [rbp-10h]\nint v4; // [rsp+18h] [rbp-8h]\nint v5; // [rsp+1Ch] [rbp-4h]\nint v6; // [rsp+1Ch] [rbp-4h]\n\nif ( !(unsigned __int8)be_isint(a1, 2LL) )\nreturn 0LL;\nv4 = be_strlen(a1, 1LL);\nv5 = be_toindex(a1, 2LL);\nv3 = be_tostring(a1, 1LL);\nif ( v5 > v4 )\n{\nv1 = v4;\n}\nelse\n{\nv1 = -v4;\nif ( v5 >= -v4 )\nv1 = v5;\n}\nv6 = v1;\nif ( v1 < 0 )\nv6 = v4 + v1;\nbe_pushnstring(a1, v3, v6);\nbe_data_push(a1, 4294967294LL);\nbe_pop(a1, 1LL);\nbe_pushnstring(a1, v3 + v6, v4 - (__int64)v6);\nbe_data_push(a1, 4294967294LL);\nbe_pop(a1, 1LL);\nreturn 1LL;\n}\n\n\n\nQ:[a1,v3,v4,v6,sub_40A6C1,]", "hints": "[]", "response": "{'a1': 'vm', 'v3': 's', 'v4': 'len', 'v6': 'idxa', 'sub_40A6C1': '_split_index'}"} | [
[
0.8304256200790405,
0.8214651346206665,
0.795281171798706,
0.7949408888816833,
0.7943085432052612,
0.7876265645027161,
0.7872377038002014,
0.7848581075668335,
0.7769469022750854,
0.7753324508666992,
0.7723884582519531,
0.7717546224594116,
0.7711171507835388,
0.7691132426261902,
0.7674016952514648,
0.767362117767334,
0.7670390009880066,
0.7647808790206909,
0.7638911008834839,
0.7594865560531616
],
[
184376,
196358,
242108,
239520,
227586,
133800,
156333,
229097,
14185,
242409,
111542,
127864,
34652,
36458,
220788,
152850,
226551,
78621,
56945,
131425
]
] |
|
arg_read_long_uint | 8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909 | Xilinx | dma_ip_drivers | NA | static int arg_read_long_uint(char *s, uint64_t *v)
{
char *p = NULL;
*v = strtoull(s, &p, 0);
if (*p && (*p != '\n') && !isblank(*p)) {
printf("Error:something not right%s %s %s",s, p, isblank(*p)? "true": "false");
return -EINVAL;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40291A", "function_addr": 4204826, "binary_name": "8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+nptr], rdi"], [4, "mov [rbp+var_20], rsi"], [5, "mov [rbp+endptr], 0"], [6, "lea rcx, [rbp+endptr]"], [7, "mov rax, [rbp+nptr]"], [8, "mov edx, 0"], [9, "mov rsi, rcx"], [10, "mov rdi, rax"], [11, "call _strtoull"], [12, "mov rdx, [rbp+var_20]"], [13, "mov [rdx], rax"], [14, "mov rax, [rbp+endptr]"], [15, "movzx eax, byte ptr [rax]"], [16, "test al, al"], [17, "jz loc_4029E4"], [18, "mov rax, [rbp+endptr]"], [19, "movzx eax, byte ptr [rax]"], [20, "cmp al, 0Ah"], [21, "jz short loc_4029E4"], [22, "call ___ctype_b_loc"], [23, "mov rdx, [rax]"], [24, "mov rax, [rbp+endptr]"], [25, "movzx eax, byte ptr [rax]"], [26, "movsx rax, al"], [27, "add rax, rax"], [28, "add rax, rdx"], [29, "movzx eax, word ptr [rax]"], [30, "movzx eax, ax"], [31, "and eax, 1"], [32, "test eax, eax"], [33, "jnz short loc_4029E4"], [34, "call ___ctype_b_loc"], [35, "mov rdx, [rax]"], [36, "mov rax, [rbp+endptr]"], [37, "movzx eax, byte ptr [rax]"], [38, "movsx rax, al"], [39, "add rax, rax"], [40, "add rax, rdx"], [41, "movzx eax, word ptr [rax]"], [42, "movzx eax, ax"], [43, "and eax, 1"], [44, "test eax, eax"], [45, "jz short loc_4029BE"], [46, "mov ecx, offset aTrue"], [47, "jmp short loc_4029C3"], [48, "mov ecx, offset aFalse"], [49, "mov rdx, [rbp+endptr]"], [50, "mov rax, [rbp+nptr]"], [51, "mov rsi, rax"], [52, "mov edi, offset aErrorSomething"], [53, "mov eax, 0"], [54, "call _printf"], [55, "mov eax, 0FFFFFFEAh"], [56, "jmp short locret_4029E9"], [57, "mov eax, 0"], [58, "leave"], [59, "retn"]], "data_dep": [[6, 5], [7, 3], [9, 6], [10, 7], [12, 4], [13, 11], [13, 12], [14, 5], [15, 14], [15, 13], [16, 15], [17, 16], [18, 5], [19, 18], [19, 13], [20, 19], [21, 20], [23, 13], [23, 22], [24, 5], [25, 13], [25, 24], [26, 25], [27, 26], [28, 27], [28, 23], [29, 13], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [35, 13], [35, 34], [36, 5], [37, 36], [37, 13], [38, 37], [39, 38], [40, 35], [40, 39], [41, 40], [41, 13], [42, 41], [43, 42], [44, 43], [45, 44], [49, 5], [50, 3], [51, 50], [59, 55], [59, 57]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909_8a9418749d153179dfd02cc7191e2f3e0d68e604e1b8ffdf88fa320496ca6909.jsonl.gz", "strip_func_name": "sub_40291A", "query": "\n\n\n__int64 __fastcall sub_40291A(const char *a1, unsigned __int64 *a2)\n{\nconst char *v2; // rcx\nchar *endptr; // [rsp+18h] [rbp-8h] BYREF\n\nendptr = 0LL;\n*a2 = strtoull(a1, &endptr, 0);\nif ( !*endptr || *endptr == 10 || ((*__ctype_b_loc())[*endptr] & 1) != 0 )\nreturn 0LL;\nif ( ((*__ctype_b_loc())[*endptr] & 1) != 0 )\nv2 = \"true\";\nelse\nv2 = \"false\";\nprintf(\"Error:something not right%s %s %s\", a1, endptr, v2);\nreturn 4294967274LL;\n}\n\n\n\nQ:[a1,a2,endptr,sub_40291A,]", "hints": "[]", "response": "{'a1': 's', 'a2': 'v', 'endptr': 'p', 'sub_40291A': 'arg_read_long_uint'}"} | [
[
0.8451392650604248,
0.7651194334030151,
0.6928408145904541,
0.6859663128852844,
0.6705732345581055,
0.6662485003471375,
0.6658996343612671,
0.6648241877555847,
0.6647346019744873,
0.6586506962776184,
0.658633291721344,
0.6561552286148071,
0.6558540463447571,
0.6555957198143005,
0.6543639898300171,
0.6538816094398499,
0.6404600739479065,
0.639473557472229,
0.6390172839164734,
0.636826753616333
],
[
73522,
79902,
114979,
37129,
41300,
54459,
117620,
93890,
213995,
111122,
156613,
104251,
158378,
68781,
23801,
135669,
92245,
220512,
148186,
168482
]
] |
|
ircode_register_dump | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | void ircode_register_dump (ircode_t *code) {
uint32_t n = (uint32_t)marray_size(code->registers);
if (n == 0) printf("EMPTY\n");
for (uint32_t i=0; i<n; ++i) {
uint32_t value = marray_get(code->registers, i);
printf("[%d]\t%d\n", i, value);
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41EC9C", "function_addr": 4320412, "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 rax, [rbp+var_18]"], [5, "mov rax, [rax+260h]"], [6, "mov [rbp+var_8], eax"], [7, "cmp [rbp+var_8], 0"], [8, "jnz short loc_41ECC8"], [9, "lea rdi, aEmpty"], [10, "call _puts"], [11, "mov [rbp+var_4], 0"], [12, "jmp short loc_41ED08"], [13, "mov rax, [rbp+var_18]"], [14, "mov rdx, [rax+270h]"], [15, "mov eax, [rbp+var_4]"], [16, "shl rax, 2"], [17, "add rax, rdx"], [18, "mov eax, [rax]"], [19, "mov [rbp+var_C], eax"], [20, "mov edx, [rbp+var_C]"], [21, "mov eax, [rbp+var_4]"], [22, "mov esi, eax"], [23, "lea rdi, aDD"], [24, "mov eax, 0"], [25, "call _printf"], [26, "add [rbp+var_4], 1"], [27, "mov eax, [rbp+var_4]"], [28, "cmp eax, [rbp+var_8]"], [29, "jb short loc_41ECD1"], [30, "nop"], [31, "nop"], [32, "leave"], [33, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [13, 3], [14, 13], [15, 11], [15, 26], [16, 15], [17, 14], [17, 16], [18, 17], [19, 18], [20, 19], [21, 11], [21, 26], [22, 21], [23, 9], [23, 23], [26, 11], [26, 26], [27, 11], [27, 26], [28, 6], [28, 27], [29, 28], [33, 27]]}
| {"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_41EC9C", "query": "\n\n\n__int64 __fastcall sub_41EC9C(__int64 a1)\n{\n__int64 result; // rax\nunsigned int v2; // [rsp+18h] [rbp-8h]\nunsigned int i; // [rsp+1Ch] [rbp-4h]\n\nv2 = *(_QWORD *)(a1 + 608);\nif ( !v2 )\nputs(\"EMPTY\");\nfor ( i = 0; ; ++i )\n{\nresult = i;\nif ( i >= v2 )\nbreak;\nprintf(\"[%d]\\t%d\\n\", i, *(unsigned int *)(*(_QWORD *)(a1 + 624) + 4LL * i));\n}\nreturn result;\n}\n\n\n\nQ:[a1,v2,sub_41EC9C,]", "hints": "[]", "response": "{'a1': 'code', 'v2': 'n', 'sub_41EC9C': 'ircode_register_dump'}"} | [
[
0.827232837677002,
0.8213942646980286,
0.810757577419281,
0.8025240302085876,
0.793630838394165,
0.7917545437812805,
0.7718961834907532,
0.7703197002410889,
0.7597488164901733,
0.7500068545341492,
0.741722047328949,
0.7396202087402344,
0.7279229164123535,
0.7232418060302734,
0.7222769260406494,
0.7195339798927307,
0.7173739671707153,
0.7168194055557251,
0.7139792442321777,
0.7128173112869263
],
[
28221,
208236,
32844,
222999,
103538,
153380,
241184,
112890,
106306,
163110,
238064,
63145,
52548,
49761,
250872,
204092,
154628,
191152,
71833,
218885
]
] |
|
od_decode_compute_pred | bb132724d92d1dba437605e60515d04c8a2606ed4e59a991f46535ede67578fb | xiph | daala | NA | static void od_decode_compute_pred(daala_dec_ctx *dec, od_mb_dec_ctx *ctx,
od_coeff *pred, const od_coeff *d, int bs, int pli, int bx, int by) {
int n;
int xdec;
int w;
int bo;
int y;
int x;
OD_ASSERT(bs >= 0 && bs < OD_NBSIZES);
n = 1 << (bs + OD_LOG_BSIZE0);
xdec = dec->state.info.plane_info[pli].xdec;
w = dec->state.frame_width >> xdec;
bo = (by << OD_LOG_BSIZE0)*w + (bx << OD_LOG_BSIZE0);
/*We never use tf on the chroma planes, but if we do it will blow up, which
is better than always using luma's tf.*/
if (ctx->is_keyframe) {
if (pli == 0 || OD_DISABLE_CFL || ctx->use_haar_wavelet) {
OD_CLEAR(pred, n*n);
if (pli == 0 && !ctx->use_haar_wavelet) {
od_hv_intra_pred(pred, d, w, bx, by, dec->state.bsize,
dec->state.bstride, bs);
}
}
else {
od_coeff *l;
l = ctx->l;
for (y = 0; y < n; y++) {
for (x = 0; x < n; x++) {
pred[n*y + x] = l[n*y + x];
}
}
}
}
else {
od_coeff *md;
md = ctx->md;
for (y = 0; y < n; y++) {
for (x = 0; x < n; x++) {
pred[n*y + x] = md[bo + y*w + x];
}
}
}
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403E17", "function_addr": 4210199, "binary_name": "bb132724d92d1dba437605e60515d04c8a2606ed4e59a991f46535ede67578fb.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+s], rdx"], [6, "mov [rbp+var_50], rcx"], [7, "mov [rbp+var_54], r8d"], [8, "mov [rbp+var_58], r9d"], [9, "cmp [rbp+var_54], 0"], [10, "js short loc_403E43"], [11, "cmp [rbp+var_54], 4"], [12, "jle short loc_403E5B"], [13, "mov edx, 114h"], [14, "lea rsi, aSrcDecodeC"], [15, "lea rdi, aAssertionFaile_2"], [16, "call sub_40EBE4"], [17, "mov eax, [rbp+var_54]"], [18, "add eax, 2"], [19, "mov edx, 1"], [20, "mov ecx, eax"], [21, "shl edx, cl"], [22, "mov eax, edx"], [23, "mov [rbp+var_C], eax"], [24, "mov rax, [rbp+var_38]"], [25, "mov edx, [rbp+var_58]"], [26, "movsxd rdx, edx"], [27, "add rdx, 2EE8h"], [28, "movzx eax, byte ptr [rax+rdx*2+0Ch]"], [29, "movzx eax, al"], [30, "mov [rbp+var_10], eax"], [31, "mov rax, [rbp+var_38]"], [32, "mov edx, [rax+5EFCh]"], [33, "mov eax, [rbp+var_10]"], [34, "mov ecx, eax"], [35, "sar edx, cl"], [36, "mov eax, edx"], [37, "mov [rbp+var_14], eax"], [38, "mov eax, [rbp+arg_8]"], [39, "shl eax, 2"], [40, "imul eax, [rbp+var_14]"], [41, "mov edx, eax"], [42, "mov eax, [rbp+arg_0]"], [43, "shl eax, 2"], [44, "add eax, edx"], [45, "mov [rbp+var_18], eax"], [46, "mov rax, [rbp+var_40]"], [47, "mov eax, [rax+28h]"], [48, "test eax, eax"], [49, "jz loc_403FCD"], [50, "cmp [rbp+var_58], 0"], [51, "jz short loc_403ED8"], [52, "mov rax, [rbp+var_40]"], [53, "mov eax, [rax+38h]"], [54, "test eax, eax"], [55, "jz short loc_403F4F"], [56, "mov eax, [rbp+var_C]"], [57, "imul eax, eax"], [58, "cdqe"], [59, "lea rdx, ds:0[rax*4]"], [60, "mov rax, [rbp+s]"], [61, "mov esi, 0"], [62, "mov rdi, rax"], [63, "call _memset"], [64, "cmp [rbp+var_58], 0"], [65, "jnz loc_40404D"], [66, "mov rax, [rbp+var_40]"], [67, "mov eax, [rax+38h]"], [68, "test eax, eax"], [69, "jnz loc_40404D"], [70, "mov rax, [rbp+var_38]"], [71, "mov ecx, [rax+6118h]"], [72, "mov rax, [rbp+var_38]"], [73, "mov r9, [rax+6110h]"], [74, "mov r8d, [rbp+arg_8]"], [75, "mov edx, [rbp+var_14]"], [76, "mov rsi, [rbp+var_50]"], [77, "mov rax, [rbp+s]"], [78, "mov edi, [rbp+var_54]"], [79, "push rdi"], [80, "push rcx"], [81, "mov ecx, [rbp+arg_0]"], [82, "mov rdi, rax"], [83, "call sub_40F763"], [84, "add rsp, 10h"], [85, "jmp loc_40404D"], [86, "mov rax, [rbp+var_40]"], [87, "mov rax, [rax+20h]"], [88, "mov [rbp+var_28], rax"], [89, "mov [rbp+var_4], 0"], [90, "jmp short loc_403FC0"], [91, "mov [rbp+var_8], 0"], [92, "jmp short loc_403FB4"], [93, "mov eax, [rbp+var_C]"], [94, "imul eax, [rbp+var_4]"], [95, "mov edx, eax"], [96, "mov eax, [rbp+var_8]"], [97, "add eax, edx"], [98, "cdqe"], [99, "lea rdx, ds:0[rax*4]"], [100, "mov rax, [rbp+var_28]"], [101, "lea rcx, [rdx+rax]"], [102, "mov eax, [rbp+var_C]"], [103, "imul eax, [rbp+var_4]"], [104, "mov edx, eax"], [105, "mov eax, [rbp+var_8]"], [106, "add eax, edx"], [107, "cdqe"], [108, "lea rdx, ds:0[rax*4]"], [109, "mov rax, [rbp+s]"], [110, "add rdx, rax"], [111, "mov eax, [rcx]"], [112, "mov [rdx], eax"], [113, "add [rbp+var_8], 1"], [114, "mov eax, [rbp+var_8]"], [115, "cmp eax, [rbp+var_C]"], [116, "jl short loc_403F6D"], [117, "add [rbp+var_4], 1"], [118, "mov eax, [rbp+var_4]"], [119, "cmp eax, [rbp+var_C]"], [120, "jl short loc_403F64"], [121, "jmp loc_40404E"], [122, "mov rax, [rbp+var_40]"], [123, "mov rax, [rax+10h]"], [124, "mov [rbp+var_20], rax"], [125, "mov [rbp+var_4], 0"], [126, "jmp short loc_404043"], [127, "mov [rbp+var_8], 0"], [128, "jmp short loc_404037"], [129, "mov eax, [rbp+var_4]"], [130, "imul eax, [rbp+var_14]"], [131, "mov edx, eax"], [132, "mov eax, [rbp+var_18]"], [133, "add edx, eax"], [134, "mov eax, [rbp+var_8]"], [135, "add eax, edx"], [136, "cdqe"], [137, "lea rdx, ds:0[rax*4]"], [138, "mov rax, [rbp+var_20]"], [139, "lea rcx, [rdx+rax]"], [140, "mov eax, [rbp+var_C]"], [141, "imul eax, [rbp+var_4]"], [142, "mov edx, eax"], [143, "mov eax, [rbp+var_8]"], [144, "add eax, edx"], [145, "cdqe"], [146, "lea rdx, ds:0[rax*4]"], [147, "mov rax, [rbp+s]"], [148, "add rdx, rax"], [149, "mov eax, [rcx]"], [150, "mov [rdx], eax"], [151, "add [rbp+var_8], 1"], [152, "mov eax, [rbp+var_8]"], [153, "cmp eax, [rbp+var_C]"], [154, "jl short loc_403FEB"], [155, "add [rbp+var_4], 1"], [156, "mov eax, [rbp+var_4]"], [157, "cmp eax, [rbp+var_C]"], [158, "jl short loc_403FE2"], [159, "jmp short loc_40404E"], [160, "nop"], [161, "nop"], [162, "leave"], [163, "retn"]], "data_dep": [[9, 7], [10, 9], [11, 7], [12, 11], [17, 7], [18, 17], [20, 18], [21, 20], [21, 19], [22, 21], [23, 22], [24, 3], [25, 8], [26, 25], [27, 26], [28, 24], [29, 28], [30, 29], [31, 3], [32, 31], [33, 30], [34, 33], [35, 32], [35, 34], [36, 35], [37, 36], [39, 38], [40, 37], [40, 39], [41, 40], [43, 42], [44, 41], [44, 43], [45, 44], [46, 4], [47, 46], [48, 47], [49, 48], [50, 8], [51, 50], [52, 4], [53, 52], [54, 53], [55, 54], [56, 23], [57, 56], [59, 41], [60, 5], [62, 60], [64, 8], [65, 64], [66, 4], [67, 66], [68, 67], [69, 68], [70, 3], [71, 70], [72, 3], [73, 72], [75, 37], [76, 6], [77, 5], [78, 7], [79, 78], [80, 71], [82, 77], [84, 2], [86, 4], [87, 86], [88, 87], [93, 23], [94, 89], [94, 93], [94, 117], [95, 94], [96, 113], [96, 91], [97, 95], [97, 96], [99, 95], [100, 88], [101, 101], [101, 112], [101, 34], [101, 100], [102, 23], [103, 102], [103, 117], [103, 89], [104, 103], [105, 113], [105, 91], [106, 104], [106, 105], [108, 104], [109, 5], [110, 109], [110, 108], [111, 101], [111, 112], [112, 111], [112, 110], [113, 91], [113, 113], [114, 113], [114, 91], [115, 23], [115, 114], [116, 115], [117, 117], [117, 89], [118, 117], [118, 89], [119, 23], [119, 118], [120, 119], [122, 4], [123, 122], [124, 123], [129, 155], [129, 125], [130, 37], [130, 129], [131, 130], [132, 45], [133, 132], [133, 131], [134, 151], [134, 127], [135, 133], [135, 134], [137, 133], [138, 124], [139, 34], [139, 139], [139, 150], [139, 138], [140, 23], [141, 140], [141, 155], [141, 125], [142, 141], [143, 151], [143, 127], [144, 143], [144, 142], [146, 142], [147, 5], [148, 147], [148, 146], [149, 139], [149, 150], [150, 148], [150, 149], [151, 127], [151, 151], [152, 127], [152, 151], [153, 152], [153, 23], [154, 153], [155, 155], [155, 125], [156, 155], [156, 125], [157, 156], [157, 23], [158, 157], [163, 68], [163, 118], [163, 63], [163, 83], [163, 156]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/bb132724d92d1dba437605e60515d04c8a2606ed4e59a991f46535ede67578fb_bb132724d92d1dba437605e60515d04c8a2606ed4e59a991f46535ede67578fb.jsonl.gz", "strip_func_name": "sub_403E17", "query": "\n\n\n__int64 __fastcall sub_403E17(__int64 a1, __int64 a2, _DWORD *a3, int a4, int a5, int a6, int a7, int a8)\n{\n__int64 result; // rax\nint s; // [rsp+18h] [rbp-48h]\n__int64 v13; // [rsp+38h] [rbp-28h]\n__int64 v14; // [rsp+40h] [rbp-20h]\nint v15; // [rsp+4Ch] [rbp-14h]\nint v16; // [rsp+54h] [rbp-Ch]\nint j; // [rsp+58h] [rbp-8h]\nint l; // [rsp+58h] [rbp-8h]\nint i; // [rsp+5Ch] [rbp-4h]\nint k; // [rsp+5Ch] [rbp-4h]\n\ns = (int)a3;\nif ( a5 < 0 || a5 > 4 )\nsub_40EBE4(\"assertion failed: bs >= 0 && bs < OD_NBSIZES\", \"../src/decode.c\", 276LL);\nv16 = 1 << (a5 + 2);\nv15 = *(int *)(a1 + 24316) >> *(_BYTE *)(a1 + 2 * (a6 + 12008LL) + 12);\nif ( *(_DWORD *)(a2 + 40) )\n{\nif ( a6 && !*(_DWORD *)(a2 + 56) )\n{\nv13 = *(_QWORD *)(a2 + 32);\nfor ( i = 0; ; ++i )\n{\nresult = (unsigned int)i;\nif ( i >= v16 )\nbreak;\nfor ( j = 0; j < v16; ++j )\na3[i * v16 + j] = *(_DWORD *)(4LL * (i * v16 + j) + v13);\n}\n}\nelse\n{\nresult = (__int64)memset(a3, 0, 4LL * v16 * v16);\nif ( !a6 )\n{\nresult = *(unsigned int *)(a2 + 56);\nif ( !(_DWORD)result )\nresult = sub_40F763(s, a4, v15, a7, a8, *(_QWORD *)(a1 + 24848), *(_DWORD *)(a1 + 24856), a5);\n}\n}\n}\nelse\n{\nv14 = *(_QWORD *)(a2 + 16);\nfor ( k = 0; ; ++k )\n{\nresult = (unsigned int)k;\nif ( k >= v16 )\nbreak;\nfor ( l = 0; l < v16; ++l )\na3[k * v16 + l] = *(_DWORD *)(4LL * (v15 * 4 * a8 + 4 * a7 + v15 * k + l) + v14);\n}\n}\nreturn result;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,a8,v13,v14,v15,v16,j,k,sub_403E17,sub_40EBE4,sub_40F763,]", "hints": "[]", "response": "{'a3': 'pred', 'a4': 'd', 'a1': 'dec', 'a2': 'ctx', 'a5': 'bs', 'a6': 'pli', 'a7': 'bx_0', 'a8': 'by', 'v13': 'l', 'v14': 'md', 'v15': 'w', 'v16': 'n', 'j': 'xa', 'k': 'ya', 'sub_403E17': 'od_decode_compute_pred', 'sub_40EBE4': 'od_fatal_impl', 'sub_40F763': 'od_hv_intra_pred'}"} | [
[
0.8794926404953003,
0.8066531419754028,
0.7857984304428101,
0.7751768827438354,
0.7705503702163696,
0.7703312635421753,
0.7672123908996582,
0.76544189453125,
0.7601736783981323,
0.7601736783981323,
0.7560781240463257,
0.7552696466445923,
0.7520860433578491,
0.7395637035369873,
0.7389376163482666,
0.7360378503799438,
0.7353020906448364,
0.7342184782028198,
0.733983039855957,
0.7330702543258667
],
[
194635,
175289,
121246,
206422,
92348,
203997,
23184,
62812,
94356,
49453,
8168,
208186,
79046,
104450,
212000,
121341,
105479,
32999,
238077,
29584
]
] |
|
amt_verify_code_versions | e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a | mandiant | rvmi | NA | static uint32_t amt_verify_code_versions(const struct amt_host_if_resp_header *resp)
{
uint32_t status = AMT_STATUS_SUCCESS;
struct amt_code_versions *code_ver;
size_t code_ver_len;
uint32_t ver_type_cnt;
uint32_t len;
uint32_t i;
code_ver = (struct amt_code_versions *)resp->data;
/* length - sizeof(status) */
code_ver_len = resp->header.length - sizeof(uint32_t);
ver_type_cnt = code_ver_len -
sizeof(code_ver->bios) -
sizeof(code_ver->count);
if (code_ver->count != ver_type_cnt / sizeof(struct amt_version_type)) {
status = AMT_STATUS_INTERNAL_ERROR;
goto out;
}
for (i = 0; i < code_ver->count; i++) {
len = code_ver->versions[i].description.length;
if (len > AMT_UNICODE_STRING_LEN) {
status = AMT_STATUS_INTERNAL_ERROR;
goto out;
}
len = code_ver->versions[i].version.length;
if (code_ver->versions[i].version.string[len] != '\0' ||
len != strlen(code_ver->versions[i].version.string)) {
status = AMT_STATUS_INTERNAL_ERROR;
goto out;
}
}
out:
return status;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40184B", "function_addr": 4200523, "binary_name": "e74dc773869e6562db72053aa1eca919b8f1ca10cf7be221eed2ac9cea261c2a.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "sub rsp, 38h"], [4, "mov [rbp+var_38], rdi"], [5, "mov [rbp+var_14], 0"], [6, "mov rax, [rbp+var_38]"], [7, "add rax, 10h"], [8, "mov [rbp+var_20], rax"], [9, "mov rax, [rbp+var_38]"], [10, "mov eax, [rax+8]"], [11, "mov eax, eax"], [12, "sub rax, 4"], [13, "mov [rbp+var_28], rax"], [14, "mov rax, [rbp+var_28]"], [15, "sub eax, 45h "], [16, "mov [rbp+var_2C], eax"], [17, "mov rax, [rbp+var_20]"], [18, "mov eax, [rax+41h]"], [19, "mov edx, [rbp+var_2C]"], [20, "mov ecx, edx"], [21, "mov edx, 0BA2E8BA3h"], [22, "imul rdx, rcx"], [23, "shr rdx, 20h"], [24, "shr edx, 5"], [25, "cmp eax, edx"], [26, "jz short loc_4018B2"], [27, "mov [rbp+var_14], 1"], [28, "jmp loc_4019AB"], [29, "mov [rbp+var_18], 0"], [30, "jmp loc_40199A"], [31, "mov rcx, [rbp+var_20]"], [32, "mov edx, [rbp+var_18]"], [33, "mov rax, rdx"], [34, "shl rax, 2"], [35, "add rax, rdx"], [36, "add rax, rax"], [37, "add rax, rdx"], [38, "shl rax, 2"], [39, "add rax, rcx"], [40, "add rax, 40h "], [41, "movzx eax, word ptr [rax+5]"], [42, "movzx eax, ax"], [43, "mov [rbp+var_30], eax"], [44, "cmp [rbp+var_30], 14h"], [45, "jbe short loc_4018FC"], [46, "mov [rbp+var_14], 1"], [47, "jmp loc_4019AB"], [48, "mov rcx, [rbp+var_20]"], [49, "mov edx, [rbp+var_18]"], [50, "mov rax, rdx"], [51, "shl rax, 2"], [52, "add rax, rdx"], [53, "add rax, rax"], [54, "add rax, rdx"], [55, "shl rax, 2"], [56, "add rax, rcx"], [57, "add rax, 50h "], [58, "movzx eax, word ptr [rax+0Bh]"], [59, "movzx eax, ax"], [60, "mov [rbp+var_30], eax"], [61, "mov rsi, [rbp+var_20]"], [62, "mov ecx, [rbp+var_30]"], [63, "mov edx, [rbp+var_18]"], [64, "mov rax, rdx"], [65, "shl rax, 2"], [66, "add rax, rdx"], [67, "add rax, rax"], [68, "add rax, rdx"], [69, "shl rax, 2"], [70, "add rax, rsi"], [71, "add rax, rcx"], [72, "add rax, 5Dh "], [73, "movzx eax, byte ptr [rax]"], [74, "test al, al"], [75, "jnz short loc_40198D"], [76, "mov ebx, [rbp+var_30]"], [77, "mov edx, [rbp+var_18]"], [78, "mov rax, rdx"], [79, "shl rax, 2"], [80, "add rax, rdx"], [81, "add rax, rax"], [82, "add rax, rdx"], [83, "shl rax, 2"], [84, "lea rdx, [rax+50h]"], [85, "mov rax, [rbp+var_20]"], [86, "add rax, rdx"], [87, "add rax, 0Dh"], [88, "mov rdi, rax"], [89, "call _strlen"], [90, "cmp rbx, rax"], [91, "jz short loc_401996"], [92, "mov [rbp+var_14], 1"], [93, "jmp short loc_4019AB"], [94, "add [rbp+var_18], 1"], [95, "mov rax, [rbp+var_20]"], [96, "mov eax, [rax+41h]"], [97, "cmp [rbp+var_18], eax"], [98, "jb loc_4018BE"], [99, "nop"], [100, "mov eax, [rbp+var_14]"], [101, "mov rbx, [rbp+var_8]"], [102, "leave"], [103, "retn"]], "data_dep": [[6, 4], [7, 6], [8, 7], [9, 4], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 8], [18, 17], [19, 16], [20, 19], [22, 21], [22, 20], [23, 22], [24, 23], [25, 18], [25, 24], [26, 25], [31, 8], [32, 94], [32, 29], [33, 32], [34, 33], [35, 32], [35, 34], [36, 35], [37, 32], [37, 36], [38, 37], [39, 38], [39, 31], [40, 39], [41, 40], [42, 41], [43, 42], [44, 43], [45, 44], [48, 8], [49, 29], [49, 94], [50, 49], [51, 50], [52, 49], [52, 51], [53, 52], [54, 49], [54, 53], [55, 54], [56, 55], [56, 48], [57, 56], [58, 57], [59, 58], [60, 59], [61, 8], [62, 60], [63, 29], [63, 94], [64, 63], [65, 64], [66, 63], [66, 65], [67, 66], [68, 63], [68, 67], [69, 68], [70, 61], [70, 69], [71, 62], [71, 70], [72, 71], [73, 72], [74, 73], [75, 74], [76, 60], [77, 94], [77, 29], [78, 77], [79, 78], [80, 77], [80, 79], [81, 80], [82, 81], [82, 77], [83, 82], [84, 77], [84, 83], [85, 8], [86, 85], [86, 84], [87, 86], [88, 87], [90, 76], [90, 89], [91, 90], [94, 94], [94, 29], [95, 8], [96, 95], [97, 94], [97, 96], [97, 29], [98, 97], [100, 92], [100, 46], [100, 5], [100, 27], [103, 100]]}
| {"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_40184B", "query": "\n\n\n__int64 __fastcall sub_40184B(__int64 a1)\n{\nint v2; // [rsp+10h] [rbp-30h]\n__int64 v3; // [rsp+20h] [rbp-20h]\nunsigned int i; // [rsp+28h] [rbp-18h]\nunsigned int v5; // [rsp+2Ch] [rbp-14h]\n\nv5 = 0;\nv3 = a1 + 16;\nif ( *(_DWORD *)(a1 + 81) != (*(_DWORD *)(a1 + 8) - 73) / 0x2Cu )\nreturn 1;\nfor ( i = 0; i < *(_DWORD *)(a1 + 81); ++i )\n{\nif ( *(unsigned __int16 *)(v3 + 44LL * i + 69) > 0x14u )\nreturn 1;\nif ( !*(_BYTE *)(*(unsigned __int16 *)(v3 + 44LL * i + 91) + v3 + 44LL * i + 93) )\n{\nv2 = *(unsigned __int16 *)(v3 + 44LL * i + 91);\nif ( v2 == strlen((const char *)(44LL * i + 80 + v3 + 13)) )\ncontinue;\n}\nreturn 1;\n}\nreturn v5;\n}\n\n\n\nQ:[a1,v2,v3,v5,sub_40184B,]", "hints": "[]", "response": "{'a1': 'resp', 'v2': 'len', 'v3': 'code_ver', 'v5': 'status', 'sub_40184B': 'amt_verify_code_versions'}"} | [
[
0.72721266746521,
0.7254958748817444,
0.7233462333679199,
0.7158886790275574,
0.715721607208252,
0.712040901184082,
0.7091140151023865,
0.7091140151023865,
0.7030613422393799,
0.6983777284622192,
0.6957850456237793,
0.6895917654037476,
0.6881684064865112,
0.6868178248405457,
0.6851829290390015,
0.6798021197319031,
0.6792739033699036,
0.6791426539421082,
0.6785376071929932,
0.6735571622848511
],
[
247544,
155960,
158764,
116830,
164927,
218334,
169737,
203265,
84270,
144571,
260754,
237201,
248570,
84612,
222578,
163223,
128353,
183817,
197824,
63443
]
] |
|
gravity_lexer_token | b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97 | marcobambini | gravity | NA | gtoken_s gravity_lexer_token (gravity_lexer_t *lexer) {
return lexer->token;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42149F", "function_addr": 4330655, "binary_name": "b2b6239f41efcd906cff8a967b6680bd1e1b9f4105564fc6f50ab0c84f5f6e97.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push rbx"], [3, "mov [rbp+var_10], rdi"], [4, "mov [rbp+var_18], rsi"], [5, "mov rax, [rbp+var_10]"], [6, "mov rdx, [rbp+var_18]"], [7, "mov rcx, [rdx+20h]"], [8, "mov rbx, [rdx+28h]"], [9, "mov [rax], rcx"], [10, "mov [rax+8], rbx"], [11, "mov rcx, [rdx+30h]"], [12, "mov rbx, [rdx+38h]"], [13, "mov [rax+10h], rcx"], [14, "mov [rax+18h], rbx"], [15, "mov rdx, [rdx+40h]"], [16, "mov [rax+20h], rdx"], [17, "mov rax, [rbp+var_10]"], [18, "mov rbx, [rbp+var_8]"], [19, "leave"], [20, "retn"]], "data_dep": [[5, 3], [6, 4], [7, 6], [8, 6], [9, 5], [9, 7], [10, 5], [10, 8], [11, 10], [11, 6], [12, 10], [12, 6], [13, 5], [13, 11], [14, 12], [14, 5], [15, 14], [15, 6], [16, 15], [16, 5], [17, 3], [20, 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_42149F", "query": "\n\n\n_QWORD *__fastcall sub_42149F(_QWORD *a1, _QWORD *a2)\n{\n__int64 v2; // rbx\n__int64 v3; // rbx\n\nv2 = a2[5];\n*a1 = a2[4];\na1[1] = v2;\nv3 = a2[7];\na1[2] = a2[6];\na1[3] = v3;\na1[4] = a2[8];\nreturn a1;\n}\n\n\n\nQ:[a1,a2,sub_42149F,]", "hints": "[]", "response": "{'a1': 'retstr', 'a2': 'lexer', 'sub_42149F': 'gravity_lexer_token'}"} | [
[
0.8265736103057861,
0.8144825100898743,
0.8114621639251709,
0.7946599125862122,
0.7810524106025696,
0.7794344425201416,
0.7775076627731323,
0.7770691514015198,
0.7759205102920532,
0.7712090015411377,
0.7623737454414368,
0.7575523853302002,
0.7557783126831055,
0.7528368830680847,
0.7508436441421509,
0.7462716698646545,
0.7450124621391296,
0.7436858415603638,
0.7417634725570679,
0.7352798581123352
],
[
136046,
136964,
59187,
242875,
58608,
82325,
128407,
92127,
175566,
112462,
179951,
142827,
28117,
253670,
10756,
76661,
93417,
32932,
205360,
190836
]
] |
|
huffman_decode_step | 219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea | rockcarry | ffjpeg | NA | int huffman_decode_step(HUFCODEC *phc)
{
int bit;
int code = 0;
int len = 0;
int idx = 0;
/* Ч */
if (!phc || !phc->input) return EOF;
/* ȡ */
while (1) {
bit = bitstr_getb(phc->input);
if ( bit == EOF) return EOF;
// printf("%d, first = %d, len = %d\n", bit ? 1 : 0, phc->first[len], len);
code <<= 1; code |= bit;
if (code - phc->first[len] < phc->huftab[len]) break;
if (++len == MAX_HUFFMAN_CODE_LEN) return EOF;
}
idx = phc->index[len] + (code - phc->first[len]);
// printf("get code:%c len:%d, idx:%d\n\n", phc->huftab[idx], len, idx);
return idx < MAX_HUFFMAN_CODE_LEN + 256 ? phc->huftab[idx] : EOF;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407031", "function_addr": 4223025, "binary_name": "219d044432346d82cdbd95b5bb82e17450f6c9f74e9c229f456806fc14e785ea.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_4], 0"], [5, "mov [rbp+var_8], 0"], [6, "mov [rbp+var_C], 0"], [7, "cmp [rbp+var_18], 0"], [8, "jz short loc_407069"], [9, "mov rax, [rbp+var_18]"], [10, "mov rax, [rax+1590h]"], [11, "test rax, rax"], [12, "jnz short loc_407073"], [13, "mov eax, 0FFFFFFFFh"], [14, "jmp locret_40712C"], [15, "mov rax, [rbp+var_18]"], [16, "mov rax, [rax+1590h]"], [17, "mov rdi, rax"], [18, "call sub_406150"], [19, "mov [rbp+var_10], eax"], [20, "cmp [rbp+var_10], 0FFFFFFFFh"], [21, "jnz short loc_407099"], [22, "mov eax, 0FFFFFFFFh"], [23, "jmp locret_40712C"], [24, "shl [rbp+var_4], 1"], [25, "mov eax, [rbp+var_10]"], [26, "or [rbp+var_4], eax"], [27, "mov rax, [rbp+var_18]"], [28, "mov edx, [rbp+var_8]"], [29, "movsxd rdx, edx"], [30, "add rdx, 44h "], [31, "mov edx, [rax+rdx*4]"], [32, "mov eax, [rbp+var_4]"], [33, "sub eax, edx"], [34, "mov ecx, eax"], [35, "mov rdx, [rbp+var_18]"], [36, "mov eax, [rbp+var_8]"], [37, "cdqe"], [38, "movzx eax, byte ptr [rdx+rax]"], [39, "movzx eax, al"], [40, "cmp ecx, eax"], [41, "jl short loc_4070DF"], [42, "add [rbp+var_8], 1"], [43, "cmp [rbp+var_8], 10h"], [44, "jnz short loc_407073"], [45, "mov eax, 0FFFFFFFFh"], [46, "jmp short locret_40712C"], [47, "nop"], [48, "mov rax, [rbp+var_18]"], [49, "mov edx, [rbp+var_8]"], [50, "movsxd rdx, edx"], [51, "add rdx, 54h "], [52, "mov ecx, [rax+rdx*4]"], [53, "mov rax, [rbp+var_18]"], [54, "mov edx, [rbp+var_8]"], [55, "movsxd rdx, edx"], [56, "add rdx, 44h "], [57, "mov edx, [rax+rdx*4]"], [58, "mov eax, [rbp+var_4]"], [59, "sub eax, edx"], [60, "add eax, ecx"], [61, "mov [rbp+var_C], eax"], [62, "cmp [rbp+var_C], 10Fh"], [63, "jg short loc_407127"], [64, "mov rdx, [rbp+var_18]"], [65, "mov eax, [rbp+var_C]"], [66, "cdqe"], [67, "movzx eax, byte ptr [rdx+rax]"], [68, "movzx eax, al"], [69, "jmp short locret_40712C"], [70, "mov eax, 0FFFFFFFFh"], [71, "leave"], [72, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 3], [10, 9], [11, 10], [12, 11], [15, 3], [16, 15], [17, 16], [19, 18], [20, 19], [21, 20], [24, 26], [24, 4], [25, 19], [26, 24], [26, 25], [27, 3], [28, 42], [28, 5], [29, 28], [30, 29], [31, 27], [32, 26], [33, 32], [33, 31], [34, 33], [35, 3], [36, 42], [36, 5], [38, 36], [39, 38], [40, 34], [40, 39], [41, 40], [42, 5], [42, 42], [43, 42], [44, 43], [48, 3], [49, 42], [49, 5], [50, 49], [51, 50], [52, 48], [53, 3], [54, 42], [54, 5], [55, 54], [56, 55], [57, 53], [58, 26], [59, 58], [59, 57], [60, 59], [60, 52], [61, 60], [62, 61], [63, 62], [64, 3], [65, 61], [67, 65], [68, 67], [72, 45], [72, 68], [72, 13], [72, 22], [72, 70]]}
| {"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_407031", "query": "\n\n\n__int64 __fastcall sub_407031(__int64 a1)\n{\n__int64 result; // rax\nint v2; // [rsp+10h] [rbp-10h]\nint v3; // [rsp+14h] [rbp-Ch]\nint v4; // [rsp+18h] [rbp-8h]\nint v5; // [rsp+1Ch] [rbp-4h]\n\nv5 = 0;\nv4 = 0;\nif ( !a1 || !*(_QWORD *)(a1 + 5520) )\nreturn 0xFFFFFFFFLL;\nwhile ( 1 )\n{\nv2 = sub_406150(*(_DWORD **)(a1 + 5520));\nif ( v2 == -1 )\nreturn 0xFFFFFFFFLL;\nv5 = v2 | (2 * v5);\nif ( v5 - *(_DWORD *)(a1 + 4 * (v4 + 68LL)) < *(unsigned __int8 *)(a1 + v4) )\nbreak;\nif ( ++v4 == 16 )\nreturn 0xFFFFFFFFLL;\n}\nv3 = *(_DWORD *)(a1 + 4 * (v4 + 84LL)) + v5 - *(_DWORD *)(a1 + 4 * (v4 + 68LL));\nif ( v3 > 271 )\nresult = 0xFFFFFFFFLL;\nelse\nresult = *(unsigned __int8 *)(a1 + v3);\nreturn result;\n}\n\n\n\nQ:[a1,v2,v3,v4,v5,sub_407031,sub_406150,]", "hints": "[]", "response": "{'a1': 'phc', 'v2': 'bit', 'v3': 'idx', 'v4': 'len', 'v5': 'code', 'sub_407031': 'huffman_decode_step', 'sub_406150': 'bitstr_getb'}"} | [
[
0.8083339929580688,
0.781618595123291,
0.7650206089019775,
0.7644426822662354,
0.7625120878219604,
0.7608233690261841,
0.7595316171646118,
0.7549556493759155,
0.752744197845459,
0.7493165135383606,
0.7424445152282715,
0.736485481262207,
0.734215497970581,
0.7314153909683228,
0.7276198267936707,
0.72747403383255,
0.7249078154563904,
0.7239232659339905,
0.7232266068458557,
0.7226459383964539
],
[
169470,
253915,
250117,
204893,
89010,
102893,
251635,
48274,
86894,
137413,
76177,
79396,
216742,
178176,
214479,
36168,
112414,
160730,
114040,
179232
]
] |
|
send_forged_addr_msg | d4597599ed74b7a0a16117b60b5cdff8d0a8a8e111f562f49002c65253730d28 | hmgle | cripple | NA | static int send_forged_addr_msg(const struct sockaddr_in *forged,
const struct sockaddr_in *real,
const struct sockaddr_in *dest)
{
int packet_size = 0;
uint8_t buf[128];
libnet_ptag_t ret;
char errbuf[LIBNET_ERRBUF_SIZE];
libnet_t *l = libnet_init(LIBNET_RAW4, NULL, errbuf);
if (l == NULL) {
fprintf(stderr, "You need 'sudo' to run this!\n");
exit(1);
}
packet_size += LIBNET_UDP_H;
/* store real addr port */
buf[0] = (real->sin_port >> 8) & 0xff;
buf[1] = real->sin_port & 0xff;
int buf_size = sprintf((char *)buf+2, "%s", inet_ntoa(real->sin_addr));
buf_size += 2;
packet_size += buf_size;
ret = libnet_build_udp(forged->sin_port, dest->sin_port, packet_size, 0,
buf, buf_size, l, 0);
if (ret < 0) {
fprintf(stderr, "libnet_build_udp() fail: %s\n",
libnet_geterror(l));
return -1;
}
ret = libnet_build_ipv4(packet_size + LIBNET_IPV4_H, 0, 0, 0, 255,
IPPROTO_UDP, 0, forged->sin_addr.s_addr,
dest->sin_addr.s_addr, NULL, 0, l, 0);
if (ret < 0) {
fprintf(stderr, "libnet_build_ipv4() fail: %s\n",
libnet_geterror(l));
return -1;
}
if (libnet_write(l) < 0) {
fprintf(stderr, "libnet_write fail: %s\n", libnet_geterror(l));
return -1;
}
libnet_destroy(l);
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401292", "function_addr": 4199058, "binary_name": "d4597599ed74b7a0a16117b60b5cdff8d0a8a8e111f562f49002c65253730d28.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 1C0h"], [3, "mov [rbp+var_1A8], rdi"], [4, "mov [rbp+var_1B0], rsi"], [5, "mov [rbp+var_1B8], rdx"], [6, "mov [rbp+var_4], 0"], [7, "lea rax, [rbp+var_1A0]"], [8, "mov rdx, rax"], [9, "mov esi, 0"], [10, "mov edi, 1"], [11, "call _libnet_init"], [12, "mov [rbp+var_10], rax"], [13, "cmp [rbp+var_10], 0"], [14, "jnz short loc_401305"], [15, "mov rax, cs:stderr"], [16, "mov rcx, rax"], [17, "mov edx, 1Dh"], [18, "mov esi, 1"], [19, "mov edi, offset aYouNeedSudoToR"], [20, "call _fwrite"], [21, "mov edi, 1"], [22, "call _exit"], [23, "add [rbp+var_4], 8"], [24, "mov rax, [rbp+var_1B0]"], [25, "movzx eax, word ptr [rax+2]"], [26, "shr ax, 8"], [27, "mov [rbp+var_A0], al"], [28, "mov rax, [rbp+var_1B0]"], [29, "movzx eax, word ptr [rax+2]"], [30, "mov [rbp+var_9F], al"], [31, "mov rax, [rbp+var_1B0]"], [32, "mov eax, [rax+4]"], [33, "mov edi, eax"], [34, "call _inet_ntoa"], [35, "mov rdx, rax"], [36, "lea rax, [rbp+var_A0]"], [37, "add rax, 2"], [38, "mov esi, offset format"], [39, "mov rdi, rax"], [40, "mov eax, 0"], [41, "call _sprintf"], [42, "mov [rbp+var_14], eax"], [43, "add [rbp+var_14], 2"], [44, "mov eax, [rbp+var_14]"], [45, "add [rbp+var_4], eax"], [46, "mov edi, [rbp+var_14]"], [47, "mov eax, [rbp+var_4]"], [48, "movzx edx, ax"], [49, "mov rax, [rbp+var_1B8]"], [50, "movzx eax, word ptr [rax+2]"], [51, "movzx esi, ax"], [52, "mov rax, [rbp+var_1A8]"], [53, "movzx eax, word ptr [rax+2]"], [54, "movzx eax, ax"], [55, "lea rcx, [rbp+var_A0]"], [56, "push 0"], [57, "push [rbp+var_10]"], [58, "mov r9d, edi"], [59, "mov r8, rcx"], [60, "mov ecx, 0"], [61, "mov edi, eax"], [62, "call _libnet_build_udp"], [63, "add rsp, 10h"], [64, "mov [rbp+var_18], eax"], [65, "cmp [rbp+var_18], 0"], [66, "jns short loc_4013EF"], [67, "mov rax, [rbp+var_10]"], [68, "mov rdi, rax"], [69, "call _libnet_geterror"], [70, "mov rdx, rax"], [71, "mov rax, cs:stderr"], [72, "mov esi, offset aLibnetBuildUdp_0"], [73, "mov rdi, rax"], [74, "mov eax, 0"], [75, "call _fprintf"], [76, "mov eax, 0FFFFFFFFh"], [77, "jmp locret_4014CB"], [78, "mov rax, [rbp+var_1B8]"], [79, "mov ecx, [rax+4]"], [80, "mov rax, [rbp+var_1A8]"], [81, "mov edx, [rax+4]"], [82, "mov eax, [rbp+var_4]"], [83, "add eax, 14h"], [84, "movzx eax, ax"], [85, "sub rsp, 8"], [86, "push 0"], [87, "push [rbp+var_10]"], [88, "push 0"], [89, "push 0"], [90, "push rcx"], [91, "push rdx"], [92, "push 0"], [93, "mov r9d, 11h"], [94, "mov r8d, 0FFh"], [95, "mov ecx, 0"], [96, "mov edx, 0"], [97, "mov esi, 0"], [98, "mov edi, eax"], [99, "call _libnet_build_ipv4"], [100, "add rsp, 40h"], [101, "mov [rbp+var_18], eax"], [102, "cmp [rbp+var_18], 0"], [103, "jns short loc_40147B"], [104, "mov rax, [rbp+var_10]"], [105, "mov rdi, rax"], [106, "call _libnet_geterror"], [107, "mov rdx, rax"], [108, "mov rax, cs:stderr"], [109, "mov esi, offset aLibnetBuildIpv_0"], [110, "mov rdi, rax"], [111, "mov eax, 0"], [112, "call _fprintf"], [113, "mov eax, 0FFFFFFFFh"], [114, "jmp short locret_4014CB"], [115, "mov rax, [rbp+var_10]"], [116, "mov rdi, rax"], [117, "call _libnet_write"], [118, "test eax, eax"], [119, "jns short loc_4014BA"], [120, "mov rax, [rbp+var_10]"], [121, "mov rdi, rax"], [122, "call _libnet_geterror"], [123, "mov rdx, rax"], [124, "mov rax, cs:stderr"], [125, "mov esi, offset aLibnetWriteFai"], [126, "mov rdi, rax"], [127, "mov eax, 0"], [128, "call _fprintf"], [129, "mov eax, 0FFFFFFFFh"], [130, "jmp short locret_4014CB"], [131, "mov rax, [rbp+var_10]"], [132, "mov rdi, rax"], [133, "call _libnet_destroy"], [134, "mov eax, 0"], [135, "leave"], [136, "retn"]], "data_dep": [[8, 7], [12, 11], [13, 12], [14, 13], [16, 15], [23, 6], [24, 4], [25, 24], [26, 25], [27, 26], [28, 4], [29, 28], [30, 29], [31, 4], [32, 31], [33, 32], [35, 34], [36, 34], [36, 27], [37, 36], [39, 37], [42, 41], [43, 42], [44, 43], [45, 23], [45, 44], [46, 43], [47, 45], [48, 47], [49, 5], [50, 49], [51, 50], [52, 3], [53, 52], [54, 53], [55, 27], [57, 12], [58, 46], [59, 55], [61, 54], [63, 2], [64, 62], [65, 64], [66, 65], [67, 12], [68, 67], [70, 69], [73, 71], [78, 5], [79, 78], [80, 3], [81, 80], [82, 45], [83, 82], [84, 83], [85, 63], [87, 12], [90, 79], [91, 81], [98, 84], [100, 85], [101, 99], [102, 101], [103, 102], [104, 12], [105, 104], [107, 106], [110, 108], [115, 12], [116, 115], [118, 117], [119, 118], [120, 12], [121, 120], [123, 122], [126, 124], [131, 12], [132, 131], [136, 134], [136, 129], [136, 113], [136, 76]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/d4597599ed74b7a0a16117b60b5cdff8d0a8a8e111f562f49002c65253730d28_d4597599ed74b7a0a16117b60b5cdff8d0a8a8e111f562f49002c65253730d28.jsonl.gz", "strip_func_name": "sub_401292", "query": "\n\n\n__int64 __fastcall sub_401292(__int64 a1, struct in_addr *a2)\n{\nchar *v2; // rax\nconst char *v3; // rax\n__int64 result; // rax\nconst char *v5; // rax\nconst char *v6; // rax\nchar v7[134]; // [rsp+122h] [rbp-9Eh] BYREF\nint v8; // [rsp+1A8h] [rbp-18h]\nint v9; // [rsp+1ACh] [rbp-14h]\nint v11; // [rsp+1BCh] [rbp-4h]\n\nv11 = 0;\nif ( !libnet_init() )\n{\nfwrite(\"You need 'sudo' to run this!\\n\", 1uLL, 0x1DuLL, stderr);\nexit(1);\n}\nv11 += 8;\nv2 = inet_ntoa(a2[1]);\nv9 = sprintf(v7, \"%s\", v2) + 2;\nv11 += v9;\nv8 = libnet_build_udp();\nif ( v8 >= 0 )\n{\nv8 = libnet_build_ipv4();\nif ( v8 >= 0 )\n{\nif ( (int)libnet_write() >= 0 )\n{\nlibnet_destroy();\nresult = 0LL;\n}\nelse\n{\nv6 = (const char *)libnet_geterror();\nfprintf(stderr, \"libnet_write fail: %s\\n\", v6);\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nv5 = (const char *)libnet_geterror();\nfprintf(stderr, \"libnet_build_ipv4() fail: %s\\n\", v5);\nresult = 0xFFFFFFFFLL;\n}\n}\nelse\n{\nv3 = (const char *)libnet_geterror();\nfprintf(stderr, \"libnet_build_udp() fail: %s\\n\", v3);\nresult = 0xFFFFFFFFLL;\n}\nreturn result;\n}\n\n\n\nQ:[a2,a1,v9,v11,sub_401292,]", "hints": "[]", "response": "{'a2': 'real', 'a1': 'forged', 'v9': 'buf_size', 'v11': 'packet_size', 'sub_401292': 'send_forged_addr_msg'}"} | [
[
0.7192496657371521,
0.7171319723129272,
0.7039738893508911,
0.6892681121826172,
0.687874436378479,
0.6876540780067444,
0.6874839067459106,
0.6873589754104614,
0.6832259893417358,
0.6817810535430908,
0.6812795400619507,
0.6798813343048096,
0.6784633994102478,
0.6772751212120056,
0.6744372844696045,
0.6739603281021118,
0.6727726459503174,
0.6703974008560181,
0.6703118085861206,
0.66968834400177
],
[
154206,
196835,
207388,
85799,
131885,
88441,
14625,
35164,
41772,
166302,
225087,
238015,
264115,
188716,
262821,
93012,
174130,
260293,
43264,
225097
]
] |
|
ciopfs_set_orig_name_fd | 2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9 | martanne | ciopfs | NA | static int ciopfs_set_orig_name_fd(int fd, const char *origpath)
{
char *filename = strrchr(origpath, '/');
if (!filename)
filename = (char *)origpath;
else
filename++;
#ifndef NDEBUG
char *path = map_path(origpath);
if (likely(path != NULL)) {
log_print("storing original name '%s' in '%s'\n", filename, path);
free(path);
}
#endif
if (fsetxattr(fd, CIOPFS_ATTR_NAME, filename, strlen(filename), 0)) {
int ret = -errno;
debug("%s\n", strerror(errno));
return ret;
}
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402BF1", "function_addr": 4205553, "binary_name": "2d3bcb1d0a6d2d2c4d958fe7be136970f60b40087ef9d5ae29f84e62c84bbbf9.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+fd], edi"], [4, "mov [rbp+s], rsi"], [5, "mov rax, [rbp+s]"], [6, "mov esi, 2Fh "], [7, "mov rdi, rax"], [8, "call _strrchr"], [9, "mov [rbp+var_8], rax"], [10, "cmp [rbp+var_8], 0"], [11, "jnz short loc_402C26"], [12, "mov rax, [rbp+s]"], [13, "mov [rbp+var_8], rax"], [14, "jmp short loc_402C2B"], [15, "add [rbp+var_8], 1"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdi, rax"], [18, "call _strlen"], [19, "mov rcx, rax"], [20, "mov rdx, [rbp+var_8]"], [21, "mov eax, [rbp+fd]"], [22, "mov r8d, 0"], [23, "mov esi, offset s2"], [24, "mov edi, eax"], [25, "call _fsetxattr"], [26, "test eax, eax"], [27, "jz short loc_402C68"], [28, "call ___errno_location"], [29, "mov eax, [rax]"], [30, "neg eax"], [31, "mov [rbp+var_C], eax"], [32, "mov eax, [rbp+var_C]"], [33, "jmp short locret_402C6D"], [34, "mov eax, 0"], [35, "leave"], [36, "retn"]], "data_dep": [[5, 4], [7, 5], [9, 8], [10, 9], [11, 10], [12, 4], [13, 12], [15, 9], [16, 13], [16, 15], [17, 16], [19, 18], [20, 13], [20, 15], [21, 3], [24, 21], [26, 25], [27, 26], [29, 28], [30, 29], [31, 30], [32, 31], [36, 34], [36, 32]]}
| {"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_402BF1", "query": "\n\n\n__int64 __fastcall sub_402BF1(int a1, const char *a2)\n{\nsize_t v2; // rax\n__int64 result; // rax\nchar *v4; // [rsp+18h] [rbp-8h]\nchar *v5; // [rsp+18h] [rbp-8h]\n\nv4 = strrchr(a2, 47);\nif ( v4 )\n{\nv5 = v4 + 1;\nv2 = strlen(v5);\n}\nelse\n{\nv5 = (char *)a2;\nv2 = strlen(a2);\n}\nif ( fsetxattr(a1, \"user.filename\", v5, v2, 0) )\nresult = (unsigned int)-*__errno_location();\nelse\nresult = 0LL;\nreturn result;\n}\n\n\n\nQ:[a1,a2,v4,sub_402BF1,]", "hints": "[]", "response": "{'a1': 'fd', 'a2': 'origpath', 'v4': 'filename', 'sub_402BF1': 'ciopfs_set_orig_name_fd'}"} | [
[
0.7582903504371643,
0.75168776512146,
0.7412129044532776,
0.7116361856460571,
0.711216151714325,
0.7103543877601624,
0.7004642486572266,
0.6975247859954834,
0.6961916089057922,
0.6934622526168823,
0.6922058463096619,
0.6915583610534668,
0.6852231025695801,
0.6839962005615234,
0.6827468276023865,
0.682204008102417,
0.675070583820343,
0.6732750535011292,
0.6721986532211304,
0.6687025427818298
],
[
150698,
13317,
111187,
121832,
45006,
111892,
234504,
123218,
248447,
168494,
250473,
219669,
112475,
4920,
99888,
198713,
27557,
166262,
68161,
67217
]
] |
|
mem_release_secure | dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b | lavabit | pahoehoe | NA | void mem_release_secure(void *mem)
{
#ifdef HAVE_MLOCK
char *addr, *lock;
size_t size;
if (!mem)
return;
lock = mem;
lock -= sizeof(size_t);
size = *(size_t *)lock;
#ifdef MLOCK_REQUIRES_PAGE_BOUNDARY
lock -= sizeof(void *);
addr = *(void **)lock;
#else
addr = lock;
#endif
memset(lock, 0xff, size);
memset(lock, 0xaa, size);
memset(lock, 0x55, size);
memset(lock, 0x00, size);
munlock(lock, size);
free(addr);
#endif
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_413042", "function_addr": 4272194, "binary_name": "dbef1d827ccd2a42e8941d50152f102df28295732bfb69acb1ef6314d264873b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 30h"], [3, "mov [rbp+var_28], rdi"], [4, "cmp [rbp+var_28], 0"], [5, "jz loc_4130EE"], [6, "mov rax, [rbp+var_28]"], [7, "mov [rbp+s], rax"], [8, "sub [rbp+s], 8"], [9, "mov rax, [rbp+s]"], [10, "mov rax, [rax]"], [11, "mov [rbp+n], rax"], [12, "mov rax, [rbp+s]"], [13, "mov [rbp+ptr], rax"], [14, "mov rdx, [rbp+n]"], [15, "mov rax, [rbp+s]"], [16, "mov esi, 0FFh"], [17, "mov rdi, rax"], [18, "call _memset"], [19, "mov rdx, [rbp+n]"], [20, "mov rax, [rbp+s]"], [21, "mov esi, 0AAh"], [22, "mov rdi, rax"], [23, "call _memset"], [24, "mov rdx, [rbp+n]"], [25, "mov rax, [rbp+s]"], [26, "mov esi, 55h "], [27, "mov rdi, rax"], [28, "call _memset"], [29, "mov rdx, [rbp+n]"], [30, "mov rax, [rbp+s]"], [31, "mov esi, 0"], [32, "mov rdi, rax"], [33, "call _memset"], [34, "mov rdx, [rbp+n]"], [35, "mov rax, [rbp+s]"], [36, "mov rsi, rdx"], [37, "mov rdi, rax"], [38, "call _munlock"], [39, "mov rax, [rbp+ptr]"], [40, "mov rdi, rax"], [41, "call _free"], [42, "jmp short locret_4130EF"], [43, "nop"], [44, "leave"], [45, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 3], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 8], [13, 12], [14, 11], [15, 8], [17, 15], [19, 11], [20, 8], [22, 20], [24, 11], [25, 8], [27, 25], [29, 11], [30, 8], [32, 30], [34, 11], [35, 8], [36, 34], [37, 35], [39, 13], [40, 39], [45, 41]]}
| {"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_413042", "query": "\n\n\nvoid __fastcall sub_413042(__int64 a1)\n{\nsize_t n; // [rsp+20h] [rbp-10h]\n\nif ( a1 )\n{\nn = *(_QWORD *)(a1 - 8);\nmemset((void *)(a1 - 8), 255, n);\nmemset((void *)(a1 - 8), 170, n);\nmemset((void *)(a1 - 8), 85, n);\nmemset((void *)(a1 - 8), 0, n);\nmunlock((const void *)(a1 - 8), n);\nfree((void *)(a1 - 8));\n}\n}\n\n\n\nQ:[a1,n,sub_413042,]", "hints": "[]", "response": "{'a1': 'mem', 'n': 'size', 'sub_413042': 'mem_release_secure'}"} | [
[
0.7937456369400024,
0.7874981164932251,
0.7767375707626343,
0.7728190422058105,
0.7637315392494202,
0.7635481953620911,
0.7621626853942871,
0.7615753412246704,
0.7513233423233032,
0.7490146160125732,
0.7485377192497253,
0.7465178370475769,
0.7412012815475464,
0.7300586104393005,
0.7242963910102844,
0.7211254239082336,
0.7179068326950073,
0.716730535030365,
0.7166144847869873,
0.7153638601303101
],
[
29177,
22738,
139100,
207038,
104971,
96760,
201096,
140879,
217731,
43371,
35025,
160734,
185046,
134330,
162367,
247450,
207790,
90746,
9853,
126491
]
] |
|
x8_process_request | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | int x8_process_request(struct mypacket *packet)
{
char sip[16], dip[16];
unsigned short sport, dport;
struct in_addr s_in_addr = {packet->iphdr->saddr};
struct in_addr d_in_addr = {packet->iphdr->daddr};
strncpy(sip, inet_ntoa(s_in_addr), 16);
strncpy(dip, inet_ntoa(d_in_addr), 16);
sport = ntohs(packet->tcphdr->th_sport);
dport = ntohs(packet->tcphdr->th_dport);
send_junk_data_with_wrong_checksum(sip, sport, dip, dport, packet->tcphdr->th_seq, packet->tcphdr->th_ack, packet->payload_len);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414BB4", "function_addr": 4279220, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_48], rdi"], [4, "mov rax, [rbp+var_48]"], [5, "mov rax, [rax+10h]"], [6, "mov eax, [rax+0Ch]"], [7, "mov [rbp+in.s_addr], eax"], [8, "mov rax, [rbp+var_48]"], [9, "mov rax, [rax+10h]"], [10, "mov eax, [rax+10h]"], [11, "mov [rbp+var_38.s_addr], eax"], [12, "mov eax, [rbp+in.s_addr]"], [13, "mov edi, eax"], [14, "call _inet_ntoa"], [15, "mov rcx, rax"], [16, "lea rax, [rbp+dest]"], [17, "mov edx, 10h"], [18, "mov rsi, rcx"], [19, "mov rdi, rax"], [20, "call _strncpy"], [21, "mov eax, [rbp+var_38.s_addr]"], [22, "mov edi, eax"], [23, "call _inet_ntoa"], [24, "mov rcx, rax"], [25, "lea rax, [rbp+var_30]"], [26, "mov edx, 10h"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _strncpy"], [30, "mov rax, [rbp+var_48]"], [31, "mov rax, [rax+18h]"], [32, "movzx eax, word ptr [rax]"], [33, "movzx eax, ax"], [34, "mov edi, eax"], [35, "call _ntohs"], [36, "mov [rbp+var_2], ax"], [37, "mov rax, [rbp+var_48]"], [38, "mov rax, [rax+18h]"], [39, "movzx eax, word ptr [rax+2]"], [40, "movzx eax, ax"], [41, "mov edi, eax"], [42, "call _ntohs"], [43, "mov [rbp+var_4], ax"], [44, "mov rax, [rbp+var_48]"], [45, "mov eax, [rax+28h]"], [46, "mov r9d, eax"], [47, "mov rax, [rbp+var_48]"], [48, "mov rax, [rax+18h]"], [49, "mov r8d, [rax+8]"], [50, "mov rax, [rbp+var_48]"], [51, "mov rax, [rax+18h]"], [52, "mov edi, [rax+4]"], [53, "movzx ecx, [rbp+var_4]"], [54, "movzx esi, [rbp+var_2]"], [55, "lea rdx, [rbp+var_30]"], [56, "lea rax, [rbp+dest]"], [57, "sub rsp, 8"], [58, "push r9"], [59, "mov r9d, r8d"], [60, "mov r8d, edi"], [61, "mov rdi, rax"], [62, "call sub_414A18"], [63, "add rsp, 10h"], [64, "mov eax, 1"], [65, "leave"], [66, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [11, 10], [12, 7], [13, 12], [15, 14], [16, 14], [18, 15], [19, 16], [21, 11], [22, 21], [24, 23], [25, 23], [27, 24], [28, 25], [30, 3], [31, 30], [32, 31], [33, 32], [34, 33], [36, 35], [37, 3], [38, 37], [39, 38], [40, 39], [41, 40], [43, 42], [44, 3], [45, 44], [46, 45], [47, 3], [48, 47], [49, 48], [50, 3], [51, 50], [52, 51], [53, 43], [54, 36], [55, 26], [56, 51], [57, 2], [58, 46], [59, 49], [60, 52], [61, 56], [63, 57], [66, 64]]}
| {"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_414BB4", "query": "\n\n\n__int64 __fastcall sub_414BB4(__int64 a1)\n{\nchar *v1; // rax\nchar *v2; // rax\nstruct in_addr v4; // [rsp+18h] [rbp-38h]\nchar v5[16]; // [rsp+20h] [rbp-30h] BYREF\nchar dest[28]; // [rsp+30h] [rbp-20h] BYREF\n__int16 v7; // [rsp+4Ch] [rbp-4h]\n__int16 v8; // [rsp+4Eh] [rbp-2h]\n\nv4.s_addr = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 16LL);\nv1 = inet_ntoa(*(struct in_addr *)(*(_QWORD *)(a1 + 16) + 12LL));\nstrncpy(dest, v1, 0x10uLL);\nv2 = inet_ntoa(v4);\nstrncpy(v5, v2, 0x10uLL);\nv8 = ntohs(**(_WORD **)(a1 + 24));\nv7 = ntohs(*(_WORD *)(*(_QWORD *)(a1 + 24) + 2LL));\nsub_414A18(\ndest,\nv8,\nv5,\nv7,\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL),\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL),\n*(_DWORD *)(a1 + 40));\nreturn 1LL;\n}\n\n\n\nQ:[a1,v4,v5,dest,v7,v8,sub_414BB4,sub_414A18,]", "hints": "[]", "response": "{'a1': 'packet', 'v4': 'd_in_addr', 'v5': 'dip', 'dest': 'sip', 'v7': 'dport', 'v8': 'sport', 'sub_414BB4': 'x8_process_request', 'sub_414A18': 'send_junk_data_with_wrong_checksum'}"} | [
[
0.732668936252594,
0.725248396396637,
0.7152084112167358,
0.7082338333129883,
0.7066203355789185,
0.7013365030288696,
0.6984063982963562,
0.6906849145889282,
0.6863746047019958,
0.6843233704566956,
0.6829917430877686,
0.6828894019126892,
0.6817416548728943,
0.6803411841392517,
0.6802727580070496,
0.6788255572319031,
0.6778342723846436,
0.6733667254447937,
0.6726909279823303,
0.6719653606414795
],
[
6145,
243001,
14189,
187109,
135000,
233070,
47776,
137553,
13642,
165005,
177591,
170466,
111426,
43766,
61340,
135254,
238877,
251734,
215669,
235160
]
] |
|
x32_process_request | 4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6 | seclab-ucr | INTANG | NA | int x32_process_request(struct mypacket *packet)
{
char sip[16], dip[16];
unsigned short sport, dport;
struct in_addr s_in_addr = {packet->iphdr->saddr};
struct in_addr d_in_addr = {packet->iphdr->daddr};
strncpy(sip, inet_ntoa(s_in_addr), 16);
strncpy(dip, inet_ntoa(d_in_addr), 16);
sport = ntohs(packet->tcphdr->th_sport);
dport = ntohs(packet->tcphdr->th_dport);
send_junk_data_super(sip, sport, dip, dport, packet->tcphdr->th_seq, packet->tcphdr->th_ack, packet->payload_len);
usleep(30000);
send_junk_data_super(sip, sport, dip, dport, packet->tcphdr->th_seq, packet->tcphdr->th_ack, packet->payload_len);
usleep(30000);
send_junk_data_super(sip, sport, dip, dport, packet->tcphdr->th_seq, packet->tcphdr->th_ack, packet->payload_len);
return 1;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_41C532", "function_addr": 4310322, "binary_name": "4a2436d19e8ef0321db858769cd0f4bb117e0463889ac368782c1575f4f6d0f6.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_48], rdi"], [4, "mov rax, [rbp+var_48]"], [5, "mov rax, [rax+10h]"], [6, "mov eax, [rax+0Ch]"], [7, "mov [rbp+in.s_addr], eax"], [8, "mov rax, [rbp+var_48]"], [9, "mov rax, [rax+10h]"], [10, "mov eax, [rax+10h]"], [11, "mov [rbp+var_38.s_addr], eax"], [12, "mov eax, [rbp+in.s_addr]"], [13, "mov edi, eax"], [14, "call _inet_ntoa"], [15, "mov rcx, rax"], [16, "lea rax, [rbp+dest]"], [17, "mov edx, 10h"], [18, "mov rsi, rcx"], [19, "mov rdi, rax"], [20, "call _strncpy"], [21, "mov eax, [rbp+var_38.s_addr]"], [22, "mov edi, eax"], [23, "call _inet_ntoa"], [24, "mov rcx, rax"], [25, "lea rax, [rbp+var_30]"], [26, "mov edx, 10h"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _strncpy"], [30, "mov rax, [rbp+var_48]"], [31, "mov rax, [rax+18h]"], [32, "movzx eax, word ptr [rax]"], [33, "movzx eax, ax"], [34, "mov edi, eax"], [35, "call _ntohs"], [36, "mov [rbp+var_2], ax"], [37, "mov rax, [rbp+var_48]"], [38, "mov rax, [rax+18h]"], [39, "movzx eax, word ptr [rax+2]"], [40, "movzx eax, ax"], [41, "mov edi, eax"], [42, "call _ntohs"], [43, "mov [rbp+var_4], ax"], [44, "mov rax, [rbp+var_48]"], [45, "mov eax, [rax+28h]"], [46, "mov r9d, eax"], [47, "mov rax, [rbp+var_48]"], [48, "mov rax, [rax+18h]"], [49, "mov r8d, [rax+8]"], [50, "mov rax, [rbp+var_48]"], [51, "mov rax, [rax+18h]"], [52, "mov edi, [rax+4]"], [53, "movzx ecx, [rbp+var_4]"], [54, "movzx esi, [rbp+var_2]"], [55, "lea rdx, [rbp+var_30]"], [56, "lea rax, [rbp+dest]"], [57, "sub rsp, 8"], [58, "push r9"], [59, "mov r9d, r8d"], [60, "mov r8d, edi"], [61, "mov rdi, rax"], [62, "call sub_41C387"], [63, "add rsp, 10h"], [64, "mov edi, 7530h"], [65, "call _usleep"], [66, "mov rax, [rbp+var_48]"], [67, "mov eax, [rax+28h]"], [68, "mov r9d, eax"], [69, "mov rax, [rbp+var_48]"], [70, "mov rax, [rax+18h]"], [71, "mov r8d, [rax+8]"], [72, "mov rax, [rbp+var_48]"], [73, "mov rax, [rax+18h]"], [74, "mov edi, [rax+4]"], [75, "movzx ecx, [rbp+var_4]"], [76, "movzx esi, [rbp+var_2]"], [77, "lea rdx, [rbp+var_30]"], [78, "lea rax, [rbp+dest]"], [79, "sub rsp, 8"], [80, "push r9"], [81, "mov r9d, r8d"], [82, "mov r8d, edi"], [83, "mov rdi, rax"], [84, "call sub_41C387"], [85, "add rsp, 10h"], [86, "mov edi, 7530h"], [87, "call _usleep"], [88, "mov rax, [rbp+var_48]"], [89, "mov eax, [rax+28h]"], [90, "mov r9d, eax"], [91, "mov rax, [rbp+var_48]"], [92, "mov rax, [rax+18h]"], [93, "mov r8d, [rax+8]"], [94, "mov rax, [rbp+var_48]"], [95, "mov rax, [rax+18h]"], [96, "mov edi, [rax+4]"], [97, "movzx ecx, [rbp+var_4]"], [98, "movzx esi, [rbp+var_2]"], [99, "lea rdx, [rbp+var_30]"], [100, "lea rax, [rbp+dest]"], [101, "sub rsp, 8"], [102, "push r9"], [103, "mov r9d, r8d"], [104, "mov r8d, edi"], [105, "mov rdi, rax"], [106, "call sub_41C387"], [107, "add rsp, 10h"], [108, "mov eax, 1"], [109, "leave"], [110, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 5], [7, 6], [8, 3], [9, 8], [10, 9], [11, 10], [12, 7], [13, 12], [15, 14], [16, 14], [18, 15], [19, 16], [21, 11], [22, 21], [24, 23], [25, 23], [27, 24], [28, 25], [30, 3], [31, 30], [32, 31], [33, 32], [34, 33], [36, 35], [37, 3], [38, 37], [39, 38], [40, 39], [41, 40], [43, 42], [44, 3], [45, 44], [46, 45], [47, 3], [48, 47], [49, 48], [50, 3], [51, 50], [52, 51], [53, 43], [54, 36], [55, 26], [56, 51], [57, 2], [58, 46], [59, 49], [60, 52], [61, 56], [63, 57], [66, 3], [67, 66], [68, 67], [69, 3], [70, 69], [71, 70], [72, 3], [73, 72], [74, 73], [75, 43], [76, 36], [77, 55], [78, 73], [79, 63], [80, 68], [81, 71], [82, 74], [83, 78], [85, 79], [88, 3], [89, 88], [90, 89], [91, 3], [92, 91], [93, 92], [94, 3], [95, 94], [96, 95], [97, 43], [98, 36], [99, 77], [100, 95], [101, 85], [102, 90], [103, 93], [104, 96], [105, 100], [107, 101], [110, 108]]}
| {"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_41C532", "query": "\n\n\n__int64 __fastcall sub_41C532(__int64 a1)\n{\nchar *v1; // rax\nchar *v2; // rax\nstruct in_addr v5; // [rsp+18h] [rbp-38h]\nchar v6[16]; // [rsp+20h] [rbp-30h] BYREF\nchar dest[28]; // [rsp+30h] [rbp-20h] BYREF\n__int16 v8; // [rsp+4Ch] [rbp-4h]\n__int16 v9; // [rsp+4Eh] [rbp-2h]\n\nv5.s_addr = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 16LL);\nv1 = inet_ntoa(*(struct in_addr *)(*(_QWORD *)(a1 + 16) + 12LL));\nstrncpy(dest, v1, 0x10uLL);\nv2 = inet_ntoa(v5);\nstrncpy(v6, v2, 0x10uLL);\nv9 = ntohs(**(_WORD **)(a1 + 24));\nv8 = ntohs(*(_WORD *)(*(_QWORD *)(a1 + 24) + 2LL));\nsub_41C387(\ndest,\nv9,\nv6,\nv8,\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL),\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL),\n*(_DWORD *)(a1 + 40));\nusleep(0x7530u);\nsub_41C387(\ndest,\nv9,\nv6,\nv8,\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL),\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL),\n*(_DWORD *)(a1 + 40));\nusleep(0x7530u);\nsub_41C387(\ndest,\nv9,\nv6,\nv8,\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 4LL),\n*(_DWORD *)(*(_QWORD *)(a1 + 24) + 8LL),\n*(_DWORD *)(a1 + 40));\nreturn 1LL;\n}\n\n\n\nQ:[a1,v5,v6,dest,v8,v9,sub_41C532,sub_41C387,]", "hints": "[]", "response": "{'a1': 'packet', 'v5': 'd_in_addr', 'v6': 'dip', 'dest': 'sip', 'v8': 'dport', 'v9': 'sport', 'sub_41C532': 'x32_process_request', 'sub_41C387': 'send_junk_data_super_9'}"} | [
[
0.7337817549705505,
0.72122722864151,
0.7179830074310303,
0.7148158550262451,
0.7055370807647705,
0.7034405469894409,
0.7014201879501343,
0.7013843059539795,
0.6989134550094604,
0.6972577571868896,
0.6965282559394836,
0.6933064460754395,
0.6880314350128174,
0.6839832067489624,
0.6838011145591736,
0.6835402846336365,
0.6802300214767456,
0.679838240146637,
0.6791520118713379,
0.6786882877349854
],
[
170466,
6145,
243001,
187109,
235160,
14189,
47776,
932,
135000,
251734,
135254,
61340,
233070,
238877,
137553,
20081,
60964,
131006,
183280,
111426
]
] |
|
search_dmesg_driver_component_ops | 78e2918b589d8160319f5a1cbe8f35eb7d94032e46ea1c7a57d8b00a138379f8 | bcoles | kasld | NA | unsigned long search_dmesg_driver_component_ops() {
char *syslog;
char *ptr;
char *endptr;
char *ops_buf;
const char *needle = " (ops 0x";
int size;
unsigned long addr = 0;
unsigned long leaked_addr = 0;
printf("[.] searching dmesg for driver component ops pointers ...\n");
if (mmap_syslog(&syslog, &size))
return 0;
ptr = strtok(syslog, "\n");
while ((ptr = strtok(NULL, "\n")) != NULL) {
ops_buf = strstr(ptr, needle);
if (ops_buf == NULL)
continue;
leaked_addr = strtoul(&ops_buf[strlen(needle)], &endptr, 16);
if (!leaked_addr)
continue;
if (leaked_addr >= KERNEL_BASE_MIN && leaked_addr <= KERNEL_BASE_MAX) {
// printf("Found kernel pointer: %lx\n", leaked_addr);
if (!addr || leaked_addr < addr)
addr = leaked_addr;
}
}
return addr;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4012CA", "function_addr": 4199114, "binary_name": "78e2918b589d8160319f5a1cbe8f35eb7d94032e46ea1c7a57d8b00a138379f8.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+needle], offset aOps0x"], [4, "mov [rbp+var_8], 0"], [5, "mov [rbp+var_18], 0"], [6, "mov edi, offset aSearchingDmesg"], [7, "call _puts"], [8, "lea rdx, [rbp+var_3C]"], [9, "lea rax, [rbp+s]"], [10, "mov rsi, rdx"], [11, "mov rdi, rax"], [12, "call sub_4011E2"], [13, "test eax, eax"], [14, "jz short loc_401315"], [15, "mov eax, 0"], [16, "jmp locret_4013D9"], [17, "mov rax, [rbp+s]"], [18, "mov esi, offset delim"], [19, "mov rdi, rax"], [20, "call _strtok"], [21, "mov [rbp+haystack], rax"], [22, "jmp loc_4013B7"], [23, "mov rdx, [rbp+needle]"], [24, "mov rax, [rbp+haystack]"], [25, "mov rsi, rdx"], [26, "mov rdi, rax"], [27, "call _strstr"], [28, "mov [rbp+var_28], rax"], [29, "cmp [rbp+var_28], 0"], [30, "jnz short loc_40134F"], [31, "jmp short loc_4013B7"], [32, "mov rax, [rbp+needle]"], [33, "mov rdi, rax"], [34, "call _strlen"], [35, "mov rdx, [rbp+var_28]"], [36, "lea rcx, [rax+rdx]"], [37, "lea rax, [rbp+endptr]"], [38, "mov edx, 10h"], [39, "mov rsi, rax"], [40, "mov rdi, rcx"], [41, "call _strtoul"], [42, "mov [rbp+var_18], rax"], [43, "cmp [rbp+var_18], 0"], [44, "jnz short loc_401384"], [45, "jmp short loc_4013B7"], [46, "mov rax, 0FFFFFFFF7FFFFFFFh"], [47, "cmp [rbp+var_18], rax"], [48, "jbe short loc_4013B7"], [49, "cmp [rbp+var_18], 0FFFFFFFFC0000000h"], [50, "ja short loc_4013B7"], [51, "cmp [rbp+var_8], 0"], [52, "jz short loc_4013AF"], [53, "mov rax, [rbp+var_18]"], [54, "cmp rax, [rbp+var_8]"], [55, "jnb short loc_4013B7"], [56, "mov rax, [rbp+var_18]"], [57, "mov [rbp+var_8], rax"], [58, "mov esi, offset delim"], [59, "mov edi, 0"], [60, "call _strtok"], [61, "mov [rbp+haystack], rax"], [62, "cmp [rbp+haystack], 0"], [63, "jnz loc_40132F"], [64, "mov rax, [rbp+var_8]"], [65, "leave"], [66, "retn"]], "data_dep": [[9, 7], [10, 8], [11, 9], [13, 12], [14, 13], [19, 17], [21, 20], [23, 3], [24, 61], [25, 23], [26, 24], [28, 27], [29, 28], [30, 29], [32, 3], [33, 32], [35, 28], [36, 34], [36, 36], [37, 34], [39, 37], [40, 36], [42, 41], [43, 42], [44, 43], [47, 46], [47, 42], [48, 47], [49, 42], [50, 49], [51, 4], [51, 57], [52, 51], [53, 42], [54, 57], [54, 53], [54, 4], [55, 54], [56, 42], [57, 56], [61, 60], [62, 61], [63, 62], [64, 4], [64, 57], [66, 64], [66, 15]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/78e2918b589d8160319f5a1cbe8f35eb7d94032e46ea1c7a57d8b00a138379f8_78e2918b589d8160319f5a1cbe8f35eb7d94032e46ea1c7a57d8b00a138379f8.jsonl.gz", "strip_func_name": "sub_4012CA", "query": "\n\n\nunsigned __int64 sub_4012CA()\n{\nsize_t v1; // rax\nint v2; // [rsp+4h] [rbp-3Ch] BYREF\nchar *endptr; // [rsp+8h] [rbp-38h] BYREF\nchar *s; // [rsp+10h] [rbp-30h] BYREF\nchar *v5; // [rsp+18h] [rbp-28h]\nchar *haystack; // [rsp+20h] [rbp-20h]\nunsigned __int64 v7; // [rsp+28h] [rbp-18h]\nchar *needle; // [rsp+30h] [rbp-10h]\nunsigned __int64 v9; // [rsp+38h] [rbp-8h]\n\nneedle = \" (ops 0x\";\nv9 = 0LL;\nv7 = 0LL;\nputs(\"[.] searching dmesg for driver component ops pointers ...\");\nif ( (unsigned int)sub_4011E2(&s, &v2) )\nreturn 0LL;\nhaystack = strtok(s, \"\\n\");\nwhile ( 1 )\n{\nhaystack = strtok(0LL, \"\\n\");\nif ( !haystack )\nbreak;\nv5 = strstr(haystack, needle);\nif ( v5 )\n{\nv1 = strlen(needle);\nv7 = strtoul(&v5[v1], &endptr, 16);\nif ( v7 )\n{\nif ( v7 > 0xFFFFFFFF7FFFFFFFLL && v7 <= 0xFFFFFFFFC0000000LL && (!v9 || v7 < v9) )\nv9 = v7;\n}\n}\n}\nreturn v9;\n}\n\n\n\nQ:[v2,s,v5,haystack,v7,v9,sub_4012CA,sub_4011E2,]", "hints": "[]", "response": "{'v2': 'size', 's': 'syslog', 'v5': 'ops_buf', 'haystack': 'ptr', 'v7': 'leaked_addr', 'v9': 'addr', 'sub_4012CA': 'search_dmesg_driver_component_ops', 'sub_4011E2': 'mmap_syslog'}"} | [
[
0.9230573773384094,
0.9132471084594727,
0.8989992737770081,
0.8748582601547241,
0.8700883388519287,
0.8673198223114014,
0.8597092628479004,
0.8167095184326172,
0.8151074647903442,
0.7830796241760254,
0.7724927067756653,
0.7704760432243347,
0.7635825872421265,
0.74058598279953,
0.7368611097335815,
0.7287312150001526,
0.7283883094787598,
0.7259983420372009,
0.7219887375831604,
0.7172600626945496
],
[
148385,
168107,
80669,
217139,
194163,
236546,
229608,
130047,
63171,
44077,
185741,
70203,
120640,
153445,
255671,
238967,
215088,
245841,
121402,
50896
]
] |
|
utf8proc_decompose_custom | 2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7 | 0x09 | hfsfuse | NA | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom(
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen,
utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options,
utf8proc_custom_func custom_func, void *custom_data
) {
/* strlen will be ignored, if UTF8PROC_NULLTERM is set in options */
utf8proc_ssize_t wpos = 0;
if ((options & UTF8PROC_COMPOSE) && (options & UTF8PROC_DECOMPOSE))
return UTF8PROC_ERROR_INVALIDOPTS;
if ((options & UTF8PROC_STRIPMARK) &&
!(options & UTF8PROC_COMPOSE) && !(options & UTF8PROC_DECOMPOSE))
return UTF8PROC_ERROR_INVALIDOPTS;
{
utf8proc_int32_t uc;
utf8proc_ssize_t rpos = 0;
utf8proc_ssize_t decomp_result;
int boundclass = UTF8PROC_BOUNDCLASS_START;
while (1) {
if (options & UTF8PROC_NULLTERM) {
rpos += utf8proc_iterate(str + rpos, -1, &uc);
/* checking of return value is not necessary,
as 'uc' is < 0 in case of error */
if (uc < 0) return UTF8PROC_ERROR_INVALIDUTF8;
if (rpos < 0) return UTF8PROC_ERROR_OVERFLOW;
if (uc == 0) break;
} else {
if (rpos >= strlen) break;
rpos += utf8proc_iterate(str + rpos, strlen - rpos, &uc);
if (uc < 0) return UTF8PROC_ERROR_INVALIDUTF8;
}
if (custom_func != NULL) {
uc = custom_func(uc, custom_data); /* user-specified custom mapping */
}
decomp_result = utf8proc_decompose_char(
uc, buffer + wpos, (bufsize > wpos) ? (bufsize - wpos) : 0, options,
&boundclass
);
if (decomp_result < 0) return decomp_result;
wpos += decomp_result;
/* prohibiting integer overflows due to too long strings: */
if (wpos < 0 ||
wpos > (utf8proc_ssize_t)(SSIZE_MAX/sizeof(utf8proc_int32_t)/2))
return UTF8PROC_ERROR_OVERFLOW;
}
}
if ((options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) && bufsize >= wpos) {
utf8proc_ssize_t pos = 0;
while (pos < wpos-1) {
utf8proc_int32_t uc1, uc2;
const utf8proc_property_t *property1, *property2;
uc1 = buffer[pos];
uc2 = buffer[pos+1];
property1 = unsafe_get_property(uc1);
property2 = unsafe_get_property(uc2);
if (property1->combining_class > property2->combining_class &&
property2->combining_class > 0) {
buffer[pos] = uc2;
buffer[pos+1] = uc1;
if (pos > 0) pos--; else pos++;
} else {
pos++;
}
}
}
return wpos;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4027F0", "function_addr": 4204528, "binary_name": "2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 70h"], [3, "mov [rbp+var_48], rdi"], [4, "mov [rbp+var_50], rsi"], [5, "mov [rbp+var_58], rdx"], [6, "mov [rbp+var_60], rcx"], [7, "mov [rbp+var_64], r8d"], [8, "mov [rbp+var_70], r9"], [9, "mov [rbp+var_8], 0"], [10, "mov eax, [rbp+var_64]"], [11, "and eax, 8"], [12, "test eax, eax"], [13, "jz short loc_402838"], [14, "mov eax, [rbp+var_64]"], [15, "and eax, 10h"], [16, "test eax, eax"], [17, "jz short loc_402838"], [18, "mov rax, 0FFFFFFFFFFFFFFFBh"], [19, "jmp locret_402ABC"], [20, "mov eax, [rbp+var_64]"], [21, "and eax, 2000h"], [22, "test eax, eax"], [23, "jz short loc_402864"], [24, "mov eax, [rbp+var_64]"], [25, "and eax, 8"], [26, "test eax, eax"], [27, "jnz short loc_402864"], [28, "mov eax, [rbp+var_64]"], [29, "and eax, 10h"], [30, "test eax, eax"], [31, "jnz short loc_402864"], [32, "mov rax, 0FFFFFFFFFFFFFFFBh"], [33, "jmp locret_402ABC"], [34, "mov [rbp+var_10], 0"], [35, "mov [rbp+var_40], 0"], [36, "mov eax, [rbp+var_64]"], [37, "and eax, 1"], [38, "test eax, eax"], [39, "jz short loc_4028D5"], [40, "mov rdx, [rbp+var_10]"], [41, "mov rax, [rbp+var_48]"], [42, "lea rcx, [rdx+rax]"], [43, "lea rax, [rbp+var_3C]"], [44, "mov rdx, rax"], [45, "mov rsi, 0FFFFFFFFFFFFFFFFh"], [46, "mov rdi, rcx"], [47, "call sub_401664"], [48, "add [rbp+var_10], rax"], [49, "mov eax, [rbp+var_3C]"], [50, "test eax, eax"], [51, "jns short loc_4028B6"], [52, "mov rax, 0FFFFFFFFFFFFFFFDh"], [53, "jmp locret_402ABC"], [54, "cmp [rbp+var_10], 0"], [55, "jns short loc_4028C9"], [56, "mov rax, 0FFFFFFFFFFFFFFFEh"], [57, "jmp locret_402ABC"], [58, "mov eax, [rbp+var_3C]"], [59, "test eax, eax"], [60, "jnz short loc_40291C"], [61, "jmp loc_4029BD"], [62, "mov rax, [rbp+var_10]"], [63, "cmp rax, [rbp+var_50]"], [64, "jge loc_4029BC"], [65, "mov rax, [rbp+var_50]"], [66, "sub rax, [rbp+var_10]"], [67, "mov rcx, [rbp+var_10]"], [68, "mov rdx, [rbp+var_48]"], [69, "add rcx, rdx"], [70, "lea rdx, [rbp+var_3C]"], [71, "mov rsi, rax"], [72, "mov rdi, rcx"], [73, "call sub_401664"], [74, "add [rbp+var_10], rax"], [75, "mov eax, [rbp+var_3C]"], [76, "test eax, eax"], [77, "jns short loc_40291C"], [78, "mov rax, 0FFFFFFFFFFFFFFFDh"], [79, "jmp locret_402ABC"], [80, "cmp [rbp+var_70], 0"], [81, "jz short loc_402935"], [82, "mov eax, [rbp+var_3C]"], [83, "mov rdx, [rbp+var_70]"], [84, "mov rsi, [rbp+arg_0]"], [85, "mov edi, eax"], [86, "call rdx"], [87, "mov [rbp+var_3C], eax"], [88, "mov rax, [rbp+var_60]"], [89, "cmp rax, [rbp+var_8]"], [90, "jle short loc_402949"], [91, "mov rax, [rbp+var_60]"], [92, "sub rax, [rbp+var_8]"], [93, "jmp short loc_40294E"], [94, "mov eax, 0"], [95, "mov rdx, [rbp+var_8]"], [96, "lea rcx, ds:0[rdx*4]"], [97, "mov rdx, [rbp+var_58]"], [98, "lea rsi, [rcx+rdx]"], [99, "mov edi, [rbp+var_3C]"], [100, "lea rcx, [rbp+var_40]"], [101, "mov edx, [rbp+var_64]"], [102, "mov r8, rcx"], [103, "mov ecx, edx"], [104, "mov rdx, rax"], [105, "call sub_402155"], [106, "mov [rbp+var_20], rax"], [107, "cmp [rbp+var_20], 0"], [108, "jns short loc_40298D"], [109, "mov rax, [rbp+var_20]"], [110, "jmp locret_402ABC"], [111, "mov rax, [rbp+var_20]"], [112, "add [rbp+var_8], rax"], [113, "cmp [rbp+var_8], 0"], [114, "js short loc_4029B0"], [115, "mov rax, 0FFFFFFFFFFFFFFFh"], [116, "cmp [rbp+var_8], rax"], [117, "jle loc_402873"], [118, "mov rax, 0FFFFFFFFFFFFFFFEh"], [119, "jmp locret_402ABC"], [120, "nop"], [121, "mov eax, [rbp+var_64]"], [122, "and eax, 18h"], [123, "test eax, eax"], [124, "jz loc_402AB8"], [125, "mov rax, [rbp+var_60]"], [126, "cmp rax, [rbp+var_8]"], [127, "jl loc_402AB8"], [128, "mov [rbp+var_18], 0"], [129, "jmp loc_402AA6"], [130, "mov rax, [rbp+var_18]"], [131, "lea rdx, ds:0[rax*4]"], [132, "mov rax, [rbp+var_58]"], [133, "add rax, rdx"], [134, "mov eax, [rax]"], [135, "mov [rbp+var_24], eax"], [136, "mov rax, [rbp+var_18]"], [137, "add rax, 1"], [138, "lea rdx, ds:0[rax*4]"], [139, "mov rax, [rbp+var_58]"], [140, "add rax, rdx"], [141, "mov eax, [rax]"], [142, "mov [rbp+var_28], eax"], [143, "mov eax, [rbp+var_24]"], [144, "mov edi, eax"], [145, "call sub_401BAD"], [146, "mov [rbp+var_30], rax"], [147, "mov eax, [rbp+var_28]"], [148, "mov edi, eax"], [149, "call sub_401BAD"], [150, "mov [rbp+var_38], rax"], [151, "mov rax, [rbp+var_30]"], [152, "movzx edx, word ptr [rax+2]"], [153, "mov rax, [rbp+var_38]"], [154, "movzx eax, word ptr [rax+2]"], [155, "cmp dx, ax"], [156, "jle short loc_402AA1"], [157, "mov rax, [rbp+var_38]"], [158, "movzx eax, word ptr [rax+2]"], [159, "test ax, ax"], [160, "jle short loc_402AA1"], [161, "mov rax, [rbp+var_18]"], [162, "lea rdx, ds:0[rax*4]"], [163, "mov rax, [rbp+var_58]"], [164, "add rdx, rax"], [165, "mov eax, [rbp+var_28]"], [166, "mov [rdx], eax"], [167, "mov rax, [rbp+var_18]"], [168, "add rax, 1"], [169, "lea rdx, ds:0[rax*4]"], [170, "mov rax, [rbp+var_58]"], [171, "add rdx, rax"], [172, "mov eax, [rbp+var_24]"], [173, "mov [rdx], eax"], [174, "cmp [rbp+var_18], 0"], [175, "jle short loc_402A9A"], [176, "sub [rbp+var_18], 1"], [177, "jmp short loc_402AA6"], [178, "add [rbp+var_18], 1"], [179, "jmp short loc_402AA6"], [180, "add [rbp+var_18], 1"], [181, "mov rax, [rbp+var_8]"], [182, "sub rax, 1"], [183, "cmp [rbp+var_18], rax"], [184, "jl loc_4029E6"], [185, "mov rax, [rbp+var_8]"], [186, "leave"], [187, "retn"]], "data_dep": [[10, 7], [11, 10], [12, 11], [13, 12], [14, 7], [15, 14], [16, 15], [17, 16], [20, 7], [21, 20], [22, 21], [23, 22], [24, 7], [25, 24], [26, 25], [27, 26], [28, 7], [29, 28], [30, 29], [31, 30], [36, 7], [37, 36], [38, 37], [39, 38], [40, 34], [40, 74], [40, 48], [41, 3], [42, 103], [42, 41], [43, 87], [43, 41], [44, 43], [46, 42], [48, 47], [48, 74], [48, 34], [48, 48], [49, 87], [50, 49], [51, 50], [54, 48], [55, 54], [58, 87], [59, 58], [60, 59], [62, 74], [62, 48], [62, 34], [63, 62], [63, 4], [64, 63], [65, 4], [66, 48], [66, 34], [66, 65], [66, 74], [67, 34], [67, 74], [67, 48], [68, 3], [69, 67], [69, 68], [70, 68], [70, 87], [71, 66], [72, 69], [74, 73], [74, 48], [74, 74], [74, 34], [75, 87], [76, 75], [77, 76], [80, 8], [81, 80], [82, 87], [83, 8], [85, 82], [86, 83], [87, 86], [88, 6], [89, 88], [89, 9], [89, 112], [90, 89], [91, 6], [92, 9], [92, 112], [92, 91], [95, 112], [95, 9], [96, 42], [96, 69], [97, 5], [98, 96], [98, 71], [98, 84], [98, 45], [99, 87], [100, 96], [100, 35], [101, 7], [102, 100], [103, 101], [104, 92], [104, 94], [106, 105], [107, 106], [108, 107], [109, 106], [111, 106], [112, 111], [112, 112], [112, 9], [113, 112], [114, 113], [116, 115], [116, 112], [117, 116], [121, 7], [122, 121], [123, 122], [124, 123], [125, 6], [126, 112], [126, 9], [126, 125], [127, 126], [130, 176], [130, 128], [130, 178], [130, 180], [131, 152], [131, 104], [131, 44], [131, 171], [132, 5], [133, 132], [133, 131], [134, 133], [134, 173], [134, 166], [135, 134], [136, 176], [136, 178], [136, 180], [136, 128], [137, 136], [138, 131], [139, 5], [140, 139], [140, 138], [141, 140], [141, 173], [141, 166], [142, 141], [143, 135], [144, 143], [146, 145], [147, 142], [148, 147], [150, 149], [151, 146], [152, 151], [152, 173], [152, 166], [153, 150], [154, 173], [154, 166], [154, 153], [155, 152], [155, 154], [156, 155], [157, 150], [158, 157], [158, 173], [158, 166], [159, 158], [160, 159], [161, 180], [161, 128], [161, 176], [161, 178], [162, 152], [163, 5], [164, 162], [164, 163], [165, 142], [166, 165], [166, 164], [167, 128], [167, 176], [167, 178], [167, 180], [168, 167], [169, 164], [170, 5], [171, 170], [171, 169], [172, 135], [173, 172], [173, 171], [174, 178], [174, 180], [174, 176], [174, 128], [175, 174], [176, 176], [176, 178], [176, 128], [176, 180], [178, 128], [178, 176], [178, 178], [178, 180], [180, 128], [180, 180], [180, 176], [180, 178], [181, 112], [181, 9], [182, 181], [183, 128], [183, 176], [183, 178], [183, 180], [183, 182], [184, 183], [185, 9], [185, 112], [187, 185], [187, 78], [187, 32], [187, 18], [187, 109], [187, 52], [187, 118], [187, 56]]}
| {"prompt": "Help user generate meaningful names for variables and functions in the following code snippet.", "prog_name": "gh-dataset-dirty/bins/2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7_2c74eba724c26ae3a60afedfca710a2898f662ed2c9ab1dedac337ea3a2a7cc7.jsonl.gz", "strip_func_name": "sub_4027F0", "query": "\n\n\n__int64 __fastcall sub_4027F0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, unsigned int a5, __int64 (__fastcall *a6)(_QWORD, __int64), __int64 a7)\n{\n__int64 v8; // rax\n__int64 v9; // rax\n__int64 v10; // rax\nint v15; // [rsp+30h] [rbp-40h] BYREF\nint v16; // [rsp+34h] [rbp-3Ch] BYREF\n__int64 v17; // [rsp+38h] [rbp-38h]\n__int64 v18; // [rsp+40h] [rbp-30h]\nint v19; // [rsp+48h] [rbp-28h]\nint v20; // [rsp+4Ch] [rbp-24h]\n__int64 v21; // [rsp+50h] [rbp-20h]\n__int64 v22; // [rsp+58h] [rbp-18h]\n__int64 v23; // [rsp+60h] [rbp-10h]\n__int64 v24; // [rsp+68h] [rbp-8h]\n\nv24 = 0LL;\nif ( (a5 & 8) != 0 && (a5 & 0x10) != 0 )\nreturn -5LL;\nif ( (a5 & 0x2000) != 0 && (a5 & 8) == 0 && (a5 & 0x10) == 0 )\nreturn -5LL;\nv23 = 0LL;\nv15 = 0;\nwhile ( (a5 & 1) == 0 )\n{\nif ( v23 >= a2 )\ngoto LABEL_29;\nv9 = sub_401664((unsigned __int8 *)(a1 + v23), a2 - v23, &v16);\nv23 += v9;\nif ( v16 < 0 )\nreturn -3LL;\nLABEL_19:\nif ( a6 )\nv16 = a6((unsigned int)v16, a7);\nif ( a4 <= v24 )\nv10 = 0LL;\nelse\nv10 = a4 - v24;\nv21 = sub_402155(v16, (int *)(4 * v24 + a3), v10, a5, &v15);\nif ( v21 < 0 )\nreturn v21;\nv24 += v21;\nif ( v24 < 0 || v24 > 0xFFFFFFFFFFFFFFFLL )\nreturn -2LL;\n}\nv8 = sub_401664((unsigned __int8 *)(v23 + a1), -1LL, &v16);\nv23 += v8;\nif ( v16 < 0 )\nreturn -3LL;\nif ( v23 < 0 )\nreturn -2LL;\nif ( v16 )\ngoto LABEL_19;\nLABEL_29:\nif ( (a5 & 0x18) != 0 && a4 >= v24 )\n{\nv22 = 0LL;\nwhile ( v22 < v24 - 1 )\n{\nv20 = *(_DWORD *)(4 * v22 + a3);\nv19 = *(_DWORD *)(4 * (v22 + 1) + a3);\nv18 = sub_401BAD(v20);\nv17 = sub_401BAD(v19);\nif ( *(_WORD *)(v18 + 2) <= *(_WORD *)(v17 + 2) || *(__int16 *)(v17 + 2) <= 0 )\n{\n++v22;\n}\nelse\n{\n*(_DWORD *)(a3 + 4 * v22) = v19;\n*(_DWORD *)(a3 + 4 * (v22 + 1)) = v20;\nif ( v22 <= 0 )\n++v22;\nelse\n--v22;\n}\n}\n}\nreturn v24;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,a7,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,sub_4027F0,sub_401664,sub_402155,sub_401BAD,]", "hints": "[]", "response": "{'a3': 'buffer', 'a4': 'bufsize', 'a1': 'str', 'a2': 'strlen', 'a5': 'options', 'a6': 'custom_func', 'a7': 'custom_data', 'v15': 'boundclass', 'v16': 'uc', 'v17': 'property2', 'v18': 'property1', 'v19': 'uc2', 'v20': 'uc1', 'v21': 'decomp_result', 'v22': 'pos', 'v23': 'rpos', 'v24': 'wpos', 'sub_4027F0': 'utf8proc_decompose_custom', 'sub_401664': 'utf8proc_iterate', 'sub_402155': 'utf8proc_decompose_char', 'sub_401BAD': 'unsafe_get_property'}"} | [
[
0.7800615429878235,
0.7605679631233215,
0.7516369819641113,
0.7378685474395752,
0.7218246459960938,
0.7176206111907959,
0.717315673828125,
0.7171123623847961,
0.7162584066390991,
0.7156825661659241,
0.7155342102050781,
0.712317705154419,
0.7088049650192261,
0.7061271667480469,
0.706092357635498,
0.7060197591781616,
0.7042703628540039,
0.7035300135612488,
0.6970629096031189,
0.694844126701355
],
[
249906,
4038,
253618,
61923,
151522,
55404,
101202,
73676,
101437,
246398,
157251,
33425,
122312,
155383,
154757,
199544,
178041,
1763,
57004,
8888
]
] |
|
qrpc_clnt_raw_call_recv | f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329 | coolsnowwolf | lede | NA | static int qrpc_clnt_raw_call_recv(struct qrpc_clnt_raw_priv *const priv)
{
struct pollfd fds;
struct sockaddr_ll lladdr;
socklen_t addrlen = sizeof(lladdr);
int ret;
uint16_t payload_done = sizeof(struct qrpc_frame_hdr);
struct qrpc_frame_hdr hdr;
do {
fds.fd = priv->raw_sock;
fds.events = POLLIN;
do {
ret = poll(&fds, 1, QRPC_CLNT_RAW_POLL_TIMEOUT);
} while (ret < 0 && errno == EINTR);
if (!ret) {
priv->rpc_error.re_status = RPC_TIMEDOUT;
return -1;
}
if (ret < 0) {
priv->rpc_error.re_status = RPC_SYSTEMERROR;
return -1;
}
do {
ret = recvfrom(priv->raw_sock, priv->in_pktbuf, ETH_FRAME_LEN,
0, (struct sockaddr *)&lladdr, &addrlen);
} while (ret < 0 && errno == EINTR);
if (lladdr.sll_pkttype != PACKET_HOST) {
priv->rpc_error.re_status = RPC_TIMEDOUT;
return -1;
}
if ((ret < (int)sizeof(struct qrpc_frame_hdr))
|| (ret - sizeof(struct qrpc_frame_hdr) + payload_done > QRPC_BUFFER_LEN)) {
priv->rpc_error.re_status = RPC_CANTRECV;
return -1;
}
/* assemble the buffer */
memcpy(&hdr, priv->in_pktbuf, sizeof(struct qrpc_frame_hdr));
memcpy(priv->inbuf + payload_done, priv->in_pktbuf + sizeof(struct qrpc_frame_hdr),
ret - sizeof(struct qrpc_frame_hdr));
payload_done += (ret - sizeof(struct qrpc_frame_hdr));
} while (hdr.sub_type == QRPC_FRAME_TYPE_FRAG);
memcpy(priv->inbuf, &hdr, sizeof(struct qrpc_frame_hdr));
return 0;
} | {"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43C5F2", "function_addr": 4441586, "binary_name": "f135dfbd0480f522c5b30f41b8827c7d24102156ae270d8ce4902c6afec1c329.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 60h"], [3, "mov [rbp+var_58], rdi"], [4, "mov [rbp+addr_len], 14h"], [5, "mov [rbp+var_2], 18h"], [6, "mov rax, [rbp+var_58]"], [7, "mov eax, [rax+0CCh]"], [8, "mov [rbp+fds.fd], eax"], [9, "mov [rbp+fds.events], 1"], [10, "lea rax, [rbp+fds]"], [11, "mov edx, 1388h"], [12, "mov esi, 1"], [13, "mov rdi, rax"], [14, "call _poll"], [15, "mov [rbp+var_8], eax"], [16, "cmp [rbp+var_8], 0"], [17, "jns short loc_43C649"], [18, "call ___errno_location"], [19, "mov eax, [rax]"], [20, "cmp eax, 4"], [21, "jz short loc_43C61E"], [22, "cmp [rbp+var_8], 0"], [23, "jnz short loc_43C664"], [24, "mov rax, [rbp+var_58]"], [25, "mov dword ptr [rax+18h], 5"], [26, "mov eax, 0FFFFFFFFh"], [27, "jmp locret_43C7B5"], [28, "cmp [rbp+var_8], 0"], [29, "jns short loc_43C67F"], [30, "mov rax, [rbp+var_58]"], [31, "mov dword ptr [rax+18h], 0Ch"], [32, "mov eax, 0FFFFFFFFh"], [33, "jmp locret_43C7B5"], [34, "mov rax, [rbp+var_58]"], [35, "mov rsi, [rax+0A8h]"], [36, "mov rax, [rbp+var_58]"], [37, "mov eax, [rax+0CCh]"], [38, "lea rcx, [rbp+addr_len]"], [39, "lea rdx, [rbp+addr]"], [40, "mov r9, rcx"], [41, "mov r8, rdx"], [42, "mov ecx, 0"], [43, "mov edx, 5EAh"], [44, "mov edi, eax"], [45, "call _recvfrom"], [46, "mov [rbp+var_8], eax"], [47, "cmp [rbp+var_8], 0"], [48, "jns short loc_43C6C8"], [49, "call ___errno_location"], [50, "mov eax, [rax]"], [51, "cmp eax, 4"], [52, "jz short loc_43C67F"], [53, "movzx eax, [rbp+addr.sa_data+8]"], [54, "test al, al"], [55, "jz short loc_43C6E5"], [56, "mov rax, [rbp+var_58]"], [57, "mov dword ptr [rax+18h], 5"], [58, "mov eax, 0FFFFFFFFh"], [59, "jmp locret_43C7B5"], [60, "cmp [rbp+var_8], 17h"], [61, "jle short loc_43C704"], [62, "mov eax, [rbp+var_8]"], [63, "movsxd rdx, eax"], [64, "movzx eax, [rbp+var_2]"], [65, "add rax, rdx"], [66, "sub rax, 18h"], [67, "cmp rax, 4000h"], [68, "jbe short loc_43C719"], [69, "mov rax, [rbp+var_58]"], [70, "mov dword ptr [rax+18h], 4"], [71, "mov eax, 0FFFFFFFFh"], [72, "jmp locret_43C7B5"], [73, "mov rax, [rbp+var_58]"], [74, "mov rcx, [rax+0A8h]"], [75, "mov rax, [rcx]"], [76, "mov rdx, [rcx+8]"], [77, "mov [rbp+var_50], rax"], [78, "mov [rbp+var_48], rdx"], [79, "mov rax, [rcx+10h]"], [80, "mov [rbp+var_40], rax"], [81, "mov eax, [rbp+var_8]"], [82, "cdqe"], [83, "lea rdx, [rax-18h]"], [84, "mov rax, [rbp+var_58]"], [85, "mov rax, [rax+0A8h]"], [86, "lea rcx, [rax+18h]"], [87, "mov rax, [rbp+var_58]"], [88, "mov rsi, [rax+0A0h]"], [89, "movzx eax, [rbp+var_2]"], [90, "add rax, rsi"], [91, "mov rsi, rcx"], [92, "mov rdi, rax"], [93, "call _memcpy"], [94, "mov eax, [rbp+var_8]"], [95, "mov edx, eax"], [96, "movzx eax, [rbp+var_2]"], [97, "add eax, edx"], [98, "sub eax, 18h"], [99, "mov [rbp+var_2], ax"], [100, "movzx eax, byte ptr [rbp+var_40+4]"], [101, "cmp al, 5"], [102, "jz loc_43C60B"], [103, "mov rax, [rbp+var_58]"], [104, "mov rcx, [rax+0A0h]"], [105, "mov rax, [rbp+var_50]"], [106, "mov rdx, [rbp+var_48]"], [107, "mov [rcx], rax"], [108, "mov [rcx+8], rdx"], [109, "mov rax, [rbp+var_40]"], [110, "mov [rcx+10h], rax"], [111, "mov eax, 0"], [112, "leave"], [113, "retn"]], "data_dep": [[6, 3], [7, 6], [8, 7], [10, 19], [10, 7], [13, 10], [15, 14], [16, 15], [17, 16], [19, 18], [20, 19], [21, 20], [22, 15], [23, 22], [24, 3], [25, 24], [28, 15], [29, 28], [30, 3], [31, 30], [34, 3], [35, 34], [36, 3], [37, 36], [38, 4], [38, 86], [38, 42], [39, 11], [39, 43], [40, 38], [41, 39], [44, 37], [46, 45], [47, 46], [48, 47], [50, 49], [51, 50], [52, 51], [54, 53], [55, 54], [56, 3], [57, 56], [60, 46], [61, 60], [62, 46], [63, 62], [64, 5], [64, 99], [65, 63], [65, 64], [66, 65], [67, 66], [68, 67], [69, 3], [70, 69], [73, 3], [74, 73], [75, 74], [76, 74], [77, 75], [78, 76], [79, 74], [80, 79], [81, 46], [83, 76], [83, 81], [84, 3], [85, 84], [86, 74], [86, 85], [87, 3], [88, 87], [89, 99], [89, 5], [90, 88], [90, 89], [91, 86], [92, 90], [94, 46], [95, 94], [96, 99], [96, 5], [97, 95], [97, 96], [98, 97], [99, 98], [101, 100], [102, 101], [103, 3], [104, 103], [105, 77], [106, 78], [107, 104], [107, 105], [108, 104], [108, 106], [109, 80], [110, 109], [110, 104], [113, 26], [113, 32], [113, 71], [113, 111], [113, 58]]}
| {"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_43C5F2", "query": "\n\n\n__int64 __fastcall sub_43C5F2(__int64 a1)\n{\n__int64 *v2; // rcx\n_QWORD *v3; // rcx\n__int64 v4; // [rsp+10h] [rbp-50h]\n__int64 v5; // [rsp+18h] [rbp-48h]\n__int64 v6; // [rsp+20h] [rbp-40h]\nsocklen_t addr_len; // [rsp+2Ch] [rbp-34h] BYREF\nstruct sockaddr addr; // [rsp+30h] [rbp-30h] BYREF\nstruct pollfd fds; // [rsp+50h] [rbp-10h] BYREF\nint v10; // [rsp+58h] [rbp-8h]\nunsigned __int16 v11; // [rsp+5Eh] [rbp-2h]\n\naddr_len = 20;\nv11 = 24;\ndo\n{\nfds.fd = *(_DWORD *)(a1 + 204);\nfds.events = 1;\ndo\nv10 = poll(&fds, 1uLL, 5000);\nwhile ( v10 < 0 && *__errno_location() == 4 );\nif ( !v10 )\n{\n*(_DWORD *)(a1 + 24) = 5;\nreturn 0xFFFFFFFFLL;\n}\nif ( v10 < 0 )\n{\n*(_DWORD *)(a1 + 24) = 12;\nreturn 0xFFFFFFFFLL;\n}\ndo\nv10 = recvfrom(*(_DWORD *)(a1 + 204), *(void **)(a1 + 168), 0x5EAuLL, 0, &addr, &addr_len);\nwhile ( v10 < 0 && *__errno_location() == 4 );\nif ( addr.sa_data[8] )\n{\n*(_DWORD *)(a1 + 24) = 5;\nreturn 0xFFFFFFFFLL;\n}\nif ( v10 <= 23 || v10 + (unsigned __int64)v11 - 24 > 0x4000 )\n{\n*(_DWORD *)(a1 + 24) = 4;\nreturn 0xFFFFFFFFLL;\n}\nv2 = *(__int64 **)(a1 + 168);\nv4 = *v2;\nv5 = v2[1];\nv6 = v2[2];\nmemcpy((void *)(*(_QWORD *)(a1 + 160) + v11), v2 + 3, v10 - 24LL);\nv11 = v10 + v11 - 24;\n}\nwhile ( BYTE4(v6) == 5 );\nv3 = *(_QWORD **)(a1 + 160);\n*v3 = v4;\nv3[1] = v5;\nv3[2] = v6;\nreturn 0LL;\n}\n\n\n\nQ:[a1,v4,v5,v6,addr_len,addr,v11,sub_43C5F2,]", "hints": "[]", "response": "{'a1': 'priv', 'v4': 'hdr', 'v5': 'hdr_8', 'v6': 'hdr_16', 'addr_len': 'addrlen', 'addr': 'lladdr', 'v11': 'payload_done', 'sub_43C5F2': 'qrpc_clnt_raw_call_recv'}"} | [
[
0.7219809293746948,
0.7166790962219238,
0.7116113901138306,
0.7093908786773682,
0.7089152336120605,
0.7054456472396851,
0.7046383619308472,
0.7030044794082642,
0.7002408504486084,
0.6999844908714294,
0.6954131126403809,
0.6936333179473877,
0.6919338703155518,
0.6919187903404236,
0.6914647221565247,
0.6894408464431763,
0.6891121864318848,
0.6863583922386169,
0.6798183917999268,
0.6785213947296143
],
[
231232,
147887,
179114,
21656,
210484,
101,
179729,
166946,
23604,
7884,
178959,
210821,
198978,
138831,
57679,
221292,
76207,
131609,
232807,
244718
]
] |