function_name
stringlengths
1
87
binary_name
stringlengths
64
64
author_name
stringlengths
2
36
project_name
stringlengths
1
48
opt
stringclasses
1 value
src
stringlengths
11
425k
dbg
stringclasses
1 value
codeart
stringlengths
257
560k
lmpa
stringlengths
619
152k
main_lorenz
18ba826ac31830a73aba61dc9990ca60507abe36300168b1d3124d77e38500a7
lh3
lianti
NA
int main_lorenz(int argc, char *argv[]) { bam_plp_t plp; BGZF *fp; bam_hdr_t *h; const bam_pileup1_t *p; int i, c, n_plp, tid, pos, step = 1000; uint64_t *cnt, bed_len = 0, sum_partial = 0, cov = 0, tot = 0, tot_partial = 0; void *bed = 0; while ((c = getopt(argc, argv, "b:s:")) >= 0) { if (c == 'b') { bed = bed_read(optarg); bed_len = bed_totlen(bed); fprintf(stderr, "[M::%s] total length in BED: %ld\n", __func__, (long)bed_len); } else if (c == 's') step = atoi(optarg); } if (optind == argc) { fprintf(stderr, "Usage: lianti lorenz [-b bed] [-s step=%d] <aln.bam>\n", step); return 1; } cnt = (uint64_t*)calloc(MAX_DEPTH + 1, sizeof(uint64_t)); fp = bgzf_open(argv[optind], "r"); h = bam_hdr_read(fp); plp = bam_plp_init((bam_plp_auto_f)bam_read1, fp); while ((p = bam_plp_auto(plp, &tid, &pos, &n_plp)) != 0) { if (bed_overlap(bed, h->target_name[tid], pos, pos + 1)) ++cnt[n_plp < MAX_DEPTH? n_plp : MAX_DEPTH]; } for (i = 1; i <= MAX_DEPTH; ++i) cov += cnt[i]; cnt[0] = bed_len - cov; for (i = 0; i <= MAX_DEPTH; ++i) tot += cnt[i] * i; bam_plp_destroy(plp); printf("%.4f\t%.4f\n", 0., 0.); for (i = 0, sum_partial = tot_partial = 0; i <= MAX_DEPTH; ++i) { if (cnt[i] <= step) { sum_partial += cnt[i], tot_partial += i * cnt[i]; printf("%.4f\t%.4f\n", (double)sum_partial / bed_len, (double)tot_partial / tot); } else { uint64_t rest = cnt[i]; while (rest) { int x = rest < step? rest : step; sum_partial += x, tot_partial += i * x; printf("%.4f\t%.4f\n", (double)sum_partial / bed_len, (double)tot_partial / tot); rest -= x; } } } bam_hdr_destroy(h); bgzf_close(fp); free(cnt); if (bed) bed_destroy(bed); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_430613", "function_addr": 4392467, "binary_name": "18ba826ac31830a73aba61dc9990ca60507abe36300168b1d3124d77e38500a7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+argc], edi"], [4, "mov [rbp+argv], rsi"], [5, "mov [rbp+var_8], 3E8h"], [6, "mov [rbp+var_10], 0"], [7, "mov [rbp+var_18], 0"], [8, "mov [rbp+var_20], 0"], [9, "mov [rbp+var_28], 0"], [10, "mov [rbp+var_30], 0"], [11, "mov [rbp+var_38], 0"], [12, "jmp short loc_4306CC"], [13, "cmp [rbp+var_44], 62h "], [14, "jnz short loc_4306B4"], [15, "mov rax, cs:optarg"], [16, "mov rdi, rax"], [17, "call sub_40F80C"], [18, "mov [rbp+var_38], rax"], [19, "mov rax, [rbp+var_38]"], [20, "mov rdi, rax"], [21, "call sub_40F29E"], [22, "mov [rbp+var_10], rax"], [23, "mov rdx, [rbp+var_10]"], [24, "mov rax, cs:stderr"], [25, "mov rcx, rdx"], [26, "mov edx, offset aMainLorenz"], [27, "mov esi, offset aMSTotalLengthI"], [28, "mov rdi, rax"], [29, "mov eax, 0"], [30, "call _fprintf"], [31, "jmp short loc_4306CC"], [32, "cmp [rbp+var_44], 73h "], [33, "jnz short loc_4306CC"], [34, "mov rax, cs:optarg"], [35, "mov rdi, rax"], [36, "call _atoi"], [37, "mov [rbp+var_8], eax"], [38, "mov rcx, [rbp+argv]"], [39, "mov eax, [rbp+argc]"], [40, "mov edx, offset aBS"], [41, "mov rsi, rcx"], [42, "mov edi, eax"], [43, "call _getopt"], [44, "mov [rbp+var_44], eax"], [45, "cmp [rbp+var_44], 0"], [46, "jns loc_430664"], [47, "mov eax, cs:optind"], [48, "cmp [rbp+argc], eax"], [49, "jnz short loc_430729"], [50, "mov rax, cs:stderr"], [51, "mov edx, [rbp+var_8]"], [52, "mov esi, offset aUsageLiantiLor"], [53, "mov rdi, rax"], [54, "mov eax, 0"], [55, "call _fprintf"], [56, "mov eax, 1"], [57, "jmp locret_430B9F"], [58, "mov esi, 8"], [59, "mov edi, 2711h"], [60, "call _calloc"], [61, "mov [rbp+ptr], rax"], [62, "mov eax, cs:optind"], [63, "cdqe"], [64, "lea rdx, ds:0[rax*8]"], [65, "mov rax, [rbp+argv]"], [66, "add rax, rdx"], [67, "mov rax, [rax]"], [68, "mov esi, offset aR_9"], [69, "mov rdi, rax"], [70, "call sub_4030B8"], [71, "mov [rbp+var_58], rax"], [72, "mov rax, [rbp+var_58]"], [73, "mov rdi, rax"], [74, "call sub_411F78"], [75, "mov [rbp+var_60], rax"], [76, "mov rax, [rbp+var_58]"], [77, "mov rsi, rax"], [78, "mov edi, offset sub_412A69"], [79, "call sub_4170B4"], [80, "mov [rbp+var_68], rax"], [81, "jmp short loc_4307F0"], [82, "mov eax, [rbp+var_80]"], [83, "lea ecx, [rax+1]"], [84, "mov edx, [rbp+var_80]"], [85, "mov rax, [rbp+var_60]"], [86, "mov rsi, [rax+20h]"], [87, "mov eax, [rbp+var_7C]"], [88, "cdqe"], [89, "shl rax, 3"], [90, "add rax, rsi"], [91, "mov rsi, [rax]"], [92, "mov rax, [rbp+var_38]"], [93, "mov rdi, rax"], [94, "call sub_40F78B"], [95, "test eax, eax"], [96, "jz short loc_4307F0"], [97, "mov eax, [rbp+var_78]"], [98, "cmp eax, 270Fh"], [99, "jg short loc_4307DA"], [100, "mov eax, [rbp+var_78]"], [101, "cdqe"], [102, "lea rdx, ds:0[rax*8]"], [103, "jmp short loc_4307DF"], [104, "mov edx, 13880h"], [105, "mov rax, [rbp+ptr]"], [106, "add rax, rdx"], [107, "mov rdx, [rax]"], [108, "add rdx, 1"], [109, "mov [rax], rdx"], [110, "lea rcx, [rbp+var_78]"], [111, "lea rdx, [rbp+var_80]"], [112, "lea rsi, [rbp+var_7C]"], [113, "mov rax, [rbp+var_68]"], [114, "mov rdi, rax"], [115, "call sub_417875"], [116, "mov [rbp+var_70], rax"], [117, "cmp [rbp+var_70], 0"], [118, "jnz loc_430791"], [119, "mov [rbp+var_4], 1"], [120, "jmp short loc_43083F"], [121, "mov eax, [rbp+var_4]"], [122, "cdqe"], [123, "lea rdx, ds:0[rax*8]"], [124, "mov rax, [rbp+ptr]"], [125, "add rax, rdx"], [126, "mov rax, [rax]"], [127, "add [rbp+var_20], rax"], [128, "add [rbp+var_4], 1"], [129, "cmp [rbp+var_4], 2710h"], [130, "jle short loc_430820"], [131, "mov rax, [rbp+var_10]"], [132, "sub rax, [rbp+var_20]"], [133, "mov rdx, rax"], [134, "mov rax, [rbp+ptr]"], [135, "mov [rax], rdx"], [136, "mov [rbp+var_4], 0"], [137, "jmp short loc_43088B"], [138, "mov eax, [rbp+var_4]"], [139, "cdqe"], [140, "lea rdx, ds:0[rax*8]"], [141, "mov rax, [rbp+ptr]"], [142, "add rax, rdx"], [143, "mov rdx, [rax]"], [144, "mov eax, [rbp+var_4]"], [145, "cdqe"], [146, "imul rax, rdx"], [147, "add [rbp+var_28], rax"], [148, "add [rbp+var_4], 1"], [149, "cmp [rbp+var_4], 2710h"], [150, "jle short loc_430863"], [151, "mov rax, [rbp+var_68]"], [152, "mov rdi, rax"], [153, "call sub_417187"], [154, "pxor xmm1, xmm1"], [155, "pxor xmm0, xmm0"], [156, "mov edi, offset a4f4f"], [157, "mov eax, 2"], [158, "call _printf"], [159, "mov [rbp+var_4], 0"], [160, "mov [rbp+var_30], 0"], [161, "mov rax, [rbp+var_30]"], [162, "mov [rbp+var_18], rax"], [163, "jmp loc_430B56"], [164, "mov eax, [rbp+var_4]"], [165, "cdqe"], [166, "lea rdx, ds:0[rax*8]"], [167, "mov rax, [rbp+ptr]"], [168, "add rax, rdx"], [169, "mov rdx, [rax]"], [170, "mov eax, [rbp+var_8]"], [171, "cdqe"], [172, "cmp rdx, rax"], [173, "ja loc_430A1A"], [174, "mov eax, [rbp+var_4]"], [175, "cdqe"], [176, "lea rdx, ds:0[rax*8]"], [177, "mov rax, [rbp+ptr]"], [178, "add rax, rdx"], [179, "mov rax, [rax]"], [180, "add [rbp+var_18], rax"], [181, "mov eax, [rbp+var_4]"], [182, "movsxd rdx, eax"], [183, "mov eax, [rbp+var_4]"], [184, "cdqe"], [185, "lea rcx, ds:0[rax*8]"], [186, "mov rax, [rbp+ptr]"], [187, "add rax, rcx"], [188, "mov rax, [rax]"], [189, "imul rax, rdx"], [190, "add [rbp+var_30], rax"], [191, "mov rax, [rbp+var_30]"], [192, "test rax, rax"], [193, "js short loc_43094C"], [194, "pxor xmm0, xmm0"], [195, "cvtsi2sd xmm0, rax"], [196, "jmp short loc_430965"], [197, "mov rdx, rax"], [198, "shr rdx, 1"], [199, "and eax, 1"], [200, "or rdx, rax"], [201, "pxor xmm0, xmm0"], [202, "cvtsi2sd xmm0, rdx"], [203, "addsd xmm0, xmm0"], [204, "mov rax, [rbp+var_28]"], [205, "test rax, rax"], [206, "js short loc_430979"], [207, "pxor xmm1, xmm1"], [208, "cvtsi2sd xmm1, rax"], [209, "jmp short loc_430992"], [210, "mov rdx, rax"], [211, "shr rdx, 1"], [212, "and eax, 1"], [213, "or rdx, rax"], [214, "pxor xmm1, xmm1"], [215, "cvtsi2sd xmm1, rdx"], [216, "addsd xmm1, xmm1"], [217, "movapd xmm2, xmm0"], [218, "divsd xmm2, xmm1"], [219, "mov rax, [rbp+var_18]"], [220, "test rax, rax"], [221, "js short loc_4309AE"], [222, "pxor xmm0, xmm0"], [223, "cvtsi2sd xmm0, rax"], [224, "jmp short loc_4309C7"], [225, "mov rdx, rax"], [226, "shr rdx, 1"], [227, "and eax, 1"], [228, "or rdx, rax"], [229, "pxor xmm0, xmm0"], [230, "cvtsi2sd xmm0, rdx"], [231, "addsd xmm0, xmm0"], [232, "mov rax, [rbp+var_10]"], [233, "test rax, rax"], [234, "js short loc_4309DB"], [235, "pxor xmm1, xmm1"], [236, "cvtsi2sd xmm1, rax"], [237, "jmp short loc_4309F4"], [238, "mov rdx, rax"], [239, "shr rdx, 1"], [240, "and eax, 1"], [241, "or rdx, rax"], [242, "pxor xmm1, xmm1"], [243, "cvtsi2sd xmm1, rdx"], [244, "addsd xmm1, xmm1"], [245, "divsd xmm0, xmm1"], [246, "movq rax, xmm0"], [247, "movapd xmm1, xmm2"], [248, "movq xmm0, rax"], [249, "mov edi, offset a4f4f"], [250, "mov eax, 2"], [251, "call _printf"], [252, "jmp loc_430B52"], [253, "mov eax, [rbp+var_4]"], [254, "cdqe"], [255, "lea rdx, ds:0[rax*8]"], [256, "mov rax, [rbp+ptr]"], [257, "add rax, rdx"], [258, "mov rax, [rax]"], [259, "mov [rbp+var_40], rax"], [260, "jmp loc_430B47"], [261, "mov eax, [rbp+var_8]"], [262, "cdqe"], [263, "cmp [rbp+var_40], rax"], [264, "cmovbe rax, [rbp+var_40]"], [265, "mov [rbp+var_74], eax"], [266, "mov eax, [rbp+var_74]"], [267, "cdqe"], [268, "add [rbp+var_18], rax"], [269, "mov eax, [rbp+var_4]"], [270, "imul eax, [rbp+var_74]"], [271, "cdqe"], [272, "add [rbp+var_30], rax"], [273, "mov rax, [rbp+var_30]"], [274, "test rax, rax"], [275, "js short loc_430A75"], [276, "pxor xmm0, xmm0"], [277, "cvtsi2sd xmm0, rax"], [278, "jmp short loc_430A8E"], [279, "mov rdx, rax"], [280, "shr rdx, 1"], [281, "and eax, 1"], [282, "or rdx, rax"], [283, "pxor xmm0, xmm0"], [284, "cvtsi2sd xmm0, rdx"], [285, "addsd xmm0, xmm0"], [286, "mov rax, [rbp+var_28]"], [287, "test rax, rax"], [288, "js short loc_430AA2"], [289, "pxor xmm1, xmm1"], [290, "cvtsi2sd xmm1, rax"], [291, "jmp short loc_430ABB"], [292, "mov rdx, rax"], [293, "shr rdx, 1"], [294, "and eax, 1"], [295, "or rdx, rax"], [296, "pxor xmm1, xmm1"], [297, "cvtsi2sd xmm1, rdx"], [298, "addsd xmm1, xmm1"], [299, "movapd xmm2, xmm0"], [300, "divsd xmm2, xmm1"], [301, "mov rax, [rbp+var_18]"], [302, "test rax, rax"], [303, "js short loc_430AD7"], [304, "pxor xmm0, xmm0"], [305, "cvtsi2sd xmm0, rax"], [306, "jmp short loc_430AF0"], [307, "mov rdx, rax"], [308, "shr rdx, 1"], [309, "and eax, 1"], [310, "or rdx, rax"], [311, "pxor xmm0, xmm0"], [312, "cvtsi2sd xmm0, rdx"], [313, "addsd xmm0, xmm0"], [314, "mov rax, [rbp+var_10]"], [315, "test rax, rax"], [316, "js short loc_430B04"], [317, "pxor xmm1, xmm1"], [318, "cvtsi2sd xmm1, rax"], [319, "jmp short loc_430B1D"], [320, "mov rdx, rax"], [321, "shr rdx, 1"], [322, "and eax, 1"], [323, "or rdx, rax"], [324, "pxor xmm1, xmm1"], [325, "cvtsi2sd xmm1, rdx"], [326, "addsd xmm1, xmm1"], [327, "divsd xmm0, xmm1"], [328, "movq rax, xmm0"], [329, "movapd xmm1, xmm2"], [330, "movq xmm0, rax"], [331, "mov edi, offset a4f4f"], [332, "mov eax, 2"], [333, "call _printf"], [334, "mov eax, [rbp+var_74]"], [335, "cdqe"], [336, "sub [rbp+var_40], rax"], [337, "cmp [rbp+var_40], 0"], [338, "jnz loc_430A3A"], [339, "add [rbp+var_4], 1"], [340, "cmp [rbp+var_4], 2710h"], [341, "jle loc_4308D3"], [342, "mov rax, [rbp+var_60]"], [343, "mov rdi, rax"], [344, "call sub_411D2A"], [345, "mov rax, [rbp+var_58]"], [346, "mov rdi, rax"], [347, "call sub_4046AD"], [348, "mov rax, [rbp+ptr]"], [349, "mov rdi, rax"], [350, "call _free"], [351, "cmp [rbp+var_38], 0"], [352, "jz short loc_430B9A"], [353, "mov rax, [rbp+var_38]"], [354, "mov rdi, rax"], [355, "call sub_40FB87"], [356, "mov eax, 0"], [357, "leave"], [358, "retn"]], "data_dep": [[13, 44], [14, 13], [16, 15], [18, 17], [19, 18], [20, 19], [22, 21], [23, 22], [25, 23], [28, 24], [32, 44], [33, 32], [35, 34], [37, 36], [38, 4], [39, 3], [41, 38], [42, 39], [44, 43], [45, 44], [46, 45], [48, 3], [48, 47], [49, 48], [51, 37], [51, 5], [53, 50], [61, 60], [64, 40], [65, 4], [66, 65], [66, 64], [67, 66], [69, 67], [71, 70], [72, 71], [73, 72], [75, 74], [76, 71], [77, 76], [80, 79], [83, 109], [83, 110], [83, 82], [85, 75], [86, 109], [86, 85], [89, 87], [90, 86], [90, 89], [91, 109], [91, 90], [92, 11], [92, 18], [93, 92], [95, 94], [96, 95], [98, 97], [99, 98], [102, 84], [105, 61], [106, 102], [106, 105], [106, 104], [107, 106], [107, 109], [108, 107], [109, 106], [109, 108], [110, 38], [110, 83], [111, 64], [111, 108], [111, 84], [112, 91], [112, 77], [113, 80], [114, 113], [116, 115], [117, 116], [118, 117], [121, 119], [121, 128], [123, 111], [123, 123], [124, 61], [125, 124], [125, 123], [126, 125], [126, 109], [127, 127], [127, 126], [127, 8], [128, 119], [128, 128], [129, 128], [129, 119], [130, 129], [131, 22], [131, 6], [132, 127], [132, 131], [132, 8], [133, 132], [134, 61], [135, 134], [135, 133], [138, 136], [138, 148], [140, 143], [140, 133], [141, 61], [142, 140], [142, 141], [143, 135], [143, 142], [143, 109], [144, 136], [144, 148], [146, 144], [146, 143], [147, 9], [147, 147], [147, 146], [148, 136], [148, 148], [149, 136], [149, 148], [150, 149], [151, 80], [152, 151], [161, 160], [162, 161], [164, 339], [164, 159], [166, 143], [166, 255], [166, 282], [166, 241], [166, 133], [166, 213], [166, 310], [166, 323], [166, 295], [166, 228], [166, 182], [166, 200], [167, 61], [168, 167], [168, 166], [169, 109], [169, 168], [169, 135], [170, 5], [170, 37], [172, 170], [172, 169], [173, 172], [174, 159], [174, 339], [176, 169], [177, 61], [178, 177], [178, 176], [179, 178], [179, 109], [179, 135], [180, 162], [180, 268], [180, 180], [180, 179], [181, 159], [181, 339], [182, 181], [183, 339], [183, 159], [185, 110], [185, 185], [186, 61], [187, 186], [187, 185], [188, 187], [188, 109], [188, 135], [189, 182], [189, 188], [190, 189], [190, 160], [190, 272], [190, 190], [191, 190], [192, 191], [193, 192], [195, 192], [195, 194], [197, 192], [198, 197], [199, 192], [200, 199], [200, 198], [202, 200], [202, 201], [203, 202], [204, 9], [204, 147], [205, 204], [206, 205], [208, 205], [208, 207], [210, 205], [211, 210], [212, 205], [213, 212], [213, 211], [215, 214], [215, 213], [216, 215], [217, 203], [217, 195], [218, 208], [218, 217], [218, 216], [219, 180], [220, 219], [221, 220], [223, 222], [223, 220], [225, 220], [226, 225], [227, 220], [228, 226], [228, 227], [230, 229], [230, 228], [231, 230], [232, 22], [232, 6], [233, 232], [234, 233], [236, 235], [236, 233], [238, 233], [239, 238], [240, 233], [241, 240], [241, 239], [243, 242], [243, 241], [244, 243], [245, 236], [245, 231], [245, 244], [245, 223], [246, 245], [247, 218], [248, 246], [253, 159], [253, 339], [255, 169], [256, 61], [257, 256], [257, 255], [258, 109], [258, 257], [258, 135], [259, 258], [261, 37], [261, 5], [263, 336], [263, 261], [263, 259], [264, 259], [264, 263], [264, 336], [265, 264], [266, 265], [268, 266], [268, 162], [268, 180], [268, 268], [269, 159], [269, 339], [270, 265], [270, 269], [272, 272], [272, 160], [272, 270], [272, 190], [273, 272], [274, 273], [275, 274], [277, 276], [277, 274], [279, 274], [280, 279], [281, 274], [282, 280], [282, 281], [284, 283], [284, 282], [285, 284], [286, 147], [286, 9], [287, 286], [288, 287], [290, 289], [290, 287], [292, 287], [293, 292], [294, 287], [295, 294], [295, 293], [297, 296], [297, 295], [298, 297], [299, 277], [299, 285], [300, 290], [300, 299], [300, 298], [301, 268], [302, 301], [303, 302], [305, 302], [305, 304], [307, 302], [308, 307], [309, 302], [310, 309], [310, 308], [312, 311], [312, 310], [313, 312], [314, 22], [314, 6], [315, 314], [316, 315], [318, 315], [318, 317], [320, 315], [321, 320], [322, 315], [323, 322], [323, 321], [325, 324], [325, 323], [326, 325], [327, 305], [327, 318], [327, 313], [327, 326], [328, 327], [329, 300], [330, 328], [334, 265], [336, 334], [336, 259], [336, 336], [337, 259], [337, 336], [338, 337], [339, 159], [339, 339], [340, 159], [340, 339], [341, 340], [342, 75], [343, 342], [345, 71], [346, 345], [348, 61], [349, 348], [351, 11], [351, 18], [352, 351], [353, 11], [353, 18], [354, 353], [358, 56], [358, 356]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/18ba826ac31830a73aba61dc9990ca60507abe36300168b1d3124d77e38500a7_18ba826ac31830a73aba61dc9990ca60507abe36300168b1d3124d77e38500a7.jsonl.gz", "strip_func_name": "sub_430613", "query": "\n\n\n__int64 __fastcall sub_430613(int a1, char *const *a2)\n{\nint i; // eax\n__int64 result; // rax\n__int64 v4; // rdx\ndouble v5; // xmm0_8\ndouble v6; // xmm1_8\ndouble v7; // xmm2_8\ndouble v8; // xmm0_8\ndouble v9; // xmm1_8\nint v10; // eax\ndouble v11; // xmm0_8\ndouble v12; // xmm1_8\ndouble v13; // xmm2_8\ndouble v14; // xmm0_8\ndouble v15; // xmm1_8\nint v16; // [rsp+10h] [rbp-80h] BYREF\nint v17; // [rsp+14h] [rbp-7Ch] BYREF\nint v18; // [rsp+18h] [rbp-78h] BYREF\nint v19; // [rsp+1Ch] [rbp-74h]\nunsigned int **v21; // [rsp+28h] [rbp-68h]\nint *v22; // [rsp+30h] [rbp-60h]\n_BYTE *v23; // [rsp+38h] [rbp-58h]\nvoid *ptr; // [rsp+40h] [rbp-50h]\nint v25; // [rsp+4Ch] [rbp-44h]\nunsigned __int64 k; // [rsp+50h] [rbp-40h]\nunsigned int *v27; // [rsp+58h] [rbp-38h]\nunsigned __int64 v28; // [rsp+60h] [rbp-30h]\nunsigned __int64 v29; // [rsp+68h] [rbp-28h]\n__int64 v30; // [rsp+70h] [rbp-20h]\nunsigned __int64 v31; // [rsp+78h] [rbp-18h]\nunsigned __int64 v32; // [rsp+80h] [rbp-10h]\nunsigned int v33; // [rsp+88h] [rbp-8h]\nint j; // [rsp+8Ch] [rbp-4h]\n\nv33 = 1000;\nv32 = 0LL;\nv31 = 0LL;\nv30 = 0LL;\nv29 = 0LL;\nv28 = 0LL;\nv27 = 0LL;\nfor ( i = getopt(a1, a2, \"b:s:\"); ; i = getopt(a1, a2, \"b:s:\") )\n{\nv25 = i;\nif ( i < 0 )\nbreak;\nif ( v25 == 98 )\n{\nv27 = sub_40F80C(optarg);\nv32 = sub_40F29E((__int64)v27);\nfprintf(stderr, \"[M::%s] total length in BED: %ld\\n\", \"main_lorenz\", v32);\n}\nelse if ( v25 == 115 )\n{\nv33 = atoi(optarg);\n}\n}\nif ( a1 == optind )\n{\nfprintf(stderr, \"Usage: lianti lorenz [-b bed] [-s step=%d] <aln.bam>\\n\", v33);\nresult = 1LL;\n}\nelse\n{\nptr = calloc(0x2711uLL, 8uLL);\nv23 = sub_4030B8(a2[optind], \"r\");\nv22 = sub_411F78((__int64)v23);\nv21 = (unsigned int **)sub_4170B4((__int64)sub_412A69, (__int64)v23);\nwhile ( sub_417875((__int64)v21, &v17, &v16, &v18) )\n{\nif ( (unsigned int)sub_40F78B(v27, *(char **)(*((_QWORD *)v22 + 4) + 8LL * v17), v16, v16 + 1) )\n{\nif ( v18 > 9999 )\nv4 = 80000LL;\nelse\nv4 = 8LL * v18;\n++*(_QWORD *)((char *)ptr + v4);\n}\n}\nfor ( j = 1; j <= 10000; ++j )\nv30 += *((_QWORD *)ptr + j);\n*(_QWORD *)ptr = v32 - v30;\nfor ( j = 0; j <= 10000; ++j )\nv29 += *((_QWORD *)ptr + j) * j;\nsub_417187(v21);\nprintf(\"%.4f\\t%.4f\\n\", 0.0, 0.0);\nj = 0;\nv28 = 0LL;\nv31 = 0LL;\nwhile ( j <= 10000 )\n{\nif ( *((_QWORD *)ptr + j) > (unsigned __int64)(int)v33 )\n{\nfor ( k = *((_QWORD *)ptr + j); k; k -= v19 )\n{\nv10 = v33;\nif ( k <= (int)v33 )\nv10 = k;\nv19 = v10;\nv31 += v10;\nv28 += v10 * j;\nif ( (v28 & 0x8000000000000000LL) != 0LL )\nv11 = (double)(int)(v28 & 1 | (v28 >> 1)) + (double)(int)(v28 & 1 | (v28 >> 1));\nelse\nv11 = (double)(int)v28;\nif ( (v29 & 0x8000000000000000LL) != 0LL )\nv12 = (double)(int)(v29 & 1 | (v29 >> 1)) + (double)(int)(v29 & 1 | (v29 >> 1));\nelse\nv12 = (double)(int)v29;\nv13 = v11 / v12;\nif ( (v31 & 0x8000000000000000LL) != 0LL )\nv14 = (double)(int)(v31 & 1 | (v31 >> 1)) + (double)(int)(v31 & 1 | (v31 >> 1));\nelse\nv14 = (double)(int)v31;\nif ( (v32 & 0x8000000000000000LL) != 0LL )\nv15 = (double)(int)(v32 & 1 | (v32 >> 1)) + (double)(int)(v32 & 1 | (v32 >> 1));\nelse\nv15 = (double)(int)v32;\nprintf(\"%.4f\\t%.4f\\n\", v14 / v15, v13);\n}\n}\nelse\n{\nv31 += *((_QWORD *)ptr + j);\nv28 += j * *((_QWORD *)ptr + j);\nif ( (v28 & 0x8000000000000000LL) != 0LL )\nv5 = (double)(int)(v28 & 1 | (v28 >> 1)) + (double)(int)(v28 & 1 | (v28 >> 1));\nelse\nv5 = (double)(int)v28;\nif ( (v29 & 0x8000000000000000LL) != 0LL )\nv6 = (double)(int)(v29 & 1 | (v29 >> 1)) + (double)(int)(v29 & 1 | (v29 >> 1));\nelse\nv6 = (double)(int)v29;\nv7 = v5 / v6;\nif ( (v31 & 0x8000000000000000LL) != 0LL )\nv8 = (double)(int)(v31 & 1 | (v31 >> 1)) + (double)(int)(v31 & 1 | (v31 >> 1));\nelse\nv8 = (double)(int)v31;\nif ( (v32 & 0x8000000000000000LL) != 0LL )\nv9 = (double)(int)(v32 & 1 | (v32 >> 1)) + (double)(int)(v32 & 1 | (v32 >> 1));\nelse\nv9 = (double)(int)v32;\nprintf(\"%.4f\\t%.4f\\n\", v8 / v9, v7);\n}\n++j;\n}\nsub_411D2A(v22);\nsub_4046AD((__int64)v23);\nfree(ptr);\nif ( v27 )\nsub_40FB87((__int64)v27);\nresult = 0LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v16,v17,v18,v19,v21,v22,v23,ptr,v25,k,v27,v28,v29,v30,v31,v32,v33,sub_430613,sub_40F80C,sub_40F29E,sub_4030B8,sub_411F78,sub_4170B4,sub_412A69,sub_417875,sub_40F78B,sub_417187,sub_411D2A,sub_4046AD,sub_40FB87,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'argc', 'a2': 'argv', 'v16': 'pos', 'v17': 'tid', 'v18': 'n_plp', 'v19': 'x', 'v21': 'plp', 'v22': 'h', 'v23': 'fp', 'ptr': 'cnt', 'v25': 'c', 'k': 'rest', 'v27': 'bed', 'v28': 'tot_partial', 'v29': 'tot', 'v30': 'cov', 'v31': 'sum_partial', 'v32': 'bed_len', 'v33': 'step', 'sub_430613': 'main_lorenz', 'sub_40F80C': 'bed_read', 'sub_40F29E': 'bed_totlen', 'sub_4030B8': 'bgzf_open', 'sub_411F78': 'bam_hdr_read', 'sub_4170B4': 'bam_plp_init', 'sub_412A69': 'bam_read1', 'sub_417875': 'bam_plp_auto', 'sub_40F78B': 'bed_overlap', 'sub_417187': 'bam_plp_destroy', 'sub_411D2A': 'bam_hdr_destroy', 'sub_4046AD': 'bgzf_close', 'sub_40FB87': 'bed_destroy'}"}
raw_close
cc7eb91bd0d1f267d417b082eda72b746468e69048449bb22bfbc4468f0e77da
aclements
mtrace
NA
static void raw_close(BlockDriverState *bs) { BDRVRawState *s = bs->opaque; if (s->fd >= 0) { close(s->fd); s->fd = -1; if (s->aligned_buf != NULL) qemu_vfree(s->aligned_buf); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_442330", "function_addr": 4465456, "binary_name": "cc7eb91bd0d1f267d417b082eda72b746468e69048449bb22bfbc4468f0e77da.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, fs:28h"], [5, "mov [rbp+var_8], rax"], [6, "xor eax, eax"], [7, "mov rax, [rbp+var_18]"], [8, "mov rax, [rax+48h]"], [9, "mov [rbp+var_10], rax"], [10, "mov rax, [rbp+var_10]"], [11, "mov eax, [rax]"], [12, "test eax, eax"], [13, "js short loc_442395"], [14, "mov rax, [rbp+var_10]"], [15, "mov eax, [rax]"], [16, "mov edi, eax"], [17, "call _close"], [18, "mov rax, [rbp+var_10]"], [19, "mov dword ptr [rax], 0FFFFFFFFh"], [20, "mov rax, [rbp+var_10]"], [21, "mov rax, [rax+38h]"], [22, "test rax, rax"], [23, "jz short loc_442395"], [24, "mov rax, [rbp+var_10]"], [25, "mov rax, [rax+38h]"], [26, "mov rdi, rax"], [27, "call sub_4060BA"], [28, "nop"], [29, "mov rax, [rbp+var_8]"], [30, "sub rax, fs:28h"], [31, "jz short locret_4423AA"], [32, "call ___stack_chk_fail"], [33, "leave"], [34, "retn"]], "data_dep": [[5, 4], [7, 3], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 9], [15, 14], [16, 15], [18, 9], [19, 18], [20, 9], [21, 19], [21, 20], [22, 21], [23, 22], [24, 9], [25, 19], [25, 24], [26, 25], [29, 5], [30, 29], [31, 30], [34, 30]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/cc7eb91bd0d1f267d417b082eda72b746468e69048449bb22bfbc4468f0e77da_cc7eb91bd0d1f267d417b082eda72b746468e69048449bb22bfbc4468f0e77da.jsonl.gz", "strip_func_name": "sub_442330", "query": "\n\n\nunsigned __int64 __fastcall sub_442330(__int64 a1)\n{\n__int64 v2; // [rsp+10h] [rbp-10h]\nunsigned __int64 v3; // [rsp+18h] [rbp-8h]\n\nv3 = __readfsqword(0x28u);\nv2 = *(_QWORD *)(a1 + 72);\nif ( *(int *)v2 >= 0 )\n{\nclose(*(_DWORD *)v2);\n*(_DWORD *)v2 = -1;\nif ( *(_QWORD *)(v2 + 56) )\nsub_4060BA(*(void **)(v2 + 56));\n}\nreturn v3 - __readfsqword(0x28u);\n}\n\n\n\nQ:[a1,v2,sub_442330,sub_4060BA,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'bs', 'v2': 's', 'sub_442330': 'raw_close_0', 'sub_4060BA': 'qemu_vfree'}"}
HUFv07_getDTableDesc
a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821
acama
libxdisasm
NA
static DTableDesc HUFv07_getDTableDesc(const HUFv07_DTable* table) { DTableDesc dtd; memcpy(&dtd, table, sizeof(dtd)); return dtd; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43DC88", "function_addr": 4447368, "binary_name": "a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_18], rdi"], [3, "mov rax, [rbp+var_18]"], [4, "mov eax, [rax]"], [5, "mov [rbp+var_4], eax"], [6, "mov eax, [rbp+var_4]"], [7, "pop rbp"], [8, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [7, 0], [8, 6]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821_a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.jsonl.gz", "strip_func_name": "sub_43DC88", "query": "\n\n\n__int64 __fastcall sub_43DC88(unsigned int *a1)\n{\nreturn *a1;\n}\n\n\n\nQ:[a1,sub_43DC88,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'table', 'sub_43DC88': 'HUFv07_getDTableDesc'}"}
btf_type_visit_str_offs
feda8be2137e1ca53e8082ecae6cfbea19ddaf0e7963aa620ad58be1c3aa369b
intel
kvm-sgx
NA
int btf_type_visit_str_offs(struct btf_type *t, str_off_visit_fn visit, void *ctx) { int i, n, err; err = visit(&t->name_off, ctx); if (err) return err; switch (btf_kind(t)) { case BTF_KIND_STRUCT: case BTF_KIND_UNION: { struct btf_member *m = btf_members(t); for (i = 0, n = btf_vlen(t); i < n; i++, m++) { err = visit(&m->name_off, ctx); if (err) return err; } break; } case BTF_KIND_ENUM: { struct btf_enum *m = btf_enum(t); for (i = 0, n = btf_vlen(t); i < n; i++, m++) { err = visit(&m->name_off, ctx); if (err) return err; } break; } case BTF_KIND_FUNC_PROTO: { struct btf_param *m = btf_params(t); for (i = 0, n = btf_vlen(t); i < n; i++, m++) { err = visit(&m->name_off, ctx); if (err) return err; } break; } default: break; } return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42F248", "function_addr": 4387400, "binary_name": "feda8be2137e1ca53e8082ecae6cfbea19ddaf0e7963aa620ad58be1c3aa369b.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 50h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_40], rsi"], [5, "mov [rbp+var_48], rdx"], [6, "mov rax, [rbp+var_38]"], [7, "mov rdx, [rbp+var_48]"], [8, "mov rcx, [rbp+var_40]"], [9, "mov rsi, rdx"], [10, "mov rdi, rax"], [11, "call rcx"], [12, "mov [rbp+var_24], eax"], [13, "cmp [rbp+var_24], 0"], [14, "jz short loc_42F281"], [15, "mov eax, [rbp+var_24]"], [16, "jmp locret_42F3E7"], [17, "mov rax, [rbp+var_38]"], [18, "mov rdi, rax"], [19, "call sub_427027"], [20, "movzx eax, ax"], [21, "cmp eax, 0Dh"], [22, "jz loc_42F381"], [23, "cmp eax, 0Dh"], [24, "jg loc_42F3E1"], [25, "cmp eax, 5"], [26, "jg short loc_42F2B1"], [27, "cmp eax, 4"], [28, "jge short loc_42F2BB"], [29, "jmp loc_42F3E1"], [30, "cmp eax, 6"], [31, "jz short loc_42F321"], [32, "jmp loc_42F3E1"], [33, "mov rax, [rbp+var_38]"], [34, "mov rdi, rax"], [35, "call sub_427253"], [36, "mov [rbp+var_10], rax"], [37, "mov [rbp+var_4], 0"], [38, "mov rax, [rbp+var_38]"], [39, "mov rdi, rax"], [40, "call sub_42703E"], [41, "movzx eax, ax"], [42, "mov [rbp+var_28], eax"], [43, "jmp short loc_42F314"], [44, "mov rax, [rbp+var_10]"], [45, "mov rdx, [rbp+var_48]"], [46, "mov rcx, [rbp+var_40]"], [47, "mov rsi, rdx"], [48, "mov rdi, rax"], [49, "call rcx"], [50, "mov [rbp+var_24], eax"], [51, "cmp [rbp+var_24], 0"], [52, "jz short loc_42F30B"], [53, "mov eax, [rbp+var_24]"], [54, "jmp locret_42F3E7"], [55, "add [rbp+var_4], 1"], [56, "add [rbp+var_10], 0Ch"], [57, "mov eax, [rbp+var_4]"], [58, "cmp eax, [rbp+var_28]"], [59, "jl short loc_42F2E6"], [60, "jmp loc_42F3E2"], [61, "mov rax, [rbp+var_38]"], [62, "mov rdi, rax"], [63, "call sub_427241"], [64, "mov [rbp+var_18], rax"], [65, "mov [rbp+var_4], 0"], [66, "mov rax, [rbp+var_38]"], [67, "mov rdi, rax"], [68, "call sub_42703E"], [69, "movzx eax, ax"], [70, "mov [rbp+var_28], eax"], [71, "jmp short loc_42F377"], [72, "mov rax, [rbp+var_18]"], [73, "mov rdx, [rbp+var_48]"], [74, "mov rcx, [rbp+var_40]"], [75, "mov rsi, rdx"], [76, "mov rdi, rax"], [77, "call rcx"], [78, "mov [rbp+var_24], eax"], [79, "cmp [rbp+var_24], 0"], [80, "jz short loc_42F36E"], [81, "mov eax, [rbp+var_24]"], [82, "jmp short locret_42F3E7"], [83, "add [rbp+var_4], 1"], [84, "add [rbp+var_18], 8"], [85, "mov eax, [rbp+var_4]"], [86, "cmp eax, [rbp+var_28]"], [87, "jl short loc_42F34C"], [88, "jmp short loc_42F3E2"], [89, "mov rax, [rbp+var_38]"], [90, "mov rdi, rax"], [91, "call sub_427265"], [92, "mov [rbp+var_20], rax"], [93, "mov [rbp+var_4], 0"], [94, "mov rax, [rbp+var_38]"], [95, "mov rdi, rax"], [96, "call sub_42703E"], [97, "movzx eax, ax"], [98, "mov [rbp+var_28], eax"], [99, "jmp short loc_42F3D7"], [100, "mov rax, [rbp+var_20]"], [101, "mov rdx, [rbp+var_48]"], [102, "mov rcx, [rbp+var_40]"], [103, "mov rsi, rdx"], [104, "mov rdi, rax"], [105, "call rcx"], [106, "mov [rbp+var_24], eax"], [107, "cmp [rbp+var_24], 0"], [108, "jz short loc_42F3CE"], [109, "mov eax, [rbp+var_24]"], [110, "jmp short locret_42F3E7"], [111, "add [rbp+var_4], 1"], [112, "add [rbp+var_20], 8"], [113, "mov eax, [rbp+var_4]"], [114, "cmp eax, [rbp+var_28]"], [115, "jl short loc_42F3AC"], [116, "jmp short loc_42F3E2"], [117, "nop"], [118, "mov eax, 0"], [119, "leave"], [120, "retn"]], "data_dep": [[6, 3], [7, 5], [8, 4], [9, 7], [10, 6], [11, 8], [12, 11], [13, 12], [14, 13], [15, 12], [17, 3], [18, 17], [20, 19], [21, 20], [22, 21], [23, 20], [24, 23], [25, 20], [26, 25], [27, 20], [28, 27], [30, 20], [31, 30], [33, 3], [34, 33], [36, 35], [38, 3], [39, 38], [41, 40], [42, 41], [44, 36], [44, 56], [45, 5], [46, 4], [47, 45], [48, 44], [49, 46], [50, 49], [51, 50], [52, 51], [53, 50], [55, 37], [55, 55], [56, 36], [56, 56], [57, 37], [57, 55], [58, 42], [58, 57], [59, 58], [61, 3], [62, 61], [64, 63], [66, 3], [67, 66], [69, 68], [70, 69], [72, 84], [72, 64], [73, 5], [74, 4], [75, 73], [76, 72], [77, 74], [78, 77], [79, 78], [80, 79], [81, 78], [83, 65], [83, 83], [84, 84], [84, 64], [85, 65], [85, 83], [86, 85], [86, 70], [87, 86], [89, 3], [90, 89], [92, 91], [94, 3], [95, 94], [97, 96], [98, 97], [100, 92], [100, 112], [101, 5], [102, 4], [103, 101], [104, 100], [105, 102], [106, 105], [107, 106], [108, 107], [109, 106], [111, 93], [111, 111], [112, 92], [112, 112], [113, 93], [113, 111], [114, 113], [114, 98], [115, 114], [120, 81], [120, 53], [120, 15], [120, 109], [120, 118]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/feda8be2137e1ca53e8082ecae6cfbea19ddaf0e7963aa620ad58be1c3aa369b_feda8be2137e1ca53e8082ecae6cfbea19ddaf0e7963aa620ad58be1c3aa369b.jsonl.gz", "strip_func_name": "sub_42F248", "query": "\n\n\n__int64 __fastcall sub_42F248(__int64 a1, __int64 (__fastcall *a2)(__int64, __int64), __int64 a3)\n{\nint v4; // eax\nint v6; // [rsp+28h] [rbp-28h]\nint v7; // [rsp+28h] [rbp-28h]\nint v8; // [rsp+28h] [rbp-28h]\nunsigned int v9; // [rsp+2Ch] [rbp-24h]\nunsigned int v10; // [rsp+2Ch] [rbp-24h]\nunsigned int v11; // [rsp+2Ch] [rbp-24h]\nunsigned int v12; // [rsp+2Ch] [rbp-24h]\n__int64 v13; // [rsp+30h] [rbp-20h]\n__int64 v14; // [rsp+38h] [rbp-18h]\n__int64 v15; // [rsp+40h] [rbp-10h]\nint v16; // [rsp+4Ch] [rbp-4h]\nint v17; // [rsp+4Ch] [rbp-4h]\nint v18; // [rsp+4Ch] [rbp-4h]\n\nv9 = a2(a1, a3);\nif ( v9 )\nreturn v9;\nv4 = (unsigned __int16)sub_427027(a1);\nif ( (unsigned __int16)v4 == 13 )\n{\nv13 = sub_427265(a1);\nv18 = 0;\nv8 = (unsigned __int16)sub_42703E(a1);\nwhile ( v18 < v8 )\n{\nv12 = a2(v13, a3);\nif ( v12 )\nreturn v12;\n++v18;\nv13 += 8LL;\n}\n}\nelse if ( v4 <= 13 )\n{\nif ( v4 > 5 )\n{\nif ( v4 == 6 )\n{\nv14 = sub_427241(a1);\nv17 = 0;\nv7 = (unsigned __int16)sub_42703E(a1);\nwhile ( v17 < v7 )\n{\nv11 = a2(v14, a3);\nif ( v11 )\nreturn v11;\n++v17;\nv14 += 8LL;\n}\n}\n}\nelse if ( v4 >= 4 )\n{\nv15 = sub_427253(a1);\nv16 = 0;\nv6 = (unsigned __int16)sub_42703E(a1);\nwhile ( v16 < v6 )\n{\nv10 = a2(v15, a3);\nif ( v10 )\nreturn v10;\n++v16;\nv15 += 12LL;\n}\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v6,v12,v13,v14,v15,v16,sub_42F248,sub_427027,sub_427265,sub_42703E,sub_427241,sub_427253,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'ctx', 'a1': 't', 'a2': 'visit', 'v6': 'nb', 'v12': 'errb', 'v13': 'm_1', 'v14': 'm_0', 'v15': 'm', 'v16': 'ib', 'sub_42F248': 'btf_type_visit_str_offs', 'sub_427027': 'btf_kind_1', 'sub_427265': 'btf_params_0', 'sub_42703E': 'btf_vlen_0', 'sub_427241': 'btf_enum', 'sub_427253': 'btf_members_0'}"}
DecodeModImmInstruction
23b57fe50de11e692ac0fdc29e161ccb6cbe21a200aecc695b811f04513510b2
tandasat
cs_driver
NA
static DecodeStatus DecodeModImmInstruction(MCInst *Inst, uint32_t insn, uint64_t Addr, void *Decoder) { unsigned Rd = fieldFromInstruction(insn, 0, 5); unsigned cmode = fieldFromInstruction(insn, 12, 4); unsigned imm = fieldFromInstruction(insn, 16, 3) << 5; imm |= fieldFromInstruction(insn, 5, 5); if (MCInst_getOpcode(Inst) == AArch64_MOVID) DecodeFPR64RegisterClass(Inst, Rd, Addr, Decoder); else DecodeVectorRegisterClass(Inst, Rd, Addr, Decoder); MCOperand_CreateImm0(Inst, imm); switch (MCInst_getOpcode(Inst)) { default: break; case AArch64_MOVIv4i16: case AArch64_MOVIv8i16: case AArch64_MVNIv4i16: case AArch64_MVNIv8i16: case AArch64_MOVIv2i32: case AArch64_MOVIv4i32: case AArch64_MVNIv2i32: case AArch64_MVNIv4i32: MCOperand_CreateImm0(Inst, (cmode & 6) << 2); break; case AArch64_MOVIv2s_msl: case AArch64_MOVIv4s_msl: case AArch64_MVNIv2s_msl: case AArch64_MVNIv4s_msl: MCOperand_CreateImm0(Inst, cmode & 1 ? 0x110 : 0x108); break; } return Success; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_469090", "function_addr": 4624528, "binary_name": "23b57fe50de11e692ac0fdc29e161ccb6cbe21a200aecc695b811f04513510b2.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+var_28], rdx"], [6, "mov [rbp+var_30], rcx"], [7, "mov eax, [rbp+var_1C]"], [8, "mov edx, 5"], [9, "mov esi, 0"], [10, "mov edi, eax"], [11, "call sub_4517D7"], [12, "mov [rbp+var_4], eax"], [13, "mov eax, [rbp+var_1C]"], [14, "mov edx, 4"], [15, "mov esi, 0Ch"], [16, "mov edi, eax"], [17, "call sub_4517D7"], [18, "mov [rbp+var_8], eax"], [19, "mov eax, [rbp+var_1C]"], [20, "mov edx, 3"], [21, "mov esi, 10h"], [22, "mov edi, eax"], [23, "call sub_4517D7"], [24, "shl eax, 5"], [25, "mov [rbp+var_C], eax"], [26, "mov eax, [rbp+var_1C]"], [27, "mov edx, 5"], [28, "mov esi, 5"], [29, "mov edi, eax"], [30, "call sub_4517D7"], [31, "or [rbp+var_C], eax"], [32, "mov rax, [rbp+var_18]"], [33, "mov rdi, rax"], [34, "call sub_4050C9"], [35, "cmp eax, 448h"], [36, "jnz short loc_469132"], [37, "mov rcx, [rbp+var_30]"], [38, "mov rdx, [rbp+var_28]"], [39, "mov esi, [rbp+var_4]"], [40, "mov rax, [rbp+var_18]"], [41, "mov rdi, rax"], [42, "call sub_4672B6"], [43, "jmp short loc_469149"], [44, "mov rcx, [rbp+var_30]"], [45, "mov rdx, [rbp+var_28]"], [46, "mov esi, [rbp+var_4]"], [47, "mov rax, [rbp+var_18]"], [48, "mov rdi, rax"], [49, "call sub_467570"], [50, "mov edx, [rbp+var_C]"], [51, "mov rax, [rbp+var_18]"], [52, "mov rsi, rdx"], [53, "mov rdi, rax"], [54, "call sub_405338"], [55, "mov rax, [rbp+var_18]"], [56, "mov rdi, rax"], [57, "call sub_4050C9"], [58, "sub eax, 44Bh"], [59, "cmp eax, 29h"], [60, "ja short def_469191"], [61, "mov eax, eax"], [62, "lea rdx, ds:0[rax*4]"], [63, "lea rax, jpt_469191"], [64, "mov eax, ds:(jpt_469191 - 511844h)[rdx+rax]"], [65, "cdqe"], [66, "lea rdx, jpt_469191"], [67, "add rax, rdx"], [68, "jmp rax"], [69, "mov eax, [rbp+var_8]"], [70, "shl eax, 2"], [71, "mov eax, eax"], [72, "and eax, 18h"], [73, "mov rdx, rax"], [74, "mov rax, [rbp+var_18]"], [75, "mov rsi, rdx"], [76, "mov rdi, rax"], [77, "call sub_405338"], [78, "jmp short loc_4691DA"], [79, "mov eax, [rbp+var_8]"], [80, "and eax, 1"], [81, "test eax, eax"], [82, "jz short loc_4691C3"], [83, "mov edx, 110h"], [84, "jmp short loc_4691C8"], [85, "mov edx, 108h"], [86, "mov rax, [rbp+var_18]"], [87, "mov rsi, rdx"], [88, "mov rdi, rax"], [89, "call sub_405338"], [90, "jmp short loc_4691DA"], [91, "nop"], [92, "mov eax, 3"], [93, "leave"], [94, "retn"]], "data_dep": [[7, 4], [10, 7], [12, 11], [13, 4], [16, 13], [18, 17], [19, 4], [22, 19], [24, 23], [25, 24], [26, 4], [29, 26], [31, 25], [31, 30], [32, 3], [33, 32], [35, 34], [36, 35], [37, 6], [38, 5], [39, 12], [40, 3], [41, 40], [44, 6], [45, 5], [46, 12], [47, 3], [48, 47], [50, 31], [51, 3], [52, 50], [53, 51], [55, 3], [56, 55], [58, 57], [59, 58], [60, 59], [61, 58], [62, 50], [63, 61], [66, 62], [67, 64], [67, 66], [68, 67], [69, 18], [70, 69], [71, 70], [72, 71], [73, 72], [74, 3], [75, 73], [76, 74], [79, 18], [80, 79], [81, 80], [82, 81], [86, 3], [87, 83], [87, 85], [88, 86], [94, 92]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/23b57fe50de11e692ac0fdc29e161ccb6cbe21a200aecc695b811f04513510b2_23b57fe50de11e692ac0fdc29e161ccb6cbe21a200aecc695b811f04513510b2.jsonl.gz", "strip_func_name": "sub_469090", "query": "\n\n\n__int64 __fastcall sub_469090(__int64 a1, unsigned int a2)\n{\n__int64 v2; // rdx\nint v4; // [rsp+24h] [rbp-Ch]\nunsigned int v5; // [rsp+24h] [rbp-Ch]\nchar v6; // [rsp+28h] [rbp-8h]\nunsigned int v7; // [rsp+2Ch] [rbp-4h]\n\nv7 = sub_4517D7(a2, 0, 5);\nv6 = sub_4517D7(a2, 12, 4);\nv4 = 32 * sub_4517D7(a2, 16, 3);\nv5 = sub_4517D7(a2, 5, 5) | v4;\nif ( (unsigned int)sub_4050C9(a1) == 1096 )\nsub_4672B6(a1, v7);\nelse\nsub_467570(a1, v7);\nsub_405338(a1, v5);\nswitch ( (unsigned int)sub_4050C9(a1) )\n{\ncase 0x44Bu:\ncase 0x44Du:\ncase 0x44Eu:\ncase 0x451u:\ncase 0x46Fu:\ncase 0x471u:\ncase 0x472u:\ncase 0x474u:\nsub_405338(a1, (4 * v6) & 0x18);\nbreak;\ncase 0x44Cu:\ncase 0x44Fu:\ncase 0x470u:\ncase 0x473u:\nif ( (v6 & 1) != 0 )\nv2 = 272LL;\nelse\nv2 = 264LL;\nsub_405338(a1, v2);\nbreak;\ndefault:\nreturn 3LL;\n}\nreturn 3LL;\n}\n\n\n\nQ:[a1,a2,v4,v6,v7,sub_469090,sub_4517D7,sub_4050C9,sub_4672B6,sub_467570,sub_405338,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'Inst', 'a2': 'insn', 'v4': 'imma', 'v6': 'cmode', 'v7': 'Rd', 'sub_469090': 'DecodeModImmInstruction', 'sub_4517D7': 'fieldFromInstruction', 'sub_4050C9': 'MCInst_getOpcode', 'sub_4672B6': 'DecodeFPR64RegisterClass', 'sub_467570': 'DecodeVectorRegisterClass', 'sub_405338': 'MCOperand_CreateImm0'}"}
ZSTDv05_copy4
a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821
acama
libxdisasm
NA
static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_431843", "function_addr": 4397123, "binary_name": "a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_8], rdi"], [3, "mov [rbp+var_10], rsi"], [4, "mov rax, [rbp+var_10]"], [5, "mov edx, [rax]"], [6, "mov rax, [rbp+var_8]"], [7, "mov [rax], edx"], [8, "nop"], [9, "pop rbp"], [10, "retn"]], "data_dep": [[4, 3], [5, 4], [6, 2], [7, 6], [7, 5], [9, 0], [10, 6]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821_a0c5370f66e208f8116a57c2ede3423918c5e91893f32c95d645b45223541821.jsonl.gz", "strip_func_name": "sub_431843", "query": "\n\n\n_DWORD *__fastcall sub_431843(_DWORD *a1, _DWORD *a2)\n{\n_DWORD *result; // rax\n\nresult = a1;\n*a1 = *a2;\nreturn result;\n}\n\n\n\nQ:[a1,a2,sub_431843,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'dst', 'a2': 'src', 'sub_431843': 'ZSTDv05_copy4'}"}
Stack_pop
67d5b516845f1a5189b619fa08251f200ed0c551fc567a5346241564c352debb
cirosantilli
cpp-cheat
NA
int Stack_pop(Stack *stack, void *elem) { if (stack->nelems == 0) return 1; stack->nelems--; memcpy(elem, &((uint8_t *)(stack->data))[stack->nelems * stack->elem_size], stack->elem_size); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_401287", "function_addr": 4199047, "binary_name": "67d5b516845f1a5189b619fa08251f200ed0c551fc567a5346241564c352debb.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+dest], rsi"], [5, "mov rax, [rbp+var_8]"], [6, "mov rax, [rax+8]"], [7, "test rax, rax"], [8, "jnz short loc_4012AB"], [9, "mov eax, 1"], [10, "jmp short locret_4012FA"], [11, "mov rax, [rbp+var_8]"], [12, "mov rax, [rax+8]"], [13, "lea rdx, [rax-1]"], [14, "mov rax, [rbp+var_8]"], [15, "mov [rax+8], rdx"], [16, "mov rax, [rbp+var_8]"], [17, "mov rdx, [rax+10h]"], [18, "mov rax, [rbp+var_8]"], [19, "mov rsi, [rax]"], [20, "mov rax, [rbp+var_8]"], [21, "mov rcx, [rax+8]"], [22, "mov rax, [rbp+var_8]"], [23, "mov rax, [rax+10h]"], [24, "imul rax, rcx"], [25, "lea rcx, [rsi+rax]"], [26, "mov rax, [rbp+dest]"], [27, "mov rsi, rcx"], [28, "mov rdi, rax"], [29, "call _memcpy"], [30, "mov eax, 0"], [31, "leave"], [32, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [8, 7], [11, 3], [12, 11], [13, 12], [14, 3], [15, 14], [15, 13], [16, 3], [17, 15], [17, 16], [18, 3], [19, 18], [19, 15], [20, 3], [21, 15], [21, 20], [22, 3], [23, 22], [23, 15], [24, 23], [24, 21], [25, 15], [25, 21], [25, 24], [26, 4], [27, 25], [28, 26], [32, 9], [32, 30]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/67d5b516845f1a5189b619fa08251f200ed0c551fc567a5346241564c352debb_67d5b516845f1a5189b619fa08251f200ed0c551fc567a5346241564c352debb.jsonl.gz", "strip_func_name": "sub_401287", "query": "\n\n\n__int64 __fastcall sub_401287(_QWORD *a1, void *a2)\n{\nif ( !a1[1] )\nreturn 1LL;\nmemcpy(a2, (const void *)(*a1 + --a1[1] * a1[2]), a1[2]);\nreturn 0LL;\n}\n\n\n\nQ:[a1,a2,sub_401287,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'stack', 'a2': 'elem', 'sub_401287': 'Stack_pop'}"}
dm_msg_cache_deinit
9bbc9de5dd57f4f934e24f9b8a7ac1dacad3c7a25e14002cbd8d0494c83f5fb1
Ai-Thinker-Open
GPRS_C_SDK
NA
int dm_msg_cache_deinit(void) { dm_msg_cache_ctx_t *ctx = _dm_msg_cache_get_ctx(); dm_msg_cache_node_t *node = NULL; dm_msg_cache_node_t *next = NULL; _dm_msg_cache_mutex_lock(); list_for_each_entry_safe(node, next, &ctx->dmc_list, linked_list, dm_msg_cache_node_t) { list_del(&node->linked_list); if (node->data) { DM_free(node->data); } DM_free(node); _dm_msg_cache_mutex_unlock(); } _dm_msg_cache_mutex_unlock(); if (ctx->mutex) { HAL_MutexDestroy(ctx->mutex); } return SUCCESS_RETURN; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "dm_msg_cache_deinit", "function_addr": 4335462, "binary_name": "9bbc9de5dd57f4f934e24f9b8a7ac1dacad3c7a25e14002cbd8d0494c83f5fb1.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "call _dm_msg_cache_get_ctx"], [4, "mov [rbp+var_18], rax"], [5, "mov [rbp+var_8], 0"], [6, "mov [rbp+var_10], 0"], [7, "call sub_4226AB"], [8, "mov rax, [rbp+var_18]"], [9, "mov rax, [rax+18h]"], [10, "sub rax, 20h "], [11, "mov [rbp+var_8], rax"], [12, "mov rax, [rbp+var_8]"], [13, "mov rax, [rax+28h]"], [14, "sub rax, 20h "], [15, "mov [rbp+var_10], rax"], [16, "jmp loc_4228B5"], [17, "mov rax, [rbp+var_8]"], [18, "add rax, 20h "], [19, "mov rdi, rax"], [20, "call sub_422645"], [21, "mov rax, [rbp+var_8]"], [22, "mov rax, [rax+10h]"], [23, "test rax, rax"], [24, "jz short loc_42283C"], [25, "mov rax, [rbp+var_8]"], [26, "mov rax, [rax+10h]"], [27, "test rax, rax"], [28, "jnz short loc_422814"], [29, "sub rsp, 8"], [30, "push offset aNodeData"], [31, "mov r9d, offset aNodeData"], [32, "mov r8d, offset aSNullLiteFreeS_7"], [33, "mov ecx, 3"], [34, "mov edx, 3Ah "], [35, "mov esi, offset aDmMsgCacheDein_0"], [36, "mov edi, offset aUtils_8"], [37, "mov eax, 0"], [38, "call LITE_syslog"], [39, "add rsp, 10h"], [40, "jmp short loc_422830"], [41, "mov rax, [rbp+var_8]"], [42, "mov rax, [rax+10h]"], [43, "mov rdi, rax"], [44, "call LITE_free_internal"], [45, "mov rax, [rbp+var_8]"], [46, "mov qword ptr [rax+10h], 0"], [47, "mov rax, [rbp+var_8]"], [48, "mov qword ptr [rax+10h], 0"], [49, "cmp [rbp+var_8], 0"], [50, "jnz short loc_42287C"], [51, "sub rsp, 8"], [52, "push offset aNode_1"], [53, "mov r9d, offset aNode_1"], [54, "mov r8d, offset aSNullLiteFreeS_7"], [55, "mov ecx, 3"], [56, "mov edx, 3Ch "], [57, "mov esi, offset aDmMsgCacheDein_0"], [58, "mov edi, offset aUtils_8"], [59, "mov eax, 0"], [60, "call LITE_syslog"], [61, "add rsp, 10h"], [62, "jmp short loc_422890"], [63, "mov rax, [rbp+var_8]"], [64, "mov rdi, rax"], [65, "call LITE_free_internal"], [66, "mov [rbp+var_8], 0"], [67, "mov [rbp+var_8], 0"], [68, "call sub_4226DA"], [69, "mov rax, [rbp+var_10]"], [70, "mov [rbp+var_8], rax"], [71, "mov rax, [rbp+var_10]"], [72, "mov rax, [rax+28h]"], [73, "sub rax, 20h "], [74, "mov [rbp+var_10], rax"], [75, "mov rax, [rbp+var_8]"], [76, "lea rdx, [rax+20h]"], [77, "mov rax, [rbp+var_18]"], [78, "add rax, 10h"], [79, "cmp rdx, rax"], [80, "jnz loc_4227B1"], [81, "call sub_4226DA"], [82, "mov rax, [rbp+var_18]"], [83, "mov rax, [rax]"], [84, "test rax, rax"], [85, "jz short loc_4228EE"], [86, "mov rax, [rbp+var_18]"], [87, "mov rax, [rax]"], [88, "mov rdi, rax"], [89, "call HAL_MutexDestroy"], [90, "mov eax, 0"], [91, "leave"], [92, "retn"]], "data_dep": [[4, 3], [8, 4], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [17, 11], [17, 70], [18, 17], [19, 18], [21, 11], [21, 70], [22, 46], [22, 21], [22, 48], [23, 22], [24, 23], [25, 11], [25, 70], [26, 25], [26, 48], [26, 46], [27, 26], [28, 27], [29, 61], [29, 39], [29, 2], [39, 29], [41, 11], [41, 70], [42, 48], [42, 41], [42, 46], [43, 42], [45, 11], [45, 70], [46, 45], [47, 11], [47, 70], [48, 47], [49, 11], [49, 70], [50, 49], [51, 2], [51, 61], [51, 39], [61, 51], [63, 70], [63, 11], [64, 63], [69, 74], [69, 15], [70, 69], [71, 15], [71, 74], [72, 46], [72, 48], [72, 71], [73, 72], [74, 73], [75, 11], [75, 70], [76, 56], [76, 46], [76, 76], [76, 48], [76, 34], [76, 75], [77, 4], [78, 77], [79, 76], [79, 78], [80, 79], [82, 4], [83, 82], [83, 48], [83, 46], [84, 83], [85, 84], [86, 4], [87, 48], [87, 86], [87, 46], [88, 87], [92, 90]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/9bbc9de5dd57f4f934e24f9b8a7ac1dacad3c7a25e14002cbd8d0494c83f5fb1_9bbc9de5dd57f4f934e24f9b8a7ac1dacad3c7a25e14002cbd8d0494c83f5fb1.jsonl.gz", "strip_func_name": "dm_msg_cache_deinit", "query": "\n\n\n__int64 dm_msg_cache_deinit()\n{\n_QWORD *v1; // [rsp+8h] [rbp-18h]\n__int64 v2; // [rsp+10h] [rbp-10h]\n_QWORD *v3; // [rsp+18h] [rbp-8h]\n\nv1 = dm_msg_cache_get_ctx();\nsub_4226AB();\nv3 = (_QWORD *)(v1[3] - 32LL);\nv2 = v3[5] - 32LL;\nwhile ( v3 + 4 != v1 + 2 )\n{\nsub_422645(v3 + 4);\nif ( v3[2] )\n{\nLITE_free_internal(v3[2]);\nv3[2] = 0LL;\nv3[2] = 0LL;\n}\nif ( v3 )\nLITE_free_internal(v3);\nelse\nLITE_syslog(\n(unsigned int)\"utils\",\n(unsigned int)\"dm_msg_cache_deinit\",\n60,\n3,\n(unsigned int)\"%s == NULL! LITE_free(%s) aborted.\",\n(unsigned int)\"node\",\n\"node\");\nsub_4226DA();\nv3 = (_QWORD *)v2;\nv2 = *(_QWORD *)(v2 + 40) - 32LL;\n}\nsub_4226DA();\nif ( *v1 )\nHAL_MutexDestroy(*v1);\nreturn 0LL;\n}\n\n\n\nQ:[v1,v2,v3,sub_4226AB,sub_422645,sub_4226DA,]\nAssistant: ", "hints": "[]", "response": "{'v1': 'ctx', 'v2': 'next', 'v3': 'node', 'sub_4226AB': '_dm_msg_cache_mutex_lock', 'sub_422645': 'dlist_del_1', 'sub_4226DA': '_dm_msg_cache_mutex_unlock'}"}
check64_cb
0dcdc633414e45d27b838a1fde0e9f4d9b83ef1ae00c4d7b391a0b48d531666e
google
honggfuzz
NA
static int check64_cb(struct dl_phdr_info* info, void* data, unsigned elf_flags) { const uint64_t v = *(const uint64_t*)data; for (size_t i = 0; i < info->dlpi_phnum; i++) { /* Look only in the actual binary, and not in libraries */ if (info->dlpi_name[0] != '\0') { continue; } if (info->dlpi_phdr[i].p_type != PT_LOAD) { continue; } if ((info->dlpi_phdr[i].p_flags & elf_flags) != elf_flags) { continue; } uint64_t* start = (uint64_t*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr); uint64_t* end = (uint64_t*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr + HF_MIN(info->dlpi_phdr[i].p_memsz, info->dlpi_phdr[i].p_filesz)); /* Assume that the 64bit value looked for is also 64bit aligned */ for (; start < end; start++) { if (*start == v) { return 1; } } } return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_407820", "function_addr": 4225056, "binary_name": "0dcdc633414e45d27b838a1fde0e9f4d9b83ef1ae00c4d7b391a0b48d531666e.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_28], rdi"], [3, "mov [rbp+var_30], rsi"], [4, "mov [rbp+var_34], edx"], [5, "mov rax, [rbp+var_30]"], [6, "mov rax, [rax]"], [7, "mov [rbp+var_18], rax"], [8, "mov [rbp+var_8], 0"], [9, "jmp loc_40798C"], [10, "mov rax, [rbp+var_28]"], [11, "mov rax, [rax+8]"], [12, "movzx eax, byte ptr [rax]"], [13, "test al, al"], [14, "jnz loc_407980"], [15, "mov rax, [rbp+var_28]"], [16, "mov rcx, [rax+10h]"], [17, "mov rdx, [rbp+var_8]"], [18, "mov rax, rdx"], [19, "shl rax, 3"], [20, "sub rax, rdx"], [21, "shl rax, 3"], [22, "add rax, rcx"], [23, "mov eax, [rax]"], [24, "cmp eax, 1"], [25, "jnz loc_407983"], [26, "mov rax, [rbp+var_28]"], [27, "mov rcx, [rax+10h]"], [28, "mov rdx, [rbp+var_8]"], [29, "mov rax, rdx"], [30, "shl rax, 3"], [31, "sub rax, rdx"], [32, "shl rax, 3"], [33, "add rax, rcx"], [34, "mov eax, [rax+4]"], [35, "and eax, [rbp+var_34]"], [36, "cmp [rbp+var_34], eax"], [37, "jnz loc_407986"], [38, "mov rax, [rbp+var_28]"], [39, "mov rcx, [rax]"], [40, "mov rax, [rbp+var_28]"], [41, "mov rsi, [rax+10h]"], [42, "mov rdx, [rbp+var_8]"], [43, "mov rax, rdx"], [44, "shl rax, 3"], [45, "sub rax, rdx"], [46, "shl rax, 3"], [47, "add rax, rsi"], [48, "mov rax, [rax+10h]"], [49, "add rax, rcx"], [50, "mov [rbp+var_10], rax"], [51, "mov rax, [rbp+var_28]"], [52, "mov rcx, [rax]"], [53, "mov rax, [rbp+var_28]"], [54, "mov rsi, [rax+10h]"], [55, "mov rdx, [rbp+var_8]"], [56, "mov rax, rdx"], [57, "shl rax, 3"], [58, "sub rax, rdx"], [59, "shl rax, 3"], [60, "add rax, rsi"], [61, "mov rax, [rax+10h]"], [62, "lea rdi, [rcx+rax]"], [63, "mov rax, [rbp+var_28]"], [64, "mov rcx, [rax+10h]"], [65, "mov rdx, [rbp+var_8]"], [66, "mov rax, rdx"], [67, "shl rax, 3"], [68, "sub rax, rdx"], [69, "shl rax, 3"], [70, "add rax, rcx"], [71, "mov rdx, [rax+20h]"], [72, "mov rax, [rbp+var_28]"], [73, "mov rsi, [rax+10h]"], [74, "mov rcx, [rbp+var_8]"], [75, "mov rax, rcx"], [76, "shl rax, 3"], [77, "sub rax, rcx"], [78, "shl rax, 3"], [79, "add rax, rsi"], [80, "mov rax, [rax+28h]"], [81, "cmp rdx, rax"], [82, "cmovbe rax, rdx"], [83, "add rax, rdi"], [84, "mov [rbp+var_20], rax"], [85, "jmp short loc_407974"], [86, "mov rax, [rbp+var_10]"], [87, "mov rax, [rax]"], [88, "cmp [rbp+var_18], rax"], [89, "jnz short loc_40796F"], [90, "mov eax, 1"], [91, "jmp short loc_4079A6"], [92, "add [rbp+var_10], 8"], [93, "mov rax, [rbp+var_10]"], [94, "cmp rax, [rbp+var_20]"], [95, "jb short loc_40795B"], [96, "jmp short loc_407987"], [97, "nop"], [98, "jmp short loc_407987"], [99, "nop"], [100, "jmp short loc_407987"], [101, "nop"], [102, "add [rbp+var_8], 1"], [103, "mov rax, [rbp+var_28]"], [104, "movzx eax, word ptr [rax+18h]"], [105, "movzx eax, ax"], [106, "cmp [rbp+var_8], rax"], [107, "jb loc_407847"], [108, "mov eax, 0"], [109, "pop rbp"], [110, "retn"]], "data_dep": [[5, 3], [6, 5], [7, 6], [10, 2], [11, 10], [12, 11], [13, 12], [14, 13], [15, 2], [16, 15], [17, 102], [17, 8], [18, 17], [19, 18], [20, 17], [20, 19], [21, 20], [22, 21], [22, 16], [23, 22], [24, 23], [25, 24], [26, 2], [27, 26], [28, 102], [28, 8], [29, 28], [30, 29], [31, 28], [31, 30], [32, 31], [33, 32], [33, 27], [34, 33], [35, 4], [35, 34], [36, 4], [36, 35], [37, 36], [38, 2], [39, 38], [40, 2], [41, 40], [42, 102], [42, 8], [43, 42], [44, 43], [45, 42], [45, 44], [46, 45], [47, 41], [47, 46], [48, 47], [49, 39], [49, 48], [50, 49], [51, 2], [52, 51], [53, 2], [54, 53], [55, 8], [55, 102], [56, 55], [57, 56], [58, 55], [58, 57], [59, 58], [60, 59], [60, 54], [61, 60], [62, 62], [62, 61], [63, 2], [64, 63], [65, 8], [65, 102], [66, 65], [67, 66], [68, 65], [68, 67], [69, 68], [70, 64], [70, 69], [71, 70], [72, 2], [73, 72], [74, 8], [74, 102], [75, 74], [76, 75], [77, 76], [77, 74], [78, 77], [79, 78], [79, 73], [80, 79], [81, 71], [81, 80], [82, 81], [82, 71], [83, 62], [83, 82], [84, 83], [86, 92], [86, 50], [87, 86], [88, 87], [88, 7], [89, 88], [92, 92], [92, 50], [93, 50], [93, 92], [94, 84], [94, 93], [95, 94], [102, 8], [102, 102], [103, 2], [104, 103], [105, 104], [106, 8], [106, 102], [106, 105], [107, 106], [109, 0], [110, 90], [110, 108]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/0dcdc633414e45d27b838a1fde0e9f4d9b83ef1ae00c4d7b391a0b48d531666e_0dcdc633414e45d27b838a1fde0e9f4d9b83ef1ae00c4d7b391a0b48d531666e.jsonl.gz", "strip_func_name": "sub_407820", "query": "\n\n\n__int64 __fastcall sub_407820(__int64 a1, _QWORD *a2, int a3)\n{\nunsigned __int64 v3; // rax\n_QWORD *v5; // [rsp+24h] [rbp-10h]\nunsigned __int64 i; // [rsp+2Ch] [rbp-8h]\n\nfor ( i = 0LL; i < *(unsigned __int16 *)(a1 + 24); ++i )\n{\nif ( !**(_BYTE **)(a1 + 8)\n&& *(_DWORD *)(*(_QWORD *)(a1 + 16) + 56 * i) == 1\n&& a3 == (a3 & *(_DWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 4)) )\n{\nv5 = (_QWORD *)(*(_QWORD *)a1 + *(_QWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 16));\nv3 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 40);\nif ( *(_QWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 32) <= v3 )\nv3 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 32);\nwhile ( (unsigned __int64)v5 < *(_QWORD *)a1 + *(_QWORD *)(*(_QWORD *)(a1 + 16) + 56 * i + 16) + v3 )\n{\nif ( *a2 == *v5 )\nreturn 1LL;\n++v5;\n}\n}\n}\nreturn 0LL;\n}\n\n\n\nQ:[a3,a1,a2,v5,sub_407820,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'elf_flags', 'a1': 'info', 'a2': 'data', 'v5': 'start', 'sub_407820': 'check64_cb'}"}
addConstrChildIdxDeps
c554d64d8507512ec7c5460397d7e8fd60edb662d620824236cdfae536ce1f50
sraoss
pgsql-ivm
NA
static void addConstrChildIdxDeps(DumpableObject *dobj, const IndxInfo *refidx) { SimplePtrListCell *cell; Assert(dobj->objType == DO_FK_CONSTRAINT); for (cell = refidx->partattaches.head; cell; cell = cell->next) { IndexAttachInfo *attach = (IndexAttachInfo *) cell->ptr; addObjectDependency(dobj, attach->dobj.dumpId); if (attach->partitionIdx->partattaches.head != NULL) addConstrChildIdxDeps(dobj, attach->partitionIdx); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414F7C", "function_addr": 4280188, "binary_name": "c554d64d8507512ec7c5460397d7e8fd60edb662d620824236cdfae536ce1f50.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 rax, [rax+88h]"], [7, "mov [rbp+var_8], rax"], [8, "jmp short loc_414FF4"], [9, "mov rax, [rbp+var_8]"], [10, "mov rax, [rax+8]"], [11, "mov [rbp+var_10], rax"], [12, "mov rax, [rbp+var_10]"], [13, "mov edx, [rax+0Ch]"], [14, "mov rax, [rbp+var_18]"], [15, "mov esi, edx"], [16, "mov rdi, rax"], [17, "call sub_4324D6"], [18, "mov rax, [rbp+var_10]"], [19, "mov rax, [rax+48h]"], [20, "mov rax, [rax+88h]"], [21, "test rax, rax"], [22, "jz short loc_414FE9"], [23, "mov rax, [rbp+var_10]"], [24, "mov rdx, [rax+48h]"], [25, "mov rax, [rbp+var_18]"], [26, "mov rsi, rdx"], [27, "mov rdi, rax"], [28, "call sub_414F7C"], [29, "mov rax, [rbp+var_8]"], [30, "mov rax, [rax]"], [31, "mov [rbp+var_8], rax"], [32, "cmp [rbp+var_8], 0"], [33, "jnz short loc_414F9D"], [34, "nop"], [35, "nop"], [36, "leave"], [37, "retn"]], "data_dep": [[5, 4], [6, 5], [7, 6], [9, 7], [9, 31], [10, 9], [11, 10], [12, 11], [13, 12], [14, 3], [15, 13], [16, 14], [18, 11], [19, 18], [20, 19], [21, 20], [22, 21], [23, 11], [24, 23], [25, 3], [26, 24], [27, 25], [29, 7], [29, 31], [30, 29], [31, 30], [32, 31], [32, 7], [33, 32], [37, 6], [37, 30]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/c554d64d8507512ec7c5460397d7e8fd60edb662d620824236cdfae536ce1f50_c554d64d8507512ec7c5460397d7e8fd60edb662d620824236cdfae536ce1f50.jsonl.gz", "strip_func_name": "sub_414F7C", "query": "\n\n\n_QWORD *__fastcall sub_414F7C(__int64 a1, __int64 a2)\n{\n_QWORD *result; // rax\n__int64 v3; // [rsp+10h] [rbp-10h]\n_QWORD *i; // [rsp+18h] [rbp-8h]\n\nresult = *(_QWORD **)(a2 + 136);\nfor ( i = result; i; i = (_QWORD *)*i )\n{\nv3 = i[1];\nsub_4324D6(a1, *(unsigned int *)(v3 + 12));\nif ( *(_QWORD *)(*(_QWORD *)(v3 + 72) + 136LL) )\nsub_414F7C(a1, *(_QWORD *)(v3 + 72));\nresult = (_QWORD *)*i;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v3,i,sub_414F7C,sub_4324D6,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'dobj', 'a2': 'refidx', 'v3': 'attach', 'i': 'cell', 'sub_414F7C': 'addConstrChildIdxDeps', 'sub_4324D6': 'addObjectDependency'}"}
zrhhdr
d684d0e103b0580db997ecc931a42fce8955cefc27bedc1ac56a24d435bd8eaf
siemens
meta-iot2000
NA
static int zrhhdr(char *hdr) { register int c; register unsigned short crc; register int n; if ((c = zgethex()) < 0) return c; Rxtype = c; crc = updcrc(c, 0); for (n=4; --n >= 0; ++hdr) { if ((c = zgethex()) < 0) return c; crc = updcrc(c, crc); *hdr = c; } if ((c = zgethex()) < 0) return c; crc = updcrc(c, crc); if ((c = zgethex()) < 0) return c; crc = updcrc(c, crc); if (crc & 0xFFFF) { zperr(badcrc); return ERROR; } switch ( c = READLINE_PF(1)) { case 0215: /* **** FALL THRU TO **** */ case 015: /* Throw away possible cr/lf */ READLINE_PF(1); break; } protocol = ZM_ZMODEM; zmodem_requested=TRUE; return Rxtype; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40B396", "function_addr": 4240278, "binary_name": "d684d0e103b0580db997ecc931a42fce8955cefc27bedc1ac56a24d435bd8eaf.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r13"], [3, "push r12"], [4, "push rbx"], [5, "sub rsp, 18h"], [6, "mov [rbp+var_28], rdi"], [7, "call sub_4099CA"], [8, "mov ebx, eax"], [9, "test ebx, ebx"], [10, "jns short loc_40B3B9"], [11, "mov eax, ebx"], [12, "jmp loc_40B55E"], [13, "mov cs:dword_415304, ebx"], [14, "movzx eax, cs:word_412340"], [15, "mov edx, eax"], [16, "mov eax, ebx"], [17, "xor eax, edx"], [18, "mov r12d, eax"], [19, "mov r13d, 4"], [20, "jmp short loc_40B41F"], [21, "call sub_4099CA"], [22, "mov ebx, eax"], [23, "test ebx, ebx"], [24, "jns short loc_40B3E9"], [25, "mov eax, ebx"], [26, "jmp loc_40B55E"], [27, "mov eax, r12d"], [28, "shr ax, 8"], [29, "movzx eax, ax"], [30, "movzx eax, al"], [31, "cdqe"], [32, "movzx eax, word_412340[rax+rax]"], [33, "mov edx, eax"], [34, "movzx eax, r12w"], [35, "shl eax, 8"], [36, "xor eax, edx"], [37, "mov edx, ebx"], [38, "xor eax, edx"], [39, "mov r12d, eax"], [40, "mov edx, ebx"], [41, "mov rax, [rbp+var_28]"], [42, "mov [rax], dl"], [43, "add [rbp+var_28], 1"], [44, "sub r13d, 1"], [45, "test r13d, r13d"], [46, "jns short loc_40B3D7"], [47, "call sub_4099CA"], [48, "mov ebx, eax"], [49, "test ebx, ebx"], [50, "jns short loc_40B43A"], [51, "mov eax, ebx"], [52, "jmp loc_40B55E"], [53, "mov eax, r12d"], [54, "shr ax, 8"], [55, "movzx eax, ax"], [56, "movzx eax, al"], [57, "cdqe"], [58, "movzx eax, word_412340[rax+rax]"], [59, "mov edx, eax"], [60, "movzx eax, r12w"], [61, "shl eax, 8"], [62, "xor eax, edx"], [63, "mov edx, ebx"], [64, "xor eax, edx"], [65, "mov r12d, eax"], [66, "call sub_4099CA"], [67, "mov ebx, eax"], [68, "test ebx, ebx"], [69, "jns short loc_40B475"], [70, "mov eax, ebx"], [71, "jmp loc_40B55E"], [72, "mov eax, r12d"], [73, "shr ax, 8"], [74, "movzx eax, ax"], [75, "movzx eax, al"], [76, "cdqe"], [77, "movzx eax, word_412340[rax+rax]"], [78, "mov edx, eax"], [79, "movzx eax, r12w"], [80, "shl eax, 8"], [81, "xor eax, edx"], [82, "mov edx, ebx"], [83, "xor eax, edx"], [84, "mov r12d, eax"], [85, "test r12w, r12w"], [86, "jz short loc_40B4BD"], [87, "mov edi, offset aBadCrc"], [88, "mov eax, 0"], [89, "call sub_40B7FC"], [90, "mov eax, 0FFFFFFFFh"], [91, "jmp loc_40B55E"], [92, "mov eax, cs:dword_415480"], [93, "sub eax, 1"], [94, "mov cs:dword_415480, eax"], [95, "mov eax, cs:dword_415480"], [96, "test eax, eax"], [97, "js short loc_40B4F3"], [98, "mov rax, cs:qword_415488"], [99, "lea rdx, [rax+1]"], [100, "mov cs:qword_415488, rdx"], [101, "movzx eax, byte ptr [rax]"], [102, "movsx eax, al"], [103, "movzx eax, al"], [104, "jmp short loc_40B4FD"], [105, "mov edi, 1"], [106, "call sub_40BAEB"], [107, "mov ebx, eax"], [108, "cmp ebx, 0Dh"], [109, "jz short loc_40B50C"], [110, "cmp ebx, 8Dh"], [111, "jnz short loc_40B544"], [112, "mov eax, cs:dword_415480"], [113, "sub eax, 1"], [114, "mov cs:dword_415480, eax"], [115, "mov eax, cs:dword_415480"], [116, "test eax, eax"], [117, "js short loc_40B539"], [118, "mov rax, cs:qword_415488"], [119, "add rax, 1"], [120, "mov cs:qword_415488, rax"], [121, "jmp short loc_40B543"], [122, "mov edi, 1"], [123, "call sub_40BAEB"], [124, "nop"], [125, "mov cs:dword_412FF4, 2"], [126, "mov cs:dword_412FFC, 1"], [127, "mov eax, cs:dword_415304"], [128, "add rsp, 18h"], [129, "pop rbx"], [130, "pop r12"], [131, "pop r13"], [132, "pop rbp"], [133, "retn"]], "data_dep": [[8, 7], [9, 8], [10, 9], [11, 9], [13, 9], [15, 14], [16, 9], [17, 16], [17, 15], [18, 17], [22, 21], [23, 22], [24, 23], [25, 23], [27, 39], [27, 18], [28, 27], [29, 28], [30, 29], [33, 32], [34, 18], [34, 39], [35, 34], [36, 33], [36, 35], [37, 23], [38, 36], [38, 37], [39, 38], [40, 23], [41, 43], [41, 6], [42, 41], [42, 40], [43, 43], [43, 6], [44, 45], [44, 19], [45, 44], [46, 45], [48, 47], [49, 48], [50, 49], [51, 49], [53, 18], [53, 39], [54, 53], [55, 54], [56, 55], [59, 58], [60, 39], [60, 18], [61, 60], [62, 59], [62, 61], [63, 49], [64, 62], [64, 63], [65, 64], [67, 66], [68, 67], [69, 68], [70, 68], [72, 65], [73, 72], [74, 73], [75, 74], [78, 77], [79, 65], [80, 79], [81, 78], [81, 80], [82, 68], [83, 82], [83, 81], [84, 83], [85, 84], [86, 85], [93, 92], [94, 93], [95, 94], [96, 95], [97, 96], [99, 42], [99, 98], [99, 82], [100, 99], [101, 42], [101, 98], [102, 101], [103, 102], [107, 106], [107, 103], [108, 107], [109, 108], [110, 107], [111, 110], [112, 94], [113, 112], [114, 113], [115, 114], [116, 115], [117, 116], [118, 100], [119, 118], [120, 119], [127, 13], [128, 5], [129, 4], [130, 3], [131, 2], [132, 0], [133, 70], [133, 127], [133, 51], [133, 90], [133, 25], [133, 11]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/d684d0e103b0580db997ecc931a42fce8955cefc27bedc1ac56a24d435bd8eaf_d684d0e103b0580db997ecc931a42fce8955cefc27bedc1ac56a24d435bd8eaf.jsonl.gz", "strip_func_name": "sub_40B396", "query": "\n\n\n__int64 __fastcall sub_40B396(_BYTE *a1, int a2)\n{\nint v2; // ebx\n__int64 result; // rax\n__int16 v4; // r12\nint v5; // er13\nint v6; // ebx\nint v7; // ebx\n__int16 v8; // r12\nint v9; // ecx\nint v10; // ebx\nint v11; // er8\nint v12; // er9\nunsigned __int8 *v13; // rax\nint v14; // eax\n\nv2 = sub_4099CA();\nif ( v2 < 0 )\nreturn (unsigned int)v2;\ndword_415304 = v2;\nv4 = word_412340[0] ^ v2;\nv5 = 4;\nwhile ( --v5 >= 0 )\n{\nv6 = sub_4099CA();\nif ( v6 < 0 )\nreturn (unsigned int)v6;\nv4 = v6 ^ word_412340[HIBYTE(v4)] ^ (v4 << 8);\n*a1++ = v6;\n}\nv7 = sub_4099CA();\nif ( v7 < 0 )\nreturn (unsigned int)v7;\nv8 = v7 ^ word_412340[HIBYTE(v4)] ^ (v4 << 8);\nv10 = sub_4099CA();\nif ( v10 < 0 )\nreturn (unsigned int)v10;\nif ( (unsigned __int16)v10 ^ (unsigned __int16)(word_412340[HIBYTE(v8)] ^ (v8 << 8)) )\n{\nsub_40B7FC((unsigned int)\"Bad CRC\", a2, v10, v9, v11, v12);\nresult = 0xFFFFFFFFLL;\n}\nelse\n{\nif ( --dword_415480 < 0 )\n{\nv14 = sub_40BAEB(1LL);\n}\nelse\n{\nv13 = (unsigned __int8 *)qword_415488;\nqword_415488 = (char *)qword_415488 + 1;\nv14 = *v13;\n}\nif ( v14 == 13 || v14 == 141 )\n{\nif ( --dword_415480 < 0 )\nsub_40BAEB(1LL);\nelse\nqword_415488 = (char *)qword_415488 + 1;\n}\ndword_412FF4 = 2;\ndword_412FFC = 1;\nresult = (unsigned int)dword_415304;\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_40B396,sub_4099CA,sub_40B7FC,sub_40BAEB,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'hdr', 'sub_40B396': 'zrhhdr', 'sub_4099CA': 'zgethex', 'sub_40B7FC': 'zperr', 'sub_40BAEB': 'readline_internal'}"}
pmc_send_get_action
b881a36ac1042d08a153dc6d79e8af7857537b515a74f12df247ec16fc2fe0b7
nxp-archive
openil_linuxptp
NA
int pmc_send_get_action(struct pmc *pmc, int id) { int datalen, pdulen; struct ptp_message *msg; struct management_tlv *mgt; struct tlv_extra *extra; msg = pmc_message(pmc, GET); if (!msg) { return -1; } mgt = (struct management_tlv *) msg->management.suffix; mgt->type = TLV_MANAGEMENT; datalen = pmc_tlv_datalen(pmc, id); mgt->length = 2 + datalen; mgt->id = id; pdulen = msg->header.messageLength + sizeof(*mgt) + datalen; msg->header.messageLength = pdulen; extra = tlv_extra_alloc(); if (!extra) { pr_err("failed to allocate TLV descriptor"); msg_put(msg); return -ENOMEM; } extra->tlv = (struct TLV *) msg->management.suffix; msg_tlv_attach(msg, extra); if (id == TLV_CLOCK_DESCRIPTION && !pmc->zero_length_gets) { /* * Make sure the tlv_extra pointers dereferenced in * mgt_pre_send() do point to something. */ struct mgmt_clock_description *cd = &extra->cd; uint8_t *buf = mgt->data; cd->clockType = (UInteger16 *) buf; buf += sizeof(*cd->clockType); cd->physicalLayerProtocol = (struct PTPText *) buf; buf += sizeof(struct PTPText) + cd->physicalLayerProtocol->length; cd->physicalAddress = (struct PhysicalAddress *) buf; buf += sizeof(struct PhysicalAddress) + 0; cd->protocolAddress = (struct PortAddress *) buf; } pmc_send(pmc, msg); msg_put(msg); return 0; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40A479", "function_addr": 4236409, "binary_name": "b881a36ac1042d08a153dc6d79e8af7857537b515a74f12df247ec16fc2fe0b7.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_38], rdi"], [4, "mov [rbp+var_3C], esi"], [5, "mov rax, [rbp+var_38]"], [6, "mov esi, 0"], [7, "mov rdi, rax"], [8, "call sub_40A19E"], [9, "mov [rbp+var_8], rax"], [10, "cmp [rbp+var_8], 0"], [11, "jnz short loc_40A4AE"], [12, "mov eax, 0FFFFFFFFh"], [13, "jmp locret_40A60E"], [14, "mov rax, [rbp+var_8]"], [15, "add rax, 30h "], [16, "mov [rbp+var_10], rax"], [17, "mov rax, [rbp+var_10]"], [18, "mov word ptr [rax], 1"], [19, "mov edx, [rbp+var_3C]"], [20, "mov rax, [rbp+var_38]"], [21, "mov esi, edx"], [22, "mov rdi, rax"], [23, "call sub_40A303"], [24, "mov [rbp+var_14], eax"], [25, "mov eax, [rbp+var_14]"], [26, "lea edx, [rax+2]"], [27, "mov rax, [rbp+var_10]"], [28, "mov [rax+2], dx"], [29, "mov eax, [rbp+var_3C]"], [30, "mov edx, eax"], [31, "mov rax, [rbp+var_10]"], [32, "mov [rax+4], dx"], [33, "mov rax, [rbp+var_8]"], [34, "movzx eax, word ptr [rax+2]"], [35, "movzx edx, ax"], [36, "mov eax, [rbp+var_14]"], [37, "add eax, edx"], [38, "add eax, 6"], [39, "mov [rbp+var_18], eax"], [40, "mov eax, [rbp+var_18]"], [41, "mov edx, eax"], [42, "mov rax, [rbp+var_8]"], [43, "mov [rax+2], dx"], [44, "call sub_410BC5"], [45, "mov [rbp+var_20], rax"], [46, "cmp [rbp+var_20], 0"], [47, "jnz short loc_40A54F"], [48, "mov esi, offset aFailedToAlloca_2"], [49, "mov edi, 3"], [50, "mov eax, 0"], [51, "call sub_40B47F"], [52, "mov rax, [rbp+var_8]"], [53, "mov rdi, rax"], [54, "call sub_4092A7"], [55, "mov eax, 0FFFFFFF4h"], [56, "jmp locret_40A60E"], [57, "mov rax, [rbp+var_8]"], [58, "lea rdx, [rax+30h]"], [59, "mov rax, [rbp+var_20]"], [60, "mov [rax+10h], rdx"], [61, "mov rdx, [rbp+var_20]"], [62, "mov rax, [rbp+var_8]"], [63, "mov rsi, rdx"], [64, "mov rdi, rax"], [65, "call sub_409155"], [66, "cmp [rbp+var_3C], 1"], [67, "jnz short loc_40A5EA"], [68, "mov rax, [rbp+var_38]"], [69, "mov eax, [rax+5Ch]"], [70, "test eax, eax"], [71, "jnz short loc_40A5EA"], [72, "mov rax, [rbp+var_20]"], [73, "add rax, 18h"], [74, "mov [rbp+var_28], rax"], [75, "mov rax, [rbp+var_10]"], [76, "add rax, 6"], [77, "mov [rbp+var_30], rax"], [78, "mov rax, [rbp+var_28]"], [79, "mov rdx, [rbp+var_30]"], [80, "mov [rax], rdx"], [81, "add [rbp+var_30], 2"], [82, "mov rax, [rbp+var_28]"], [83, "mov rdx, [rbp+var_30]"], [84, "mov [rax+8], rdx"], [85, "mov rax, [rbp+var_28]"], [86, "mov rax, [rax+8]"], [87, "movzx eax, byte ptr [rax]"], [88, "movzx eax, al"], [89, "add rax, 1"], [90, "add [rbp+var_30], rax"], [91, "mov rax, [rbp+var_28]"], [92, "mov rdx, [rbp+var_30]"], [93, "mov [rax+10h], rdx"], [94, "add [rbp+var_30], 2"], [95, "mov rax, [rbp+var_28]"], [96, "mov rdx, [rbp+var_30]"], [97, "mov [rax+18h], rdx"], [98, "mov rdx, [rbp+var_8]"], [99, "mov rax, [rbp+var_38]"], [100, "mov rsi, rdx"], [101, "mov rdi, rax"], [102, "call sub_40A29D"], [103, "mov rax, [rbp+var_8]"], [104, "mov rdi, rax"], [105, "call sub_4092A7"], [106, "mov eax, 0"], [107, "leave"], [108, "retn"]], "data_dep": [[5, 3], [7, 5], [9, 8], [10, 9], [11, 10], [14, 9], [15, 14], [16, 15], [17, 16], [18, 17], [19, 4], [20, 3], [21, 19], [22, 20], [24, 23], [25, 24], [26, 25], [26, 18], [26, 19], [27, 16], [28, 27], [28, 26], [29, 4], [30, 29], [31, 16], [32, 30], [32, 31], [33, 9], [34, 28], [34, 32], [34, 33], [35, 34], [36, 24], [37, 35], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 9], [43, 41], [43, 42], [45, 44], [46, 45], [47, 46], [52, 9], [53, 52], [57, 9], [58, 28], [58, 60], [58, 32], [58, 18], [58, 57], [58, 41], [58, 43], [59, 45], [60, 59], [60, 58], [61, 45], [62, 9], [63, 61], [64, 62], [66, 4], [67, 66], [68, 3], [69, 60], [69, 28], [69, 32], [69, 18], [69, 68], [69, 43], [70, 69], [71, 70], [72, 45], [73, 72], [74, 73], [75, 16], [76, 75], [77, 76], [78, 74], [79, 77], [80, 78], [80, 79], [81, 77], [82, 74], [83, 81], [84, 83], [84, 82], [85, 74], [86, 85], [86, 84], [87, 80], [87, 84], [87, 86], [88, 87], [89, 88], [90, 81], [90, 89], [91, 74], [92, 90], [93, 92], [93, 91], [94, 90], [95, 74], [96, 94], [97, 95], [97, 96], [98, 9], [99, 3], [100, 98], [101, 99], [103, 9], [104, 103], [108, 106], [108, 12], [108, 55]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/b881a36ac1042d08a153dc6d79e8af7857537b515a74f12df247ec16fc2fe0b7_b881a36ac1042d08a153dc6d79e8af7857537b515a74f12df247ec16fc2fe0b7.jsonl.gz", "strip_func_name": "sub_40A479", "query": "\n\n\n__int64 __fastcall sub_40A479(__int64 a1, int a2)\n{\n__int64 result; // rax\nint v3; // edx\nint v4; // ecx\nint v5; // er8\nint v6; // er9\n__int64 v7; // [rsp+10h] [rbp-30h]\n_QWORD *v8; // [rsp+20h] [rbp-20h]\n__int16 v9; // [rsp+2Ch] [rbp-14h]\nchar *v10; // [rsp+38h] [rbp-8h]\n\nv10 = sub_40A19E(a1, 0);\nif ( !v10 )\nreturn 0xFFFFFFFFLL;\n*((_WORD *)v10 + 24) = 1;\nv9 = sub_40A303(a1, a2);\n*((_WORD *)v10 + 25) = v9 + 2;\n*((_WORD *)v10 + 26) = a2;\n*((_WORD *)v10 + 1) += v9 + 6;\nv8 = (_QWORD *)sub_410BC5();\nif ( v8 )\n{\nv8[2] = v10 + 48;\nsub_409155((__int64)v10, v8);\nif ( a2 == 1 && !*(_DWORD *)(a1 + 92) )\n{\nv8[3] = v10 + 54;\nv8[4] = v10 + 56;\nv7 = (__int64)&v10[*(unsigned __int8 *)v8[4] + 57];\nv8[5] = v7;\nv8[6] = v7 + 2;\n}\nsub_40A29D(a1, (__int64)v10);\nsub_4092A7((__int64)v10);\nresult = 0LL;\n}\nelse\n{\nsub_40B47F(3, (unsigned int)\"failed to allocate TLV descriptor\", v3, v4, v5, v6);\nsub_4092A7((__int64)v10);\nresult = 4294967284LL;\n}\nreturn result;\n}\n\n\n\nQ:[a1,a2,v7,v8,v9,v10,sub_40A479,sub_40A19E,sub_40A303,sub_410BC5,sub_409155,sub_40A29D,sub_4092A7,sub_40B47F,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'pmc', 'a2': 'id', 'v7': 'buf', 'v8': 'extra', 'v9': 'datalen', 'v10': 'msg', 'sub_40A479': 'pmc_send_get_action', 'sub_40A19E': 'pmc_message', 'sub_40A303': 'pmc_tlv_datalen', 'sub_410BC5': 'tlv_extra_alloc', 'sub_409155': 'msg_tlv_attach', 'sub_40A29D': 'pmc_send', 'sub_4092A7': 'msg_put', 'sub_40B47F': 'print'}"}
find_dominating_parents
3ab645463ad13ea30c238ceac9bf56691ea8cada0b7c92413fecc09c2d081d33
illumos
illumos-gate
NA
static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn, struct basic_block *bb, unsigned long generation, struct pseudo_list **dominators, int local) { struct basic_block *parent; FOR_EACH_PTR(bb->parents, parent) { struct instruction *one; struct instruction *br; pseudo_t phi; FOR_EACH_PTR_REVERSE(parent->insns, one) { int dominance; if (!one->bb) continue; if (one == insn) goto no_dominance; dominance = dominates(pseudo, insn, one, local); if (dominance < 0) { if (one->opcode == OP_LOAD) continue; return 0; } if (!dominance) continue; goto found_dominator; } END_FOR_EACH_PTR_REVERSE(one); no_dominance: if (parent->generation == generation) continue; parent->generation = generation; if (!find_dominating_parents(pseudo, insn, parent, generation, dominators, local)) return 0; continue; found_dominator: br = delete_last_instruction(&parent->insns); phi = alloc_phi(parent, one->target, one->type); phi->ident = phi->ident ? : one->target->ident; add_instruction(&parent->insns, br); use_pseudo(insn, phi, add_pseudo(dominators, phi)); } END_FOR_EACH_PTR(parent); return 1; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4449C3", "function_addr": 4475331, "binary_name": "3ab645463ad13ea30c238ceac9bf56691ea8cada0b7c92413fecc09c2d081d33.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 90h"], [3, "mov [rbp+var_68], rdi"], [4, "mov [rbp+var_70], rsi"], [5, "mov [rbp+var_78], rdx"], [6, "mov [rbp+var_80], rcx"], [7, "mov [rbp+var_88], r8"], [8, "mov [rbp+var_8C], r9d"], [9, "mov rax, [rbp+var_78]"], [10, "mov rax, [rax+20h]"], [11, "mov [rbp+var_28], rax"], [12, "mov rax, [rbp+var_28]"], [13, "mov [rbp+var_8], rax"], [14, "cmp [rbp+var_28], 0"], [15, "jz loc_444C67"], [16, "mov [rbp+var_C], 0"], [17, "jmp loc_444C38"], [18, "mov rax, [rbp+var_8]"], [19, "mov edx, [rbp+var_C]"], [20, "movsxd rdx, edx"], [21, "add rdx, 2"], [22, "mov rax, [rax+rdx*8+8]"], [23, "mov [rbp+var_30], rax"], [24, "mov rax, [rbp+var_8]"], [25, "movzx eax, byte ptr [rax+1]"], [26, "test al, al"], [27, "jz short loc_444A45"], [28, "cmp [rbp+var_30], 0"], [29, "jz loc_444C2D"], [30, "mov rax, [rbp+var_30]"], [31, "mov rax, [rax+30h]"], [32, "mov [rbp+var_38], rax"], [33, "mov rax, [rbp+var_38]"], [34, "mov [rbp+var_18], rax"], [35, "mov rax, [rbp+var_30]"], [36, "mov rax, [rax+30h]"], [37, "test rax, rax"], [38, "jz loc_444B2F"], [39, "mov rax, [rbp+var_18]"], [40, "mov rax, [rax+8]"], [41, "mov [rbp+var_18], rax"], [42, "mov rax, [rbp+var_18]"], [43, "movzx eax, byte ptr [rax]"], [44, "movsx eax, al"], [45, "mov [rbp+var_1C], eax"], [46, "jmp loc_444B11"], [47, "mov rax, [rbp+var_18]"], [48, "mov edx, [rbp+var_1C]"], [49, "movsxd rdx, edx"], [50, "add rdx, 2"], [51, "mov rax, [rax+rdx*8+8]"], [52, "mov [rbp+var_40], rax"], [53, "mov rax, [rbp+var_18]"], [54, "movzx eax, byte ptr [rax+1]"], [55, "test al, al"], [56, "jz short loc_444AB4"], [57, "cmp [rbp+var_40], 0"], [58, "jnz short loc_444AB4"], [59, "jmp short loc_444B11"], [60, "mov rax, [rbp+var_40]"], [61, "mov rax, [rax+8]"], [62, "test rax, rax"], [63, "jnz short loc_444AC3"], [64, "jmp short loc_444B11"], [65, "mov rax, [rbp+var_40]"], [66, "cmp rax, [rbp+var_70]"], [67, "jz short loc_444B32"], [68, "mov ecx, [rbp+var_8C]"], [69, "mov rdx, [rbp+var_40]"], [70, "mov rsi, [rbp+var_70]"], [71, "mov rax, [rbp+var_68]"], [72, "mov rdi, rax"], [73, "call sub_43E435"], [74, "mov [rbp+var_44], eax"], [75, "cmp [rbp+var_44], 0"], [76, "jns short loc_444B0A"], [77, "mov rax, [rbp+var_40]"], [78, "movzx eax, byte ptr [rax]"], [79, "and eax, 7Fh"], [80, "cmp al, 43h "], [81, "jnz short loc_444B00"], [82, "jmp short loc_444B11"], [83, "mov eax, 0"], [84, "jmp locret_444C6D"], [85, "cmp [rbp+var_44], 0"], [86, "jnz short loc_444B8F"], [87, "nop"], [88, "sub [rbp+var_1C], 1"], [89, "cmp [rbp+var_1C], 0"], [90, "jns loc_444A88"], [91, "mov rax, [rbp+var_18]"], [92, "cmp rax, [rbp+var_38]"], [93, "jnz loc_444A6A"], [94, "jmp short loc_444B33"], [95, "nop"], [96, "jmp short loc_444B33"], [97, "nop"], [98, "mov rax, [rbp+var_30]"], [99, "mov rax, [rax+8]"], [100, "cmp [rbp+var_80], rax"], [101, "jz loc_444C30"], [102, "mov rax, [rbp+var_30]"], [103, "mov rdx, [rbp+var_80]"], [104, "mov [rax+8], rdx"], [105, "mov r8d, [rbp+var_8C]"], [106, "mov rdi, [rbp+var_88]"], [107, "mov rcx, [rbp+var_80]"], [108, "mov rdx, [rbp+var_30]"], [109, "mov rsi, [rbp+var_70]"], [110, "mov rax, [rbp+var_68]"], [111, "mov r9d, r8d"], [112, "mov r8, rdi"], [113, "mov rdi, rax"], [114, "call sub_4449C3"], [115, "test eax, eax"], [116, "jnz loc_444C33"], [117, "mov eax, 0"], [118, "jmp locret_444C6D"], [119, "nop"], [120, "mov rax, [rbp+var_30]"], [121, "add rax, 30h "], [122, "mov rdi, rax"], [123, "call sub_44480A"], [124, "mov [rbp+var_50], rax"], [125, "mov rax, [rbp+var_40]"], [126, "mov rdx, [rax+18h]"], [127, "mov rax, [rbp+var_40]"], [128, "mov rcx, [rax+20h]"], [129, "mov rax, [rbp+var_30]"], [130, "mov rsi, rcx"], [131, "mov rdi, rax"], [132, "call sub_40BE1E"], [133, "mov [rbp+var_58], rax"], [134, "mov rax, [rbp+var_58]"], [135, "mov rax, [rax+10h]"], [136, "test rax, rax"], [137, "jnz short loc_444BE0"], [138, "mov rax, [rbp+var_40]"], [139, "mov rax, [rax+20h]"], [140, "mov rax, [rax+10h]"], [141, "mov rdx, [rbp+var_58]"], [142, "mov [rdx+10h], rax"], [143, "mov rax, [rbp+var_30]"], [144, "lea rdx, [rax+30h]"], [145, "mov rax, [rbp+var_50]"], [146, "mov rsi, rax"], [147, "mov rdi, rdx"], [148, "call sub_444824"], [149, "mov rdx, [rbp+var_58]"], [150, "mov rax, [rbp+var_88]"], [151, "mov rsi, rdx"], [152, "mov rdi, rax"], [153, "call sub_444852"], [154, "mov rdx, rax"], [155, "mov rcx, [rbp+var_58]"], [156, "mov rax, [rbp+var_70]"], [157, "mov rsi, rcx"], [158, "mov rdi, rax"], [159, "call sub_444928"], [160, "jmp short loc_444C34"], [161, "nop"], [162, "jmp short loc_444C34"], [163, "nop"], [164, "jmp short loc_444C34"], [165, "nop"], [166, "add [rbp+var_C], 1"], [167, "mov rax, [rbp+var_8]"], [168, "movzx eax, byte ptr [rax]"], [169, "movsx eax, al"], [170, "cmp [rbp+var_C], eax"], [171, "jl loc_444A17"], [172, "mov rax, [rbp+var_8]"], [173, "mov rax, [rax+10h]"], [174, "mov [rbp+var_8], rax"], [175, "mov rax, [rbp+var_8]"], [176, "cmp rax, [rbp+var_28]"], [177, "jnz loc_444A0B"], [178, "jmp short loc_444C68"], [179, "nop"], [180, "mov eax, 1"], [181, "leave"], [182, "retn"]], "data_dep": [[9, 5], [10, 9], [11, 10], [12, 11], [13, 12], [14, 11], [15, 14], [18, 174], [18, 13], [19, 166], [19, 16], [20, 19], [21, 20], [22, 142], [22, 18], [22, 104], [23, 22], [24, 174], [24, 13], [25, 104], [25, 24], [25, 142], [26, 25], [27, 26], [28, 23], [29, 28], [30, 23], [31, 104], [31, 30], [31, 142], [32, 31], [33, 32], [34, 33], [35, 23], [36, 104], [36, 35], [36, 142], [37, 36], [38, 37], [39, 41], [39, 34], [40, 104], [40, 142], [40, 39], [41, 40], [42, 41], [43, 142], [43, 104], [43, 42], [44, 43], [45, 44], [47, 41], [48, 88], [49, 48], [50, 49], [51, 47], [51, 104], [51, 142], [52, 51], [53, 41], [54, 104], [54, 142], [54, 53], [55, 54], [56, 55], [57, 52], [58, 57], [60, 52], [61, 104], [61, 60], [61, 142], [62, 61], [63, 62], [65, 52], [66, 4], [66, 65], [67, 66], [68, 8], [69, 52], [70, 4], [71, 3], [72, 71], [74, 73], [75, 74], [76, 75], [77, 52], [78, 77], [78, 104], [78, 142], [79, 78], [80, 79], [81, 80], [85, 74], [86, 85], [88, 45], [88, 88], [89, 88], [90, 89], [91, 41], [92, 32], [92, 91], [93, 92], [98, 23], [99, 104], [99, 142], [99, 98], [100, 6], [100, 99], [101, 100], [102, 23], [103, 6], [104, 102], [104, 103], [105, 8], [106, 7], [107, 6], [108, 23], [109, 4], [110, 3], [111, 105], [112, 106], [113, 110], [115, 114], [116, 115], [120, 23], [121, 120], [122, 121], [124, 123], [125, 52], [126, 142], [126, 125], [126, 104], [127, 52], [128, 142], [128, 127], [128, 104], [129, 23], [130, 128], [131, 129], [133, 132], [134, 133], [135, 104], [135, 142], [135, 134], [136, 135], [137, 136], [138, 52], [139, 142], [139, 138], [139, 104], [140, 139], [140, 104], [140, 142], [141, 133], [142, 141], [142, 136], [142, 140], [143, 23], [144, 141], [144, 143], [144, 142], [145, 124], [146, 145], [147, 144], [149, 133], [150, 7], [151, 149], [152, 150], [154, 153], [155, 133], [156, 4], [157, 155], [158, 156], [166, 16], [166, 166], [167, 13], [167, 174], [168, 104], [168, 142], [168, 167], [169, 168], [170, 169], [170, 16], [170, 166], [171, 170], [172, 13], [172, 174], [173, 104], [173, 142], [173, 172], [174, 173], [175, 174], [176, 11], [176, 175], [177, 176], [182, 83], [182, 117], [182, 180]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/3ab645463ad13ea30c238ceac9bf56691ea8cada0b7c92413fecc09c2d081d33_3ab645463ad13ea30c238ceac9bf56691ea8cada0b7c92413fecc09c2d081d33.jsonl.gz", "strip_func_name": "sub_4449C3", "query": "\n\n\n__int64 __fastcall sub_4449C3(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 *a5, unsigned int a6)\n{\n__int64 v7; // rax\n__int64 *v8; // rax\n_QWORD *v12; // [rsp+38h] [rbp-58h]\n__int64 v13; // [rsp+40h] [rbp-50h]\nint v14; // [rsp+4Ch] [rbp-44h]\n__int64 v15; // [rsp+50h] [rbp-40h]\nchar *v16; // [rsp+58h] [rbp-38h]\n__int64 v17; // [rsp+60h] [rbp-30h]\nchar *v18; // [rsp+68h] [rbp-28h]\nint v19; // [rsp+74h] [rbp-1Ch]\nchar *v20; // [rsp+78h] [rbp-18h]\nint i; // [rsp+84h] [rbp-Ch]\nchar *v22; // [rsp+88h] [rbp-8h]\n\nv18 = *(char **)(a3 + 32);\nv22 = v18;\nif ( v18 )\n{\ndo\n{\nfor ( i = 0; i < *v22; ++i )\n{\nv17 = *(_QWORD *)&v22[8 * i + 24];\nif ( !v22[1] || v17 )\n{\nv16 = *(char **)(v17 + 48);\nv20 = v16;\nif ( v16 )\n{\nwhile ( 2 )\n{\nv20 = (char *)*((_QWORD *)v20 + 1);\nv19 = *v20;\nwhile ( --v19 >= 0 )\n{\nv15 = *(_QWORD *)&v20[8 * v19 + 24];\nif ( (!v20[1] || v15) && *(_QWORD *)(v15 + 8) )\n{\nif ( v15 == a2 )\ngoto LABEL_17;\nv14 = sub_43E435(a1, a2, v15, a6);\nif ( v14 >= 0 )\n{\nif ( v14 )\n{\nv13 = sub_44480A((char **)(v17 + 48));\nv12 = sub_40BE1E(v17, *(_QWORD *)(v15 + 32), *(_QWORD *)(v15 + 24));\nv7 = v12[2];\nif ( !v7 )\nv7 = *(_QWORD *)(*(_QWORD *)(v15 + 32) + 16LL);\nv12[2] = v7;\nsub_444824((__int64 *)(v17 + 48), v13);\nv8 = (__int64 *)sub_444852(a5, (__int64)v12);\nsub_444928(a2, (__int64)v12, v8);\ngoto LABEL_23;\n}\n}\nelse if ( (*(_BYTE *)v15 & 0x7F) != 67 )\n{\nreturn 0LL;\n}\n}\n}\nif ( v20 != v16 )\ncontinue;\nbreak;\n}\n}\nLABEL_17:\nif ( a4 != *(_QWORD *)(v17 + 8) )\n{\n*(_QWORD *)(v17 + 8) = a4;\nif ( !(unsigned int)sub_4449C3(a1, a2, v17, a4, a5, a6) )\nreturn 0LL;\n}\n}\nLABEL_23:\n;\n}\nv22 = (char *)*((_QWORD *)v22 + 2);\n}\nwhile ( v22 != v18 );\n}\nreturn 1LL;\n}\n\n\n\nQ:[a3,a4,a1,a2,a5,a6,v12,v13,v14,v15,v16,v17,v18,v19,v20,i,v22,sub_4449C3,sub_43E435,sub_44480A,sub_40BE1E,sub_444824,sub_444852,sub_444928,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'bb', 'a4': 'generation', 'a1': 'pseudo', 'a2': 'insn', 'a5': 'dominators', 'a6': 'local', 'v12': 'phi', 'v13': 'br', 'v14': 'dominance', 'v15': 'one', 'v16': '__headone', 'v17': 'parent', 'v18': '__headparent', 'v19': '__nrone', 'v20': '__listone', 'i': '__nrparent', 'v22': '__listparent', 'sub_4449C3': 'find_dominating_parents', 'sub_43E435': 'dominates', 'sub_44480A': 'delete_last_instruction_3', 'sub_40BE1E': 'alloc_phi', 'sub_444824': 'add_instruction_3', 'sub_444852': 'add_pseudo_3', 'sub_444928': 'use_pseudo_2'}"}
display_icon
d4df84ecafb323f6f0a346a3a103c7075467f09b9b7969f8c20d2b007e407a6c
sparkfun
SparkFun_RTK_Firmware
NA
void display_icon ( ICON_ENTRY * icon ) { int bit; int display_width; const char * indent = " "; int index; int max_index; int x; int y; /* 0x20, 0x60, 0xC0, 0xFF, 0xFF, 0xC0, 0x60, 0x20, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00 ** ** ** ** ** ** ** ** ****** **** ** */ printf ("/*\r\n"); printf (" %s [%d, %d]\r\n", icon->name, icon->width, icon->height); printf ("\r\n"); if (DRAW_OUTLINE) { if (icon->width > 9) { printf ("%s ", indent); for (x = 1; x <= icon->width; x++) printf ("%c", (x % 10) ? ' ' : ('0' + (x / 10))); printf ("\r\n"); } printf ("%s ", indent); for (x = 1; x <= icon->width; x++) printf ("%d", x % 10); printf ("\r\n"); printf ("%s .", indent); for (x = 0; x < icon->width; x++) printf ("-"); printf (".\r\n"); } for (y = 0; y < icon->height; y++) { printf ("%s", indent); if (DRAW_OUTLINE) printf ("0x%02x|", 1 << (y & 7)); for (x = 0; x < icon->width; x++) { bit = icon->data[((y >> 3) * icon->bytes_wide) + x]; bit >>= y & 7; printf ("%c", (bit & 1) ? '*' : ' '); } if (DRAW_OUTLINE) printf ("|"); printf ("\r\n"); } if (DRAW_OUTLINE) { printf ("%s '", indent); for (x = 0; x < icon->width; x++) printf ("-"); printf ("'\r\n"); } printf ("*/\r\n"); printf ("\r\n"); // Display the symbols if requested if (DISPLAY_VARIABLES) { if (icon->height_name) printf ("const int %s = %d;\r\n", icon->height_name, icon->height); if (icon->width_name) printf ("const int %s = %d;\r\n", icon->width_name, icon->width); printf ("const uint8_t %s [] = {", icon->name); display_width = icon->bytes_wide; if (WRAP_AT_16 || (display_width > 20)) display_width = 16; max_index = icon->bytes_high * icon->bytes_wide; for (index = 0; index < max_index; index++) { if ((index % display_width) == 0) printf ("\r\n "); if (USE_UPPERCASE_A) printf (" 0x%02X", icon->data[index]); else printf (" 0x%02x", icon->data[index]); if (index != (max_index - 1)) printf (","); } if (ADD_TRAILING_COMMA) printf (","); printf ("\r\n"); printf ("};\r\n"); printf ("\r\n"); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_40195B", "function_addr": 4200795, "binary_name": "d4df84ecafb323f6f0a346a3a103c7075467f09b9b7969f8c20d2b007e407a6c.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_18], offset asc_402044"], [5, "mov edi, offset s"], [6, "call _puts"], [7, "mov rax, [rbp+var_28]"], [8, "mov ecx, [rax+10h]"], [9, "mov rax, [rbp+var_28]"], [10, "mov edx, [rax+20h]"], [11, "mov rax, [rbp+var_28]"], [12, "mov rax, [rax+8]"], [13, "mov rsi, rax"], [14, "mov edi, offset format"], [15, "mov eax, 0"], [16, "call _printf"], [17, "mov edi, offset asc_402063"], [18, "call _puts"], [19, "mov rax, [rbp+var_28]"], [20, "mov eax, [rax+20h]"], [21, "cmp eax, 9"], [22, "jle loc_401A50"], [23, "mov rax, [rbp+var_18]"], [24, "mov rsi, rax"], [25, "mov edi, offset aS"], [26, "mov eax, 0"], [27, "call _printf"], [28, "mov [rbp+var_C], 1"], [29, "jmp short loc_401A3A"], [30, "mov ecx, [rbp+var_C]"], [31, "movsxd rax, ecx"], [32, "imul rax, 66666667h"], [33, "shr rax, 20h"], [34, "sar eax, 2"], [35, "mov esi, ecx"], [36, "sar esi, 1Fh"], [37, "sub eax, esi"], [38, "mov edx, eax"], [39, "mov eax, edx"], [40, "shl eax, 2"], [41, "add eax, edx"], [42, "add eax, eax"], [43, "sub ecx, eax"], [44, "mov edx, ecx"], [45, "test edx, edx"], [46, "jnz short loc_401A2A"], [47, "mov eax, [rbp+var_C]"], [48, "movsxd rdx, eax"], [49, "imul rdx, 66666667h"], [50, "shr rdx, 20h"], [51, "sar edx, 2"], [52, "sar eax, 1Fh"], [53, "mov ecx, eax"], [54, "mov eax, edx"], [55, "sub eax, ecx"], [56, "add eax, 30h "], [57, "jmp short loc_401A2F"], [58, "mov eax, 20h "], [59, "mov edi, eax"], [60, "call _putchar"], [61, "add [rbp+var_C], 1"], [62, "mov rax, [rbp+var_28]"], [63, "mov eax, [rax+20h]"], [64, "cmp [rbp+var_C], eax"], [65, "jle short loc_4019DA"], [66, "mov edi, offset asc_402063"], [67, "call _puts"], [68, "mov rax, [rbp+var_18]"], [69, "mov rsi, rax"], [70, "mov edi, offset aS"], [71, "mov eax, 0"], [72, "call _printf"], [73, "mov [rbp+var_C], 1"], [74, "jmp short loc_401AAE"], [75, "mov ecx, [rbp+var_C]"], [76, "movsxd rax, ecx"], [77, "imul rax, 66666667h"], [78, "shr rax, 20h"], [79, "sar eax, 2"], [80, "mov esi, ecx"], [81, "sar esi, 1Fh"], [82, "sub eax, esi"], [83, "mov edx, eax"], [84, "mov eax, edx"], [85, "shl eax, 2"], [86, "add eax, edx"], [87, "add eax, eax"], [88, "sub ecx, eax"], [89, "mov edx, ecx"], [90, "mov esi, edx"], [91, "mov edi, offset aD"], [92, "mov eax, 0"], [93, "call _printf"], [94, "add [rbp+var_C], 1"], [95, "mov rax, [rbp+var_28]"], [96, "mov eax, [rax+20h]"], [97, "cmp [rbp+var_C], eax"], [98, "jle short loc_401A6F"], [99, "mov edi, offset asc_402063"], [100, "call _puts"], [101, "mov rax, [rbp+var_18]"], [102, "mov rsi, rax"], [103, "mov edi, offset aS_0"], [104, "mov eax, 0"], [105, "call _printf"], [106, "mov [rbp+var_C], 0"], [107, "jmp short loc_401AF1"], [108, "mov edi, 2Dh "], [109, "call _putchar"], [110, "add [rbp+var_C], 1"], [111, "mov rax, [rbp+var_28]"], [112, "mov eax, [rax+20h]"], [113, "cmp [rbp+var_C], eax"], [114, "jl short loc_401AE3"], [115, "mov edi, offset asc_402075"], [116, "call _puts"], [117, "mov [rbp+var_10], 0"], [118, "jmp loc_401BCC"], [119, "mov rax, [rbp+var_18]"], [120, "mov rsi, rax"], [121, "mov edi, offset aS_1"], [122, "mov eax, 0"], [123, "call _printf"], [124, "mov eax, [rbp+var_10]"], [125, "and eax, 7"], [126, "mov edx, 1"], [127, "mov ecx, eax"], [128, "shl edx, cl"], [129, "mov eax, edx"], [130, "mov esi, eax"], [131, "mov edi, offset a0x02x"], [132, "mov eax, 0"], [133, "call _printf"], [134, "mov [rbp+var_C], 0"], [135, "jmp short loc_401BA8"], [136, "mov eax, [rbp+var_10]"], [137, "sar eax, 3"], [138, "mov edx, eax"], [139, "mov rax, [rbp+var_28]"], [140, "mov eax, [rax+34h]"], [141, "imul edx, eax"], [142, "mov eax, [rbp+var_C]"], [143, "add eax, edx"], [144, "mov rdx, [rbp+var_28]"], [145, "cdqe"], [146, "movzx eax, byte ptr [rdx+rax+38h]"], [147, "movzx eax, al"], [148, "mov [rbp+var_20], eax"], [149, "mov eax, [rbp+var_10]"], [150, "and eax, 7"], [151, "mov ecx, eax"], [152, "sar [rbp+var_20], cl"], [153, "mov eax, [rbp+var_20]"], [154, "and eax, 1"], [155, "test eax, eax"], [156, "jz short loc_401B98"], [157, "mov eax, 2Ah "], [158, "jmp short loc_401B9D"], [159, "mov eax, 20h "], [160, "mov edi, eax"], [161, "call _putchar"], [162, "add [rbp+var_C], 1"], [163, "mov rax, [rbp+var_28]"], [164, "mov eax, [rax+20h]"], [165, "cmp [rbp+var_C], eax"], [166, "jl short loc_401B54"], [167, "mov edi, 7Ch "], [168, "call _putchar"], [169, "mov edi, offset asc_402063"], [170, "call _puts"], [171, "add [rbp+var_10], 1"], [172, "mov rax, [rbp+var_28]"], [173, "mov eax, [rax+10h]"], [174, "cmp [rbp+var_10], eax"], [175, "jl loc_401B13"], [176, "mov rax, [rbp+var_18]"], [177, "mov rsi, rax"], [178, "mov edi, offset aS_2"], [179, "mov eax, 0"], [180, "call _printf"], [181, "mov [rbp+var_C], 0"], [182, "jmp short loc_401C09"], [183, "mov edi, 2Dh "], [184, "call _putchar"], [185, "add [rbp+var_C], 1"], [186, "mov rax, [rbp+var_28]"], [187, "mov eax, [rax+20h]"], [188, "cmp [rbp+var_C], eax"], [189, "jl short loc_401BFB"], [190, "mov edi, offset asc_40208B"], [191, "call _puts"], [192, "mov edi, offset asc_40208E"], [193, "call _puts"], [194, "mov edi, offset asc_402063"], [195, "call _puts"], [196, "mov rax, [rbp+var_28]"], [197, "mov rax, [rax+18h]"], [198, "test rax, rax"], [199, "jz short loc_401C61"], [200, "mov rax, [rbp+var_28]"], [201, "mov edx, [rax+10h]"], [202, "mov rax, [rbp+var_28]"], [203, "mov rax, [rax+18h]"], [204, "mov rsi, rax"], [205, "mov edi, offset aConstIntSD"], [206, "mov eax, 0"], [207, "call _printf"], [208, "mov rax, [rbp+var_28]"], [209, "mov rax, [rax+28h]"], [210, "test rax, rax"], [211, "jz short loc_401C8F"], [212, "mov rax, [rbp+var_28]"], [213, "mov edx, [rax+20h]"], [214, "mov rax, [rbp+var_28]"], [215, "mov rax, [rax+28h]"], [216, "mov rsi, rax"], [217, "mov edi, offset aConstIntSD"], [218, "mov eax, 0"], [219, "call _printf"], [220, "mov rax, [rbp+var_28]"], [221, "mov rax, [rax+8]"], [222, "mov rsi, rax"], [223, "mov edi, offset aConstUint8TS"], [224, "mov eax, 0"], [225, "call _printf"], [226, "mov rax, [rbp+var_28]"], [227, "mov eax, [rax+34h]"], [228, "mov [rbp+var_4], eax"], [229, "cmp [rbp+var_4], 14h"], [230, "jle short loc_401CC0"], [231, "mov [rbp+var_4], 10h"], [232, "mov rax, [rbp+var_28]"], [233, "mov edx, [rax+30h]"], [234, "mov rax, [rbp+var_28]"], [235, "mov eax, [rax+34h]"], [236, "imul eax, edx"], [237, "mov [rbp+var_1C], eax"], [238, "mov [rbp+var_8], 0"], [239, "jmp short loc_401D34"], [240, "mov eax, [rbp+var_8]"], [241, "cdq"], [242, "idiv [rbp+var_4]"], [243, "mov eax, edx"], [244, "test eax, eax"], [245, "jnz short loc_401CF9"], [246, "mov edi, offset asc_4020BF"], [247, "mov eax, 0"], [248, "call _printf"], [249, "mov rdx, [rbp+var_28]"], [250, "mov eax, [rbp+var_8]"], [251, "cdqe"], [252, "movzx eax, byte ptr [rdx+rax+38h]"], [253, "movzx eax, al"], [254, "mov esi, eax"], [255, "mov edi, offset a0x02x_0"], [256, "mov eax, 0"], [257, "call _printf"], [258, "mov eax, [rbp+var_1C]"], [259, "sub eax, 1"], [260, "cmp [rbp+var_8], eax"], [261, "jz short loc_401D30"], [262, "mov edi, 2Ch "], [263, "call _putchar"], [264, "add [rbp+var_8], 1"], [265, "mov eax, [rbp+var_8]"], [266, "cmp eax, [rbp+var_1C]"], [267, "jl short loc_401CDD"], [268, "mov edi, offset asc_402063"], [269, "call _puts"], [270, "mov edi, offset asc_4020CB"], [271, "call _puts"], [272, "mov edi, offset asc_402063"], [273, "call _puts"], [274, "nop"], [275, "leave"], [276, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 3], [10, 9], [11, 3], [12, 11], [13, 12], [19, 3], [20, 19], [21, 20], [22, 21], [23, 4], [24, 23], [30, 61], [30, 28], [31, 30], [32, 31], [33, 32], [34, 33], [35, 30], [36, 35], [37, 34], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [41, 38], [42, 41], [43, 30], [43, 42], [44, 43], [45, 44], [46, 45], [47, 61], [47, 28], [48, 47], [49, 48], [50, 49], [51, 50], [52, 47], [53, 52], [54, 51], [55, 54], [55, 53], [56, 55], [59, 56], [59, 58], [61, 61], [61, 28], [62, 3], [63, 62], [64, 61], [64, 63], [64, 28], [65, 64], [68, 4], [69, 68], [75, 94], [75, 73], [76, 75], [77, 76], [78, 77], [79, 78], [80, 75], [81, 80], [82, 79], [82, 81], [83, 82], [84, 83], [85, 84], [86, 83], [86, 85], [87, 86], [88, 87], [88, 75], [89, 88], [90, 89], [94, 94], [94, 73], [95, 3], [96, 95], [97, 94], [97, 96], [97, 73], [98, 97], [101, 4], [102, 101], [110, 106], [110, 110], [111, 3], [112, 111], [113, 110], [113, 112], [113, 106], [114, 113], [119, 4], [120, 119], [124, 117], [124, 171], [125, 124], [127, 125], [128, 126], [128, 127], [129, 128], [130, 129], [136, 171], [136, 117], [137, 136], [138, 137], [139, 3], [140, 139], [141, 138], [141, 140], [142, 162], [142, 134], [143, 142], [143, 141], [144, 3], [146, 143], [147, 146], [148, 147], [149, 171], [149, 117], [150, 149], [151, 150], [152, 151], [152, 148], [153, 152], [154, 153], [155, 154], [156, 155], [160, 157], [160, 159], [162, 162], [162, 134], [163, 3], [164, 163], [165, 162], [165, 164], [165, 134], [166, 165], [171, 117], [171, 171], [172, 3], [173, 172], [174, 171], [174, 173], [174, 117], [175, 174], [176, 4], [177, 176], [185, 181], [185, 185], [186, 3], [187, 186], [188, 187], [188, 181], [188, 185], [189, 188], [196, 3], [197, 196], [198, 197], [199, 198], [200, 3], [201, 200], [202, 3], [203, 202], [204, 203], [208, 3], [209, 208], [210, 209], [211, 210], [212, 3], [213, 212], [214, 3], [215, 214], [216, 215], [220, 3], [221, 220], [222, 221], [226, 3], [227, 226], [228, 227], [229, 228], [230, 229], [232, 3], [233, 232], [234, 3], [235, 234], [236, 233], [236, 235], [237, 236], [240, 264], [240, 238], [242, 231], [242, 242], [242, 228], [243, 249], [243, 233], [244, 243], [245, 244], [249, 3], [250, 264], [250, 238], [252, 250], [253, 252], [254, 253], [258, 237], [259, 258], [260, 238], [260, 264], [260, 259], [261, 260], [264, 264], [264, 238], [265, 264], [265, 238], [266, 265], [266, 237], [267, 266], [276, 273]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/d4df84ecafb323f6f0a346a3a103c7075467f09b9b7969f8c20d2b007e407a6c_d4df84ecafb323f6f0a346a3a103c7075467f09b9b7969f8c20d2b007e407a6c.jsonl.gz", "strip_func_name": "sub_40195B", "query": "\n\n\nint __fastcall sub_40195B(__int64 a1)\n{\nint v1; // eax\nint v2; // eax\nint v4; // [rsp+14h] [rbp-1Ch]\nint l; // [rsp+20h] [rbp-10h]\nint i; // [rsp+24h] [rbp-Ch]\nint j; // [rsp+24h] [rbp-Ch]\nint k; // [rsp+24h] [rbp-Ch]\nint m; // [rsp+24h] [rbp-Ch]\nint n; // [rsp+24h] [rbp-Ch]\nint ii; // [rsp+28h] [rbp-8h]\nint v12; // [rsp+2Ch] [rbp-4h]\n\nputs(\"/*\\r\");\nprintf(\" %s [%d, %d]\\r\\n\", *(const char **)(a1 + 8), *(unsigned int *)(a1 + 32), *(unsigned int *)(a1 + 16));\nputs(\"\\r\");\nif ( *(int *)(a1 + 32) > 9 )\n{\nprintf(\"%s \", \" \");\nfor ( i = 1; i <= *(_DWORD *)(a1 + 32); ++i )\n{\nif ( i % 10 )\nv1 = 32;\nelse\nv1 = i / 10 + 48;\nputchar(v1);\n}\nputs(\"\\r\");\n}\nprintf(\"%s \", \" \");\nfor ( j = 1; j <= *(_DWORD *)(a1 + 32); ++j )\nprintf(\"%d\", (unsigned int)(j % 10));\nputs(\"\\r\");\nprintf(\"%s .\", \" \");\nfor ( k = 0; k < *(_DWORD *)(a1 + 32); ++k )\nputchar(45);\nputs(\".\\r\");\nfor ( l = 0; l < *(_DWORD *)(a1 + 16); ++l )\n{\nprintf(\"%s\", \" \");\nprintf(\"0x%02x|\", (unsigned int)(1 << (l & 7)));\nfor ( m = 0; m < *(_DWORD *)(a1 + 32); ++m )\n{\nif ( (((int)*(unsigned __int8 *)(a1 + *(_DWORD *)(a1 + 52) * (l >> 3) + m + 56) >> (l & 7)) & 1) != 0 )\nv2 = 42;\nelse\nv2 = 32;\nputchar(v2);\n}\nputchar(124);\nputs(\"\\r\");\n}\nprintf(\"%s '\", \" \");\nfor ( n = 0; n < *(_DWORD *)(a1 + 32); ++n )\nputchar(45);\nputs(\"'\\r\");\nputs(\"*/\\r\");\nputs(\"\\r\");\nif ( *(_QWORD *)(a1 + 24) )\nprintf(\"const int %s = %d;\\r\\n\", *(const char **)(a1 + 24), *(unsigned int *)(a1 + 16));\nif ( *(_QWORD *)(a1 + 40) )\nprintf(\"const int %s = %d;\\r\\n\", *(const char **)(a1 + 40), *(unsigned int *)(a1 + 32));\nprintf(\"const uint8_t %s [] = {\", *(const char **)(a1 + 8));\nv12 = *(_DWORD *)(a1 + 52);\nif ( v12 > 20 )\nv12 = 16;\nv4 = *(_DWORD *)(a1 + 48) * *(_DWORD *)(a1 + 52);\nfor ( ii = 0; ii < v4; ++ii )\n{\nif ( !(ii % v12) )\nprintf(\"\\r\\n \");\nprintf(\" 0x%02X\", *(unsigned __int8 *)(a1 + ii + 56));\nif ( ii != v4 - 1 )\nputchar(44);\n}\nputs(\"\\r\");\nputs(\"};\\r\");\nreturn puts(\"\\r\");\n}\n\n\n\nQ:[a1,v4,l,i,ii,v12,sub_40195B,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'icon', 'v4': 'max_index', 'l': 'y', 'i': 'xd', 'ii': 'index', 'v12': 'display_width', 'sub_40195B': 'display_icon'}"}
filtering_candidates_buffered_kmer_filter_retrieve_region
2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3
smarco
gem3-mapper
NA
void filtering_candidates_buffered_kmer_filter_retrieve_region( filtering_candidates_buffered_t* const filtering_candidates_buffered, filtering_candidates_t* const filtering_candidates, filtering_region_t* const filtering_region, pattern_t* const pattern, gpu_buffer_kmer_filter_t* const gpu_buffer_kmer_filter, uint64_t* const gpu_buffer_offset) { // Parameters alignment_t* const alignment = &filtering_region->alignment; pattern_tiled_t* const pattern_tiled = &pattern->pattern_tiled; const uint64_t max_error = pattern->max_effective_filtering_error; // Detect trimmed matches if (!pattern_tiled->kmer_filter_nway.enabled){ alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN; vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*); PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED); return; } if (filtering_region->key_trimmed || pattern->key_length < FILTERING_CANDIDATES_KMER_FILTER_MIN_KEY_LENGTH) { alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN; vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*); PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED); return; } // Detect exact-matches if (filtering_region->alignment.distance_min_bound == 0) { vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*); PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED); return; } // Retrieve min-bound uint64_t min_distance_bound; if (gpu_buffer_kmer_filter->kmer_filter_enabled) { min_distance_bound = gpu_buffer_kmer_filter_get_min_edit_bound( gpu_buffer_kmer_filter,*gpu_buffer_offset, pattern_tiled->kmer_filter_nway.num_tiles); *gpu_buffer_offset += pattern_tiled->kmer_filter_nway.num_tiles; // DEBUG #ifdef GPU_CHECK_KMER_FILTER const uint64_t min_distance_bound_check = filtering_candidates_buffered_kmer_filter_compute_alignment( filtering_candidates,filtering_region,pattern); if (min_distance_bound_check != min_distance_bound) { fprintf(stderr,"GPU.Kmer-Filter. Difference detected (CPU=%lu;GPU=%lu)\n", min_distance_bound_check,min_distance_bound); } #endif } else { min_distance_bound = 0; // Unknown // filtering_candidates_buffered_kmer_filter_compute_alignment( // filtering_candidates,filtering_region,pattern); } if (min_distance_bound <= max_error) { alignment->distance_min_bound = ALIGN_DISTANCE_UNKNOWN; vector_insert(filtering_candidates->filtering_regions,filtering_region,filtering_region_t*); PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_ACCEPTED); } else { // Discarded candidate filtering_region->status = filtering_region_verified_discarded; alignment->distance_min_bound = ALIGN_DISTANCE_INF; // Add to discarded candidates (buffered) const uint64_t num_discarded_regions = filtering_candidates_buffered->num_discarded_regions; filtering_candidates_buffered->discarded_regions[num_discarded_regions] = filtering_region; ++(filtering_candidates_buffered->num_discarded_regions); PROF_INC_COUNTER(GP_FC_KMER_COUNTER_FILTER_DISCARDED); } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_42695B", "function_addr": 4352347, "binary_name": "2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.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+var_48], rdx"], [6, "mov [rbp+var_50], rcx"], [7, "mov [rbp+var_58], r8"], [8, "mov [rbp+var_60], r9"], [9, "mov rax, [rbp+var_48]"], [10, "add rax, 0B0h"], [11, "mov [rbp+var_10], rax"], [12, "mov rax, [rbp+var_50]"], [13, "add rax, 68h "], [14, "mov [rbp+var_18], rax"], [15, "mov rax, [rbp+var_50]"], [16, "mov rax, [rax+50h]"], [17, "mov [rbp+var_20], rax"], [18, "mov rax, [rbp+var_18]"], [19, "movzx eax, byte ptr [rax+70h]"], [20, "xor eax, 1"], [21, "test al, al"], [22, "jz short loc_426A23"], [23, "mov rax, [rbp+var_10]"], [24, "mov esi, 0FFFFFFFEh"], [25, "mov [rax+8], rsi"], [26, "mov rax, [rbp+var_40]"], [27, "mov rax, [rax+18h]"], [28, "mov rax, [rax+8]"], [29, "lea rcx, [rax+1]"], [30, "mov rax, [rbp+var_40]"], [31, "mov rax, [rax+18h]"], [32, "mov edx, 0"], [33, "mov rsi, rcx"], [34, "mov rdi, rax"], [35, "call sub_47D500"], [36, "mov rax, [rbp+var_40]"], [37, "mov rax, [rax+18h]"], [38, "mov rdx, [rax]"], [39, "mov rax, [rbp+var_40]"], [40, "mov rax, [rax+18h]"], [41, "mov rax, [rax+8]"], [42, "shl rax, 3"], [43, "add rdx, rax"], [44, "mov rax, [rbp+var_48]"], [45, "mov [rdx], rax"], [46, "mov rax, [rbp+var_40]"], [47, "mov rax, [rax+18h]"], [48, "mov rdx, [rax+8]"], [49, "add rdx, 1"], [50, "mov [rax+8], rdx"], [51, "jmp locret_426C4F"], [52, "mov rax, [rbp+var_48]"], [53, "movzx eax, byte ptr [rax+0A8h]"], [54, "test al, al"], [55, "jnz short loc_426A42"], [56, "mov rax, [rbp+var_50]"], [57, "mov rax, [rax+10h]"], [58, "cmp rax, 3D08Fh"], [59, "ja short loc_426AB5"], [60, "mov rax, [rbp+var_10]"], [61, "mov edi, 0FFFFFFFEh"], [62, "mov [rax+8], rdi"], [63, "mov rax, [rbp+var_40]"], [64, "mov rax, [rax+18h]"], [65, "mov rax, [rax+8]"], [66, "lea rcx, [rax+1]"], [67, "mov rax, [rbp+var_40]"], [68, "mov rax, [rax+18h]"], [69, "mov edx, 0"], [70, "mov rsi, rcx"], [71, "mov rdi, rax"], [72, "call sub_47D500"], [73, "mov rax, [rbp+var_40]"], [74, "mov rax, [rax+18h]"], [75, "mov rdx, [rax]"], [76, "mov rax, [rbp+var_40]"], [77, "mov rax, [rax+18h]"], [78, "mov rax, [rax+8]"], [79, "shl rax, 3"], [80, "add rdx, rax"], [81, "mov rax, [rbp+var_48]"], [82, "mov [rdx], rax"], [83, "mov rax, [rbp+var_40]"], [84, "mov rax, [rax+18h]"], [85, "mov rdx, [rax+8]"], [86, "add rdx, 1"], [87, "mov [rax+8], rdx"], [88, "jmp locret_426C4F"], [89, "mov rax, [rbp+var_48]"], [90, "mov rax, [rax+0B8h]"], [91, "test rax, rax"], [92, "jnz short loc_426B2B"], [93, "mov rax, [rbp+var_40]"], [94, "mov rax, [rax+18h]"], [95, "mov rax, [rax+8]"], [96, "lea rcx, [rax+1]"], [97, "mov rax, [rbp+var_40]"], [98, "mov rax, [rax+18h]"], [99, "mov edx, 0"], [100, "mov rsi, rcx"], [101, "mov rdi, rax"], [102, "call sub_47D500"], [103, "mov rax, [rbp+var_40]"], [104, "mov rax, [rax+18h]"], [105, "mov rdx, [rax]"], [106, "mov rax, [rbp+var_40]"], [107, "mov rax, [rax+18h]"], [108, "mov rax, [rax+8]"], [109, "shl rax, 3"], [110, "add rdx, rax"], [111, "mov rax, [rbp+var_48]"], [112, "mov [rdx], rax"], [113, "mov rax, [rbp+var_40]"], [114, "mov rax, [rax+18h]"], [115, "mov rdx, [rax+8]"], [116, "add rdx, 1"], [117, "mov [rax+8], rdx"], [118, "jmp locret_426C4F"], [119, "mov rax, [rbp+var_58]"], [120, "movzx eax, byte ptr [rax+8]"], [121, "test al, al"], [122, "jz short loc_426B7C"], [123, "mov rax, [rbp+var_18]"], [124, "mov rdx, [rax+0A8h]"], [125, "mov rax, [rbp+var_60]"], [126, "mov rcx, [rax]"], [127, "mov rax, [rbp+var_58]"], [128, "mov rsi, rcx"], [129, "mov rdi, rax"], [130, "call sub_4320A2"], [131, "mov [rbp+var_8], rax"], [132, "mov rax, [rbp+var_60]"], [133, "mov rdx, [rax]"], [134, "mov rax, [rbp+var_18]"], [135, "mov rax, [rax+0A8h]"], [136, "add rdx, rax"], [137, "mov rax, [rbp+var_60]"], [138, "mov [rax], rdx"], [139, "jmp short loc_426B84"], [140, "mov [rbp+var_8], 0"], [141, "mov rax, [rbp+var_8]"], [142, "cmp rax, [rbp+var_20]"], [143, "ja short loc_426BFE"], [144, "mov rax, [rbp+var_10]"], [145, "mov esi, 0FFFFFFFEh"], [146, "mov [rax+8], rsi"], [147, "mov rax, [rbp+var_40]"], [148, "mov rax, [rax+18h]"], [149, "mov rax, [rax+8]"], [150, "lea rcx, [rax+1]"], [151, "mov rax, [rbp+var_40]"], [152, "mov rax, [rax+18h]"], [153, "mov edx, 0"], [154, "mov rsi, rcx"], [155, "mov rdi, rax"], [156, "call sub_47D500"], [157, "mov rax, [rbp+var_40]"], [158, "mov rax, [rax+18h]"], [159, "mov rdx, [rax]"], [160, "mov rax, [rbp+var_40]"], [161, "mov rax, [rax+18h]"], [162, "mov rax, [rax+8]"], [163, "shl rax, 3"], [164, "add rdx, rax"], [165, "mov rax, [rbp+var_48]"], [166, "mov [rdx], rax"], [167, "mov rax, [rbp+var_40]"], [168, "mov rax, [rax+18h]"], [169, "mov rdx, [rax+8]"], [170, "add rdx, 1"], [171, "mov [rax+8], rdx"], [172, "jmp short locret_426C4F"], [173, "mov rax, [rbp+var_48]"], [174, "mov dword ptr [rax], 2"], [175, "mov rax, [rbp+var_10]"], [176, "mov edi, 0FFFFFFFFh"], [177, "mov [rax+8], rdi"], [178, "mov rax, [rbp+var_38]"], [179, "mov rax, [rax+30h]"], [180, "mov [rbp+var_28], rax"], [181, "mov rax, [rbp+var_38]"], [182, "mov rdx, [rax+28h]"], [183, "mov rax, [rbp+var_28]"], [184, "shl rax, 3"], [185, "add rdx, rax"], [186, "mov rax, [rbp+var_48]"], [187, "mov [rdx], rax"], [188, "mov rax, [rbp+var_38]"], [189, "mov rax, [rax+30h]"], [190, "lea rdx, [rax+1]"], [191, "mov rax, [rbp+var_38]"], [192, "mov [rax+30h], rdx"], [193, "leave"], [194, "retn"]], "data_dep": [[9, 5], [10, 9], [11, 10], [12, 6], [13, 12], [14, 13], [15, 6], [16, 15], [17, 16], [18, 14], [19, 18], [20, 19], [21, 20], [22, 21], [23, 11], [25, 23], [25, 24], [26, 4], [27, 26], [27, 25], [28, 25], [28, 27], [29, 28], [29, 25], [30, 4], [31, 30], [31, 25], [33, 29], [34, 31], [36, 4], [37, 25], [37, 36], [38, 25], [38, 37], [39, 4], [40, 25], [40, 39], [41, 40], [41, 25], [42, 41], [43, 38], [43, 42], [44, 5], [45, 43], [45, 44], [46, 4], [47, 45], [47, 46], [48, 45], [48, 47], [48, 25], [49, 48], [50, 47], [50, 49], [52, 5], [53, 52], [54, 53], [55, 54], [56, 6], [57, 56], [58, 57], [59, 58], [60, 11], [62, 60], [62, 61], [63, 4], [64, 62], [64, 63], [65, 62], [65, 64], [66, 62], [66, 65], [67, 4], [68, 67], [68, 62], [70, 66], [71, 68], [73, 4], [74, 73], [74, 62], [75, 74], [75, 62], [76, 4], [77, 62], [77, 76], [78, 77], [78, 62], [79, 78], [80, 75], [80, 79], [81, 5], [82, 81], [82, 80], [83, 4], [84, 83], [84, 82], [85, 82], [85, 84], [85, 62], [86, 85], [87, 84], [87, 86], [89, 5], [90, 89], [91, 90], [92, 91], [93, 4], [94, 93], [95, 94], [96, 95], [97, 4], [98, 97], [100, 96], [101, 98], [103, 4], [104, 103], [105, 104], [106, 4], [107, 106], [108, 107], [109, 108], [110, 109], [110, 105], [111, 5], [112, 111], [112, 110], [113, 4], [114, 113], [114, 112], [115, 112], [115, 114], [116, 115], [117, 114], [117, 116], [119, 7], [120, 119], [121, 120], [122, 121], [123, 14], [124, 123], [125, 8], [126, 125], [127, 7], [128, 126], [129, 127], [133, 132], [135, 134], [136, 135], [136, 133], [138, 137], [138, 136], [141, 131], [141, 140], [142, 141], [142, 17], [143, 142], [144, 11], [146, 145], [146, 144], [147, 4], [148, 147], [148, 146], [149, 146], [149, 148], [150, 149], [150, 146], [151, 4], [152, 151], [152, 146], [154, 150], [155, 152], [157, 4], [158, 146], [158, 157], [159, 146], [159, 138], [159, 158], [160, 4], [161, 160], [161, 146], [162, 161], [162, 146], [163, 162], [164, 159], [164, 163], [165, 5], [166, 165], [166, 164], [167, 4], [168, 166], [168, 167], [169, 146], [169, 166], [169, 168], [170, 169], [171, 168], [171, 170], [173, 5], [174, 173], [175, 11], [177, 176], [177, 175], [178, 3], [179, 178], [179, 177], [180, 179], [181, 3], [182, 177], [182, 181], [183, 180], [184, 183], [185, 182], [185, 184], [186, 5], [187, 185], [187, 186], [188, 3], [189, 188], [189, 187], [190, 185], [190, 187], [190, 189], [191, 3], [192, 190], [192, 191], [194, 114], [194, 84], [194, 168], [194, 191], [194, 47]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3_2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.jsonl.gz", "strip_func_name": "sub_42695B", "query": "\n\n\n__int64 __fastcall sub_42695B(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, _QWORD *a6)\n{\n__int64 result; // rax\n\nif ( *(_BYTE *)(a4 + 216) == 1 && !*(_BYTE *)(a3 + 168) && *(_QWORD *)(a4 + 16) > 0x3D08FuLL )\n{\nif ( !*(_QWORD *)(a3 + 184) )\n{\nsub_47D500(*(_QWORD *)(a2 + 24), *(_QWORD *)(*(_QWORD *)(a2 + 24) + 8LL) + 1LL, 0LL);\n*(_QWORD *)(8LL * *(_QWORD *)(*(_QWORD *)(a2 + 24) + 8LL) + **(_QWORD **)(a2 + 24)) = a3;\nresult = *(_QWORD *)(a2 + 24);\n++*(_QWORD *)(result + 8);\nreturn result;\n}\nif ( *(_BYTE *)(a5 + 8) )\nsub_4320A2(a5, *a6, *(_QWORD *)(a4 + 272));\n}\n*(_QWORD *)(a3 + 184) = 4294967294LL;\nsub_47D500(*(_QWORD *)(a2 + 24), *(_QWORD *)(*(_QWORD *)(a2 + 24) + 8LL) + 1LL, 0LL);\n*(_QWORD *)(8LL * *(_QWORD *)(*(_QWORD *)(a2 + 24) + 8LL) + **(_QWORD **)(a2 + 24)) = a3;\nresult = *(_QWORD *)(a2 + 24);\n++*(_QWORD *)(result + 8);\nreturn result;\n}\n\n\n\nQ:[a3,a4,a2,a5,a6,a1,sub_42695B,sub_47D500,sub_4320A2,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'filtering_region', 'a4': 'pattern', 'a2': 'filtering_candidates', 'a5': 'gpu_buffer_kmer_filter', 'a6': 'gpu_buffer_offset', 'a1': 'filtering_candidates_buffered', 'sub_42695B': 'filtering_candidates_buffered_kmer_filter_retrieve_region', 'sub_47D500': 'vector_reserve', 'sub_4320A2': 'gpu_buffer_kmer_filter_get_min_edit_bound'}"}
snum
f8643e6b5b09093b12ae8fad3c4cdbf0b6ef786af63fd564d389e89ab3be0270
clerkma
texlive-mobile
NA
long snum(int size) { register int i; register long x; pc += size; x = getc(dvifp); if (x & 0x80) x -= 0x100; for (i = size - 1; i > 0; i--) x = (x << 8) + (unsigned) getc(dvifp); return x; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402248", "function_addr": 4203080, "binary_name": "f8643e6b5b09093b12ae8fad3c4cdbf0b6ef786af63fd564d389e89ab3be0270.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "push r12"], [3, "push rbx"], [4, "sub rsp, 10h"], [5, "mov [rbp+var_14], edi"], [6, "mov eax, [rbp+var_14]"], [7, "movsxd rdx, eax"], [8, "mov rax, cs:qword_406108"], [9, "add rax, rdx"], [10, "mov cs:qword_406108, rax"], [11, "mov rax, cs:stream"], [12, "mov rdi, rax"], [13, "call _getc"], [14, "movsxd rbx, eax"], [15, "mov rax, rbx"], [16, "and eax, 80h"], [17, "test rax, rax"], [18, "jz short loc_402293"], [19, "sub rbx, 100h"], [20, "mov eax, [rbp+var_14]"], [21, "lea r12d, [rax-1]"], [22, "jmp short loc_4022B8"], [23, "shl rbx, 8"], [24, "mov rax, cs:stream"], [25, "mov rdi, rax"], [26, "call _getc"], [27, "mov eax, eax"], [28, "add rbx, rax"], [29, "sub r12d, 1"], [30, "test r12d, r12d"], [31, "jg short loc_40229C"], [32, "mov rax, rbx"], [33, "add rsp, 10h"], [34, "pop rbx"], [35, "pop r12"], [36, "pop rbp"], [37, "retn"]], "data_dep": [[6, 5], [7, 6], [9, 8], [9, 7], [10, 9], [12, 11], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 14], [20, 5], [21, 20], [23, 19], [23, 28], [23, 14], [25, 24], [27, 26], [28, 27], [28, 23], [29, 30], [30, 21], [30, 29], [31, 30], [32, 14], [32, 19], [32, 28], [33, 4], [34, 3], [35, 2], [36, 0], [37, 32]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/f8643e6b5b09093b12ae8fad3c4cdbf0b6ef786af63fd564d389e89ab3be0270_f8643e6b5b09093b12ae8fad3c4cdbf0b6ef786af63fd564d389e89ab3be0270.jsonl.gz", "strip_func_name": "sub_402248", "query": "\n\n\n__int64 __fastcall sub_402248(int a1)\n{\nint v1; // eax\n__int64 v2; // rbx\nint i; // er12\n\nqword_406108 += a1;\nv1 = getc(stream);\nv2 = v1;\nif ( (v1 & 0x80) != 0 )\nv2 = v1 - 256LL;\nfor ( i = a1 - 1; i > 0; --i )\nv2 = (unsigned int)getc(stream) + (v2 << 8);\nreturn v2;\n}\n\n\n\nQ:[a1,sub_402248,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'size', 'sub_402248': 'snum'}"}
handle_read_request2
32e5bef9a534f6a023b94f0e20e0c28fed442ec28edeb1e289ac97b9496f472a
micropython
micropython-unicorn
NA
static uint16_t handle_read_request2(att_connection_t * att_connection, uint8_t * response_buffer, uint16_t response_buffer_size, uint16_t handle){ log_info("ATT_READ_REQUEST: handle %04x", handle); uint8_t request_type = ATT_READ_REQUEST; att_iterator_t it; int ok = att_find_handle(&it, handle); if (!ok){ return setup_error_invalid_handle(response_buffer, request_type, handle); } // check if handle can be read if ((it.flags & ATT_PROPERTY_READ) == 0) { return setup_error_read_not_permitted(response_buffer, request_type, handle); } // check security requirements uint8_t error_code = att_validate_security(att_connection, ATT_READ, &it); if (error_code) { return setup_error(response_buffer, request_type, handle, error_code); } att_update_value_len(&it, att_connection->con_handle); #ifdef ENABLE_ATT_DELAYED_RESPONSE if (it.value_len == ATT_READ_RESPONSE_PENDING) return ATT_READ_RESPONSE_PENDING; #endif // store uint16_t offset = 1; uint16_t bytes_copied = att_copy_value(&it, 0, response_buffer + offset, response_buffer_size - offset, att_connection->con_handle); offset += bytes_copied; response_buffer[0] = ATT_READ_RESPONSE; return offset; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_437374", "function_addr": 4420468, "binary_name": "32e5bef9a534f6a023b94f0e20e0c28fed442ec28edeb1e289ac97b9496f472a.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 eax, ecx"], [6, "mov [rbp+var_54], dx"], [7, "mov [rbp+var_58], ax"], [8, "movzx eax, [rbp+var_58]"], [9, "mov r8d, eax"], [10, "mov ecx, 293h"], [11, "mov edx, offset aAttDbC"], [12, "mov esi, offset aSUAttReadReque"], [13, "mov edi, 1"], [14, "mov eax, 0"], [15, "call sub_41A13D"], [16, "mov [rbp+var_1], 0Ah"], [17, "movzx edx, [rbp+var_58]"], [18, "lea rax, [rbp+var_40]"], [19, "mov esi, edx"], [20, "mov rdi, rax"], [21, "call sub_43627A"], [22, "mov [rbp+var_8], eax"], [23, "cmp [rbp+var_8], 0"], [24, "jnz short loc_4373ED"], [25, "movzx edx, [rbp+var_58]"], [26, "movzx ecx, [rbp+var_1]"], [27, "mov rax, [rbp+var_50]"], [28, "mov esi, ecx"], [29, "mov rdi, rax"], [30, "call sub_43679D"], [31, "jmp locret_4374CD"], [32, "movzx eax, [rbp+var_36]"], [33, "movzx eax, ax"], [34, "and eax, 2"], [35, "test eax, eax"], [36, "jnz short loc_437416"], [37, "movzx edx, [rbp+var_58]"], [38, "movzx ecx, [rbp+var_1]"], [39, "mov rax, [rbp+var_50]"], [40, "mov esi, ecx"], [41, "mov rdi, rax"], [42, "call sub_4366FE"], [43, "jmp locret_4374CD"], [44, "lea rdx, [rbp+var_40]"], [45, "mov rax, [rbp+var_48]"], [46, "mov esi, 0"], [47, "mov rdi, rax"], [48, "call sub_436835"], [49, "mov [rbp+var_9], al"], [50, "cmp [rbp+var_9], 0"], [51, "jz short loc_43744E"], [52, "movzx ecx, [rbp+var_9]"], [53, "movzx edx, [rbp+var_58]"], [54, "movzx esi, [rbp+var_1]"], [55, "mov rax, [rbp+var_50]"], [56, "mov rdi, rax"], [57, "call sub_4366A0"], [58, "jmp short locret_4374CD"], [59, "mov rax, [rbp+var_48]"], [60, "movzx eax, word ptr [rax]"], [61, "movzx edx, ax"], [62, "lea rax, [rbp+var_40]"], [63, "mov esi, edx"], [64, "mov rdi, rax"], [65, "call sub_43633C"], [66, "movzx eax, [rbp+var_28]"], [67, "cmp ax, 0FFFFh"], [68, "jnz short loc_437477"], [69, "mov eax, 0FFFFFFFFh"], [70, "jmp short locret_4374CD"], [71, "mov [rbp+var_C], 1"], [72, "mov rax, [rbp+var_48]"], [73, "movzx eax, word ptr [rax]"], [74, "movzx ecx, ax"], [75, "movzx eax, [rbp+var_54]"], [76, "sub ax, [rbp+var_C]"], [77, "movzx edx, ax"], [78, "movzx esi, [rbp+var_C]"], [79, "mov rax, [rbp+var_50]"], [80, "add rsi, rax"], [81, "lea rax, [rbp+var_40]"], [82, "mov r8d, ecx"], [83, "mov ecx, edx"], [84, "mov rdx, rsi"], [85, "mov esi, 0"], [86, "mov rdi, rax"], [87, "call sub_43639A"], [88, "mov [rbp+var_E], ax"], [89, "movzx eax, [rbp+var_E]"], [90, "add [rbp+var_C], ax"], [91, "mov rax, [rbp+var_50]"], [92, "mov byte ptr [rax], 0Bh"], [93, "movzx eax, [rbp+var_C]"], [94, "leave"], [95, "retn"]], "data_dep": [[7, 5], [8, 7], [9, 8], [17, 7], [18, 15], [19, 17], [20, 18], [22, 21], [23, 22], [24, 23], [25, 7], [26, 16], [27, 4], [28, 26], [29, 27], [33, 32], [34, 33], [35, 34], [36, 35], [37, 7], [38, 16], [39, 4], [40, 38], [41, 39], [44, 17], [45, 3], [47, 45], [49, 48], [50, 49], [51, 50], [52, 49], [53, 7], [54, 16], [55, 4], [56, 55], [59, 3], [60, 59], [61, 60], [62, 60], [63, 61], [64, 62], [67, 66], [68, 67], [72, 3], [73, 72], [74, 73], [75, 6], [76, 75], [76, 71], [77, 76], [78, 71], [79, 4], [80, 79], [80, 78], [81, 79], [82, 74], [83, 77], [84, 80], [86, 81], [88, 87], [89, 88], [90, 71], [90, 89], [91, 4], [92, 91], [93, 90], [95, 69], [95, 57], [95, 93], [95, 30], [95, 42]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/32e5bef9a534f6a023b94f0e20e0c28fed442ec28edeb1e289ac97b9496f472a_32e5bef9a534f6a023b94f0e20e0c28fed442ec28edeb1e289ac97b9496f472a.jsonl.gz", "strip_func_name": "sub_437374", "query": "\n\n\n__int64 __fastcall sub_437374(_BYTE *a1, _BYTE *a2, __int16 a3, unsigned __int16 a4, __int64 a5, __int64 a6)\n{\n_WORD v9[5]; // [rsp+20h] [rbp-40h] BYREF\n__int16 v10; // [rsp+2Ah] [rbp-36h]\n__int16 v11; // [rsp+38h] [rbp-28h]\n__int16 v12; // [rsp+52h] [rbp-Eh]\nunsigned __int16 v13; // [rsp+54h] [rbp-Ch]\nchar v14; // [rsp+57h] [rbp-9h]\nchar v16; // [rsp+5Fh] [rbp-1h]\n\nsub_41A13D(1, \"%s.%u: ATT_READ_REQUEST: handle %04x\", (__int64)\"att_db.c\", 659LL, a4, a6);\nv16 = 10;\nif ( !(unsigned int)sub_43627A((__int64)v9, a4) )\nreturn sub_43679D(a2, v16, a4);\nif ( (v10 & 2) == 0 )\nreturn sub_4366FE(a2, v16, a4);\nv14 = sub_436835(a1, 0, (__int64)v9);\nif ( v14 )\nreturn sub_4366A0(a2, v16, a4, v14);\nsub_43633C(v9, *(_WORD *)a1);\nif ( v11 == -1 )\nreturn 0xFFFFFFFFLL;\nv13 = 1;\nv12 = sub_43639A((__int64)v9, 0, a2 + 1, a3 - 1, *(_WORD *)a1);\nv13 += v12;\n*a2 = 11;\nreturn v13;\n}\n\n\n\nQ:[a3,a4,a1,a2,v9,v12,v13,v14,v16,sub_437374,sub_41A13D,sub_43627A,sub_43679D,sub_4366FE,sub_436835,sub_4366A0,sub_43633C,sub_43639A,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'response_buffer_size', 'a4': 'handle', 'a1': 'att_connection', 'a2': 'response_buffer', 'v9': 'it', 'v12': 'bytes_copied', 'v13': 'offset', 'v14': 'error_code', 'v16': 'request_type', 'sub_437374': 'handle_read_request2', 'sub_41A13D': 'hci_dump_log', 'sub_43627A': 'att_find_handle', 'sub_43679D': 'setup_error_invalid_handle', 'sub_4366FE': 'setup_error_read_not_permitted', 'sub_436835': 'att_validate_security', 'sub_4366A0': 'setup_error', 'sub_43633C': 'att_update_value_len', 'sub_43639A': 'att_copy_value'}"}
btstack_tlv_posix_append_tag
c0fe0b1d115c9a9d40b2c9859f7dfd1ea6098b73116e2548a49a45e30fbdd252
bluekitchen
btstack
NA
static void btstack_tlv_posix_append_tag(btstack_tlv_posix_t * self, uint32_t tag, const uint8_t * data, uint32_t data_size){ if (!self->file) return; log_info("append tag %04x, len %u", tag, data_size); uint8_t header[8]; big_endian_store_32(header, 0, tag); big_endian_store_32(header, 4, data_size); size_t written_header = fwrite(header, 1, sizeof(header), self->file); if (written_header != sizeof(header)) return; if (data_size > 0) { size_t written_value = fwrite(data, 1, data_size, self->file); if (written_value != data_size) return; } fflush(self->file); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_403068", "function_addr": 4206696, "binary_name": "c0fe0b1d115c9a9d40b2c9859f7dfd1ea6098b73116e2548a49a45e30fbdd252.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 40h"], [3, "mov [rbp+var_28], rdi"], [4, "mov dword ptr [rbp+n+4], esi"], [5, "mov [rbp+var_38], rdx"], [6, "mov dword ptr [rbp+n], ecx"], [7, "mov rax, [rbp+var_28]"], [8, "mov rax, [rax+10h]"], [9, "test rax, rax"], [10, "jnz short loc_403095"], [11, "mov eax, 1"], [12, "jmp locret_403165"], [13, "mov edx, dword ptr [rbp+n]"], [14, "mov eax, dword ptr [rbp+n+4]"], [15, "mov r9d, edx"], [16, "mov r8d, eax"], [17, "mov ecx, 4Ah "], [18, "mov edx, offset aBtstackTlvPosi"], [19, "mov esi, offset aSUAppendTag04x"], [20, "mov edi, 1"], [21, "mov eax, 0"], [22, "call sub_4122DA"], [23, "mov edx, dword ptr [rbp+n+4]"], [24, "lea rax, [rbp+ptr]"], [25, "mov esi, 0"], [26, "mov rdi, rax"], [27, "call sub_40845A"], [28, "mov edx, dword ptr [rbp+n]"], [29, "lea rax, [rbp+ptr]"], [30, "mov esi, 4"], [31, "mov rdi, rax"], [32, "call sub_40845A"], [33, "mov rax, [rbp+var_28]"], [34, "mov rdx, [rax+10h]"], [35, "lea rax, [rbp+ptr]"], [36, "mov rcx, rdx"], [37, "mov edx, 8"], [38, "mov esi, 1"], [39, "mov rdi, rax"], [40, "call _fwrite"], [41, "mov [rbp+var_8], rax"], [42, "cmp [rbp+var_8], 8"], [43, "jz short loc_40311A"], [44, "mov eax, 1"], [45, "jmp short locret_403165"], [46, "cmp dword ptr [rbp+n], 0"], [47, "jz short loc_403150"], [48, "mov rax, [rbp+var_28]"], [49, "mov rcx, [rax+10h]"], [50, "mov edx, dword ptr [rbp+n]"], [51, "mov rax, [rbp+var_38]"], [52, "mov esi, 1"], [53, "mov rdi, rax"], [54, "call _fwrite"], [55, "mov [rbp+var_10], rax"], [56, "mov eax, dword ptr [rbp+n]"], [57, "cmp [rbp+var_10], rax"], [58, "jz short loc_403150"], [59, "mov eax, 1"], [60, "jmp short locret_403165"], [61, "mov rax, [rbp+var_28]"], [62, "mov rax, [rax+10h]"], [63, "mov rdi, rax"], [64, "call _fflush"], [65, "mov eax, 1"], [66, "leave"], [67, "retn"]], "data_dep": [[7, 3], [8, 7], [9, 8], [10, 9], [13, 6], [14, 4], [15, 13], [16, 14], [23, 4], [24, 22], [26, 24], [28, 6], [29, 27], [31, 29], [33, 3], [34, 33], [35, 33], [36, 34], [39, 35], [41, 40], [42, 41], [43, 42], [46, 6], [47, 46], [48, 3], [49, 48], [50, 6], [51, 5], [53, 51], [55, 54], [56, 6], [57, 56], [57, 55], [58, 57], [61, 3], [62, 61], [63, 62], [67, 65], [67, 59], [67, 11], [67, 44]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/c0fe0b1d115c9a9d40b2c9859f7dfd1ea6098b73116e2548a49a45e30fbdd252_c0fe0b1d115c9a9d40b2c9859f7dfd1ea6098b73116e2548a49a45e30fbdd252.jsonl.gz", "strip_func_name": "sub_403068", "query": "\n\n\n__int64 __fastcall sub_403068(__int64 a1, unsigned int a2, const void *a3, unsigned int a4)\n{\nchar ptr[8]; // [rsp+28h] [rbp-18h] BYREF\nsize_t v8; // [rsp+30h] [rbp-10h]\nsize_t v9; // [rsp+38h] [rbp-8h]\n\nif ( !*(_QWORD *)(a1 + 16) )\nreturn 1LL;\nsub_4122DA(1, (unsigned int)\"%s.%u: append tag %04x, len %u\", (unsigned int)\"btstack_tlv_posix.c\", 74, a2, a4);\nsub_40845A(ptr, 0LL, a2);\nsub_40845A(ptr, 4LL, a4);\nv9 = fwrite(ptr, 1uLL, 8uLL, *(FILE **)(a1 + 16));\nif ( v9 != 8 )\nreturn 1LL;\nif ( a4 )\n{\nv8 = fwrite(a3, 1uLL, a4, *(FILE **)(a1 + 16));\nif ( v8 != a4 )\nreturn 1LL;\n}\nfflush(*(FILE **)(a1 + 16));\nreturn 1LL;\n}\n\n\n\nQ:[a3,a4,a1,a2,ptr,v8,v9,sub_403068,sub_4122DA,sub_40845A,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'data', 'a4': 'data_size', 'a1': 'self', 'a2': 'tag', 'ptr': 'header', 'v8': 'written_value', 'v9': 'written_header', 'sub_403068': 'btstack_tlv_posix_append_tag', 'sub_4122DA': 'hci_dump_log', 'sub_40845A': 'big_endian_store_32'}"}
gba_check_sram_flash
19d5318b349f2d5485888470c0f50eb4432edaf30b2bf3df0a433de4edc90d52
insidegadgets
GBxCart-RW
NA
uint8_t gba_check_sram_flash (void) { uint16_t currAddr = 0x0000; uint16_t zeroTotal = 0; hasFlashSave = NOT_CHECKED; // Special check for certain games if (strncmp(gameTitle, "CHUCHU ROCKE", 12) == 0 || strncmp(gameTitle, "CHUCHUROCKET", 12) == 0) { // Chu-Chu Rocket! return SRAM_FLASH_512KBIT; } // Pre-read SRAM/Flash (if the cart has an EEPROM, sometimes D0-D7 come back with random data in the first 64 bytes read) set_number(currAddr, SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); com_read_stop(); // Test if SRAM is present, read 32 sections of RAM (64 bytes each) for (uint8_t x = 0; x < 32; x++) { set_number(currAddr, SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); com_read_stop(); // Check for 0x00 byte for (uint8_t c = 0; c < 64; c++) { if (readBuffer[c] == 0) { zeroTotal++; } } currAddr += 0x400; // Progress if (x % 10 == 0) { printf("."); } } if (zeroTotal >= 2000) { // Looks like no SRAM or Flash present, lets do a more thorough check // Set start and end address currAddr = 0x0000; endAddr = 32768; set_number(currAddr, SET_START_ADDRESS); set_mode(GBA_READ_SRAM); zeroTotal = 0; // Read data while (currAddr < endAddr) { com_read_bytes(READ_BUFFER, 64); currAddr += 64; // Check for 0x00 byte for (uint8_t c = 0; c < 64; c++) { if (readBuffer[c] == 0) { zeroTotal++; } } // Request 64 bytes more if (currAddr < endAddr) { com_read_cont(); } } com_read_stop(); if (zeroTotal == 32768) { return 0; } } // Calculate size by checking different addresses (Test 256Kbit or 512Kbit) uint16_t duplicateCount = 0; char firstBuffer[65]; char secondBuffer[65]; for (uint8_t x = 0; x < 32; x++) { set_number((uint32_t) (x * 0x400), SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); memcpy(&firstBuffer, readBuffer, 64); com_read_stop(); set_number((uint32_t) (x * 0x400) + 0x8000, SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); memcpy(&secondBuffer, readBuffer, 64); com_read_stop(); // Compare for (uint8_t x = 0; x < 64; x++) { if (firstBuffer[x] == secondBuffer[x]) { duplicateCount++; } } // Progress if (x % 10 == 0) { printf("."); } } if (duplicateCount >= 2000) { return SRAM_FLASH_256KBIT; } // Check if it's SRAM or Flash at this stage, maximum for SRAM is 512Kbit printf("\n"); hasFlashSave = gba_test_sram_flash_write(); if (hasFlashSave == NO_FLASH) { return SRAM_FLASH_512KBIT; } // Test 512Kbit or 1Mbit Flash, read first 64 bytes on bank 0 then bank 1 and compare else { duplicateCount = 0; printf("Testing for 512Kbit or 1Mbit Flash... "); for (uint8_t x = 0; x < 32; x++) { // Read bank 0 set_number((uint32_t) (x * 0x400), SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); memcpy(&firstBuffer, readBuffer, 64); com_read_stop(); // Read bank 1 set_number(1, GBA_FLASH_SET_BANK); // Set bank 1 set_number((uint32_t) (x * 0x400), SET_START_ADDRESS); set_mode(GBA_READ_SRAM); com_read_bytes(READ_BUFFER, 64); memcpy(&secondBuffer, readBuffer, 64); com_read_stop(); set_number(0, GBA_FLASH_SET_BANK); // Set back to bank 0 // Compare for (uint8_t x = 0; x < 64; x++) { if (firstBuffer[x] == secondBuffer[x]) { duplicateCount++; } } } // If bank 0 and 1 are duplicated, then it's 512Kbit Flash if (duplicateCount >= 2000) { printf("512Kbit\n"); return SRAM_FLASH_512KBIT; } else { printf("1Mbit\n"); return SRAM_FLASH_1MBIT; } } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_402E02", "function_addr": 4206082, "binary_name": "19d5318b349f2d5485888470c0f50eb4432edaf30b2bf3df0a433de4edc90d52.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 0A0h"], [3, "mov [rbp+var_2], 0"], [4, "mov [rbp+var_4], 0"], [5, "mov cs:dword_408688, 0"], [6, "mov edx, 0Ch"], [7, "mov esi, offset s2"], [8, "mov edi, offset s1"], [9, "call _strncmp"], [10, "test eax, eax"], [11, "jz short loc_402E53"], [12, "mov edx, 0Ch"], [13, "mov esi, offset aChuchurocket"], [14, "mov edi, offset s1"], [15, "call _strncmp"], [16, "test eax, eax"], [17, "jnz short loc_402E5D"], [18, "mov eax, 2"], [19, "jmp locret_4032C7"], [20, "movzx eax, [rbp+var_2]"], [21, "mov esi, 41h "], [22, "mov edi, eax"], [23, "call sub_401EF9"], [24, "mov edi, 6Dh "], [25, "call sub_401EAE"], [26, "mov esi, 40h "], [27, "mov edi, 0"], [28, "call sub_401D36"], [29, "call sub_401C1D"], [30, "mov [rbp+var_5], 0"], [31, "jmp loc_402F44"], [32, "movzx eax, [rbp+var_2]"], [33, "mov esi, 41h "], [34, "mov edi, eax"], [35, "call sub_401EF9"], [36, "mov edi, 6Dh "], [37, "call sub_401EAE"], [38, "mov esi, 40h "], [39, "mov edi, 0"], [40, "call sub_401D36"], [41, "call sub_401C1D"], [42, "mov [rbp+var_6], 0"], [43, "jmp short loc_402EEE"], [44, "movzx eax, [rbp+var_6]"], [45, "cdqe"], [46, "movzx eax, byte ptr ds:qword_408420[rax]"], [47, "test al, al"], [48, "jnz short loc_402EE4"], [49, "movzx eax, [rbp+var_4]"], [50, "add eax, 1"], [51, "mov [rbp+var_4], ax"], [52, "movzx eax, [rbp+var_6]"], [53, "add eax, 1"], [54, "mov [rbp+var_6], al"], [55, "cmp [rbp+var_6], 3Fh "], [56, "jbe short loc_402EC8"], [57, "add [rbp+var_2], 400h"], [58, "movzx ecx, [rbp+var_5]"], [59, "movzx edx, cl"], [60, "mov eax, edx"], [61, "shl eax, 2"], [62, "add eax, edx"], [63, "shl eax, 3"], [64, "add eax, edx"], [65, "lea edx, ds:0[rax*4]"], [66, "add eax, edx"], [67, "shr ax, 8"], [68, "mov edx, eax"], [69, "shr dl, 3"], [70, "mov eax, edx"], [71, "shl eax, 2"], [72, "add eax, edx"], [73, "add eax, eax"], [74, "sub ecx, eax"], [75, "mov edx, ecx"], [76, "test dl, dl"], [77, "jnz short loc_402F3A"], [78, "mov edi, 2Eh "], [79, "call _putchar"], [80, "movzx eax, [rbp+var_5]"], [81, "add eax, 1"], [82, "mov [rbp+var_5], al"], [83, "cmp [rbp+var_5], 1Fh"], [84, "jbe loc_402E94"], [85, "cmp [rbp+var_4], 7CFh"], [86, "jbe loc_40300A"], [87, "mov [rbp+var_2], 0"], [88, "mov cs:dword_408168, 8000h"], [89, "movzx eax, [rbp+var_2]"], [90, "mov esi, 41h "], [91, "mov edi, eax"], [92, "call sub_401EF9"], [93, "mov edi, 6Dh "], [94, "call sub_401EAE"], [95, "mov [rbp+var_4], 0"], [96, "jmp short loc_402FE5"], [97, "mov esi, 40h "], [98, "mov edi, 0"], [99, "call sub_401D36"], [100, "add [rbp+var_2], 40h "], [101, "mov [rbp+var_7], 0"], [102, "jmp short loc_402FCC"], [103, "movzx eax, [rbp+var_7]"], [104, "cdqe"], [105, "movzx eax, byte ptr ds:qword_408420[rax]"], [106, "test al, al"], [107, "jnz short loc_402FC2"], [108, "movzx eax, [rbp+var_4]"], [109, "add eax, 1"], [110, "mov [rbp+var_4], ax"], [111, "movzx eax, [rbp+var_7]"], [112, "add eax, 1"], [113, "mov [rbp+var_7], al"], [114, "cmp [rbp+var_7], 3Fh "], [115, "jbe short loc_402FA6"], [116, "movzx edx, [rbp+var_2]"], [117, "mov eax, cs:dword_408168"], [118, "cmp edx, eax"], [119, "jnb short loc_402FE5"], [120, "call sub_401C43"], [121, "movzx edx, [rbp+var_2]"], [122, "mov eax, cs:dword_408168"], [123, "cmp edx, eax"], [124, "jb short loc_402F8C"], [125, "call sub_401C1D"], [126, "cmp [rbp+var_4], 8000h"], [127, "jnz short loc_40300A"], [128, "mov eax, 0"], [129, "jmp locret_4032C7"], [130, "mov [rbp+var_A], 0"], [131, "mov [rbp+var_B], 0"], [132, "jmp loc_403137"], [133, "movzx eax, [rbp+var_B]"], [134, "shl eax, 0Ah"], [135, "mov esi, 41h "], [136, "mov edi, eax"], [137, "call sub_401EF9"], [138, "mov edi, 6Dh "], [139, "call sub_401EAE"], [140, "mov esi, 40h "], [141, "mov edi, 0"], [142, "call sub_401D36"], [143, "lea rax, [rbp+dest]"], [144, "mov edx, 40h "], [145, "mov esi, offset qword_408420"], [146, "mov rdi, rax"], [147, "call _memcpy"], [148, "call sub_401C1D"], [149, "movzx eax, [rbp+var_B]"], [150, "shl eax, 0Ah"], [151, "add eax, 8000h"], [152, "mov esi, 41h "], [153, "mov edi, eax"], [154, "call sub_401EF9"], [155, "mov edi, 6Dh "], [156, "call sub_401EAE"], [157, "mov esi, 40h "], [158, "mov edi, 0"], [159, "call sub_401D36"], [160, "lea rax, [rbp+var_A0]"], [161, "mov edx, 40h "], [162, "mov esi, offset qword_408420"], [163, "mov rdi, rax"], [164, "call _memcpy"], [165, "call sub_401C1D"], [166, "mov [rbp+var_C], 0"], [167, "jmp short loc_4030E7"], [168, "movzx eax, [rbp+var_C]"], [169, "cdqe"], [170, "movzx edx, [rbp+rax+dest]"], [171, "movzx eax, [rbp+var_C]"], [172, "cdqe"], [173, "movzx eax, [rbp+rax+var_A0]"], [174, "cmp dl, al"], [175, "jnz short loc_4030DD"], [176, "movzx eax, [rbp+var_A]"], [177, "add eax, 1"], [178, "mov [rbp+var_A], ax"], [179, "movzx eax, [rbp+var_C]"], [180, "add eax, 1"], [181, "mov [rbp+var_C], al"], [182, "cmp [rbp+var_C], 3Fh "], [183, "jbe short loc_4030B5"], [184, "movzx ecx, [rbp+var_B]"], [185, "movzx edx, cl"], [186, "mov eax, edx"], [187, "shl eax, 2"], [188, "add eax, edx"], [189, "shl eax, 3"], [190, "add eax, edx"], [191, "lea edx, ds:0[rax*4]"], [192, "add eax, edx"], [193, "shr ax, 8"], [194, "mov edx, eax"], [195, "shr dl, 3"], [196, "mov eax, edx"], [197, "shl eax, 2"], [198, "add eax, edx"], [199, "add eax, eax"], [200, "sub ecx, eax"], [201, "mov edx, ecx"], [202, "test dl, dl"], [203, "jnz short loc_40312D"], [204, "mov edi, 2Eh "], [205, "call _putchar"], [206, "movzx eax, [rbp+var_B]"], [207, "add eax, 1"], [208, "mov [rbp+var_B], al"], [209, "cmp [rbp+var_B], 1Fh"], [210, "jbe loc_403019"], [211, "cmp [rbp+var_A], 7CFh"], [212, "jbe short loc_403153"], [213, "mov eax, 1"], [214, "jmp locret_4032C7"], [215, "mov edi, 0Ah"], [216, "call _putchar"], [217, "call sub_402942"], [218, "movzx eax, al"], [219, "mov cs:dword_408688, eax"], [220, "mov eax, cs:dword_408688"], [221, "cmp eax, 1"], [222, "jnz short loc_403180"], [223, "mov eax, 2"], [224, "jmp locret_4032C7"], [225, "mov [rbp+var_A], 0"], [226, "mov edi, offset aTestingFor512k"], [227, "mov eax, 0"], [228, "call _printf"], [229, "mov [rbp+var_D], 0"], [230, "jmp loc_403295"], [231, "movzx eax, [rbp+var_D]"], [232, "shl eax, 0Ah"], [233, "mov esi, 41h "], [234, "mov edi, eax"], [235, "call sub_401EF9"], [236, "mov edi, 6Dh "], [237, "call sub_401EAE"], [238, "mov esi, 40h "], [239, "mov edi, 0"], [240, "call sub_401D36"], [241, "lea rax, [rbp+dest]"], [242, "mov edx, 40h "], [243, "mov esi, offset qword_408420"], [244, "mov rdi, rax"], [245, "call _memcpy"], [246, "call sub_401C1D"], [247, "mov esi, 6Bh "], [248, "mov edi, 1"], [249, "call sub_401EF9"], [250, "movzx eax, [rbp+var_D]"], [251, "shl eax, 0Ah"], [252, "mov esi, 41h "], [253, "mov edi, eax"], [254, "call sub_401EF9"], [255, "mov edi, 6Dh "], [256, "call sub_401EAE"], [257, "mov esi, 40h "], [258, "mov edi, 0"], [259, "call sub_401D36"], [260, "lea rax, [rbp+var_A0]"], [261, "mov edx, 40h "], [262, "mov esi, offset qword_408420"], [263, "mov rdi, rax"], [264, "call _memcpy"], [265, "call sub_401C1D"], [266, "mov esi, 6Bh "], [267, "mov edi, 0"], [268, "call sub_401EF9"], [269, "mov [rbp+var_E], 0"], [270, "jmp short loc_403285"], [271, "movzx eax, [rbp+var_E]"], [272, "cdqe"], [273, "movzx edx, [rbp+rax+dest]"], [274, "movzx eax, [rbp+var_E]"], [275, "cdqe"], [276, "movzx eax, [rbp+rax+var_A0]"], [277, "cmp dl, al"], [278, "jnz short loc_40327B"], [279, "movzx eax, [rbp+var_A]"], [280, "add eax, 1"], [281, "mov [rbp+var_A], ax"], [282, "movzx eax, [rbp+var_E]"], [283, "add eax, 1"], [284, "mov [rbp+var_E], al"], [285, "cmp [rbp+var_E], 3Fh "], [286, "jbe short loc_403253"], [287, "movzx eax, [rbp+var_D]"], [288, "add eax, 1"], [289, "mov [rbp+var_D], al"], [290, "cmp [rbp+var_D], 1Fh"], [291, "jbe loc_40319E"], [292, "cmp [rbp+var_A], 7CFh"], [293, "jbe short loc_4032B8"], [294, "mov edi, offset a512kbit"], [295, "call _puts"], [296, "mov eax, 2"], [297, "jmp short locret_4032C7"], [298, "mov edi, offset a1mbit"], [299, "call _puts"], [300, "mov eax, 3"], [301, "leave"], [302, "retn"]], "data_dep": [[10, 9], [11, 10], [16, 15], [17, 16], [20, 3], [22, 20], [32, 3], [32, 57], [34, 32], [44, 54], [44, 42], [47, 46], [48, 47], [49, 4], [49, 51], [50, 49], [51, 50], [52, 42], [52, 54], [53, 52], [54, 53], [55, 54], [55, 42], [56, 55], [57, 57], [57, 3], [58, 30], [58, 82], [59, 58], [60, 59], [61, 60], [62, 59], [62, 61], [63, 62], [64, 59], [64, 63], [65, 59], [66, 64], [66, 65], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 69], [72, 71], [73, 72], [74, 73], [74, 58], [75, 74], [76, 75], [77, 76], [80, 30], [80, 82], [81, 80], [82, 81], [83, 30], [83, 82], [84, 83], [85, 4], [85, 51], [86, 85], [89, 87], [91, 89], [100, 87], [100, 100], [103, 113], [103, 101], [106, 105], [107, 106], [108, 95], [108, 110], [109, 108], [110, 109], [111, 101], [111, 113], [112, 111], [113, 112], [114, 113], [114, 101], [115, 114], [116, 100], [117, 88], [118, 117], [118, 116], [119, 118], [121, 87], [121, 100], [122, 88], [123, 121], [123, 122], [124, 123], [126, 110], [126, 95], [127, 126], [133, 131], [133, 208], [134, 133], [136, 134], [143, 142], [146, 143], [149, 208], [149, 131], [150, 149], [151, 150], [153, 151], [160, 159], [163, 160], [168, 166], [168, 181], [170, 168], [171, 181], [171, 166], [173, 171], [174, 173], [174, 170], [175, 174], [176, 178], [176, 130], [177, 176], [178, 177], [179, 181], [179, 166], [180, 179], [181, 180], [182, 181], [182, 166], [183, 182], [184, 131], [184, 208], [185, 184], [186, 185], [187, 186], [188, 187], [188, 185], [189, 188], [190, 185], [190, 189], [191, 185], [192, 190], [192, 191], [193, 192], [194, 193], [195, 194], [196, 195], [197, 196], [198, 195], [198, 197], [199, 198], [200, 199], [200, 184], [201, 200], [202, 201], [203, 202], [206, 131], [206, 208], [207, 206], [208, 207], [209, 131], [209, 208], [210, 209], [211, 130], [211, 178], [212, 211], [218, 217], [219, 218], [220, 219], [221, 220], [222, 221], [231, 289], [231, 229], [232, 231], [234, 232], [241, 240], [244, 241], [250, 289], [250, 229], [251, 250], [253, 251], [260, 259], [263, 260], [271, 269], [271, 284], [273, 271], [274, 269], [274, 284], [276, 274], [277, 276], [277, 273], [278, 277], [279, 281], [279, 225], [280, 279], [281, 280], [282, 269], [282, 284], [283, 282], [284, 283], [285, 269], [285, 284], [286, 285], [287, 289], [287, 229], [288, 287], [289, 288], [290, 289], [290, 229], [291, 290], [292, 225], [292, 281], [293, 292], [302, 128], [302, 18], [302, 223], [302, 296], [302, 300], [302, 213]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/19d5318b349f2d5485888470c0f50eb4432edaf30b2bf3df0a433de4edc90d52_19d5318b349f2d5485888470c0f50eb4432edaf30b2bf3df0a433de4edc90d52.jsonl.gz", "strip_func_name": "sub_402E02", "query": "\n\n\n__int64 sub_402E02()\n{\n__int64 result; // rax\nchar v1[80]; // [rsp+0h] [rbp-A0h] BYREF\nchar dest[66]; // [rsp+50h] [rbp-50h] BYREF\nunsigned __int8 ii; // [rsp+92h] [rbp-Eh]\nunsigned __int8 n; // [rsp+93h] [rbp-Dh]\nunsigned __int8 m; // [rsp+94h] [rbp-Ch]\nunsigned __int8 l; // [rsp+95h] [rbp-Bh]\nunsigned __int16 v7; // [rsp+96h] [rbp-Ah]\nunsigned __int8 k; // [rsp+99h] [rbp-7h]\nunsigned __int8 j; // [rsp+9Ah] [rbp-6h]\nunsigned __int8 i; // [rsp+9Bh] [rbp-5h]\nunsigned __int16 v11; // [rsp+9Ch] [rbp-4h]\nunsigned __int16 v12; // [rsp+9Eh] [rbp-2h]\n\nv12 = 0;\nv11 = 0;\ndword_408688 = 0;\nif ( !strncmp(s1, \"CHUCHU ROCKE\", 0xCuLL) || !strncmp(s1, \"CHUCHUROCKET\", 0xCuLL) )\nreturn 2LL;\nsub_401EF9(v12, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nsub_401C1D();\nfor ( i = 0; i <= 0x1Fu; ++i )\n{\nsub_401EF9(v12, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nsub_401C1D();\nfor ( j = 0; j <= 0x3Fu; ++j )\n{\nif ( !*((_BYTE *)&qword_408420 + j) )\n++v11;\n}\nv12 += 1024;\nif ( i == 10 * (i / 0xAu) )\nputchar(46);\n}\nif ( v11 > 0x7CFu )\n{\nv12 = 0;\ndword_408168 = 0x8000;\nsub_401EF9(0, 0x41u);\nsub_401EAE(109);\nv11 = 0;\nwhile ( v12 < (unsigned int)dword_408168 )\n{\nsub_401D36(0LL, 64);\nv12 += 64;\nfor ( k = 0; k <= 0x3Fu; ++k )\n{\nif ( !*((_BYTE *)&qword_408420 + k) )\n++v11;\n}\nif ( v12 < (unsigned int)dword_408168 )\nsub_401C43();\n}\nsub_401C1D();\nif ( v11 == 0x8000 )\nreturn 0LL;\n}\nv7 = 0;\nfor ( l = 0; l <= 0x1Fu; ++l )\n{\nsub_401EF9(l << 10, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nmemcpy(dest, &qword_408420, 0x40uLL);\nsub_401C1D();\nsub_401EF9((l << 10) + 0x8000, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nmemcpy(v1, &qword_408420, 0x40uLL);\nsub_401C1D();\nfor ( m = 0; m <= 0x3Fu; ++m )\n{\nif ( dest[m] == v1[m] )\n++v7;\n}\nif ( l == 10 * (l / 0xAu) )\nputchar(46);\n}\nif ( v7 > 0x7CFu )\nreturn 1LL;\nputchar(10);\ndword_408688 = (unsigned __int8)sub_402942();\nif ( dword_408688 == 1 )\nreturn 2LL;\nv7 = 0;\nprintf(\"Testing for 512Kbit or 1Mbit Flash... \");\nfor ( n = 0; n <= 0x1Fu; ++n )\n{\nsub_401EF9(n << 10, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nmemcpy(dest, &qword_408420, 0x40uLL);\nsub_401C1D();\nsub_401EF9(1u, 0x6Bu);\nsub_401EF9(n << 10, 0x41u);\nsub_401EAE(109);\nsub_401D36(0LL, 64);\nmemcpy(v1, &qword_408420, 0x40uLL);\nsub_401C1D();\nsub_401EF9(0, 0x6Bu);\nfor ( ii = 0; ii <= 0x3Fu; ++ii )\n{\nif ( dest[ii] == v1[ii] )\n++v7;\n}\n}\nif ( v7 <= 0x7CFu )\n{\nputs(\"1Mbit\");\nresult = 3LL;\n}\nelse\n{\nputs(\"512Kbit\");\nresult = 2LL;\n}\nreturn result;\n}\n\n\n\nQ:[v1,dest,ii,n,m,l,v7,k,j,i,v11,v12,sub_402E02,sub_401EF9,sub_401EAE,sub_401D36,sub_401C1D,sub_401C43,sub_402942,]\nAssistant: ", "hints": "[]", "response": "{'v1': 'secondBuffer', 'dest': 'firstBuffer', 'ii': 'x_3', 'n': 'x_2', 'm': 'x_1', 'l': 'x_0', 'v7': 'duplicateCount', 'k': 'c_0', 'j': 'c', 'i': 'x', 'v11': 'zeroTotal', 'v12': 'currAddr', 'sub_402E02': 'gba_check_sram_flash', 'sub_401EF9': 'set_number', 'sub_401EAE': 'set_mode', 'sub_401D36': 'com_read_bytes', 'sub_401C1D': 'com_read_stop', 'sub_401C43': 'com_read_cont', 'sub_402942': 'gba_test_sram_flash_write'}"}
sm_passkey_entry
1f4b836241663a98d995a650a671acd1dabc7b5a96a4160d7267c822f4bbfdca
micropython
micropython-unicorn
NA
static int sm_passkey_entry(stk_generation_method_t method){ switch (method){ case PK_RESP_INPUT: case PK_INIT_INPUT: case PK_BOTH_INPUT: return 1; default: return 0; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_4259DB", "function_addr": 4348379, "binary_name": "1f4b836241663a98d995a650a671acd1dabc7b5a96a4160d7267c822f4bbfdca.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "mov eax, [rbp+var_4]"], [4, "sub eax, 1"], [5, "cmp eax, 2"], [6, "ja short loc_4259F4"], [7, "mov eax, 1"], [8, "jmp short loc_4259F9"], [9, "mov eax, 0"], [10, "pop rbp"], [11, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 5], [10, 0], [11, 7], [11, 9]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/1f4b836241663a98d995a650a671acd1dabc7b5a96a4160d7267c822f4bbfdca_1f4b836241663a98d995a650a671acd1dabc7b5a96a4160d7267c822f4bbfdca.jsonl.gz", "strip_func_name": "sub_4259DB", "query": "\n\n\n_BOOL8 __fastcall sub_4259DB(int a1)\n{\nreturn (unsigned int)(a1 - 1) <= 2;\n}\n\n\n\nQ:[a1,sub_4259DB,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'method', 'sub_4259DB': 'sm_passkey_entry'}"}
increase_tima
276536b89cc3e58f9e6dd34cde9d9d4ba21328c5a859320d5e06460e1ec2c7de
LIJI32
SameBoy
NA
static void increase_tima(GB_gameboy_t *gb) { gb->io_registers[GB_IO_TIMA]++; if (gb->io_registers[GB_IO_TIMA] == 0) { gb->io_registers[GB_IO_TIMA] = gb->io_registers[GB_IO_TMA]; gb->tima_reload_state = GB_TIMA_RELOADING; } }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43F156", "function_addr": 4452694, "binary_name": "276536b89cc3e58f9e6dd34cde9d9d4ba21328c5a859320d5e06460e1ec2c7de.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+19Ch]"], [5, "lea edx, [rax+1]"], [6, "mov rax, [rbp+var_8]"], [7, "mov [rax+19Ch], dl"], [8, "mov rax, [rbp+var_8]"], [9, "movzx eax, byte ptr [rax+19Ch]"], [10, "test al, al"], [11, "jnz short loc_43F1A5"], [12, "mov rax, [rbp+var_8]"], [13, "movzx edx, byte ptr [rax+19Dh]"], [14, "mov rax, [rbp+var_8]"], [15, "mov [rax+19Ch], dl"], [16, "mov rax, [rbp+var_8]"], [17, "mov byte ptr [rax+22Ah], 1"], [18, "nop"], [19, "pop rbp"], [20, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 4], [6, 2], [7, 6], [7, 5], [8, 2], [9, 8], [9, 7], [10, 9], [11, 10], [12, 2], [13, 17], [13, 7], [13, 15], [13, 12], [14, 2], [15, 14], [15, 13], [16, 2], [17, 16], [19, 0], [20, 10], [20, 16]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/276536b89cc3e58f9e6dd34cde9d9d4ba21328c5a859320d5e06460e1ec2c7de_276536b89cc3e58f9e6dd34cde9d9d4ba21328c5a859320d5e06460e1ec2c7de.jsonl.gz", "strip_func_name": "sub_43F156", "query": "\n\n\nunsigned __int64 __fastcall sub_43F156(_BYTE *a1)\n{\nunsigned __int64 result; // rax\n\nresult = (unsigned __int8)++a1[412];\nif ( !(_BYTE)result )\n{\na1[412] = a1[413];\nresult = (unsigned __int64)a1;\na1[554] = 1;\n}\nreturn result;\n}\n\n\n\nQ:[a1,sub_43F156,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'gb', 'sub_43F156': 'increase_tima'}"}
archive_search_se_new
2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3
smarco
gem3-mapper
NA
void archive_search_se_new( search_parameters_t* const search_parameters, const bool buffered_search, archive_search_t** const archive_search) { // Prepare Search *archive_search = mm_alloc(archive_search_t); // Allocate handler archive_search_configure(*archive_search,search_parameters,buffered_search); archive_select_configure_se(*archive_search); }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_414651", "function_addr": 4277841, "binary_name": "2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "sub rsp, 20h"], [3, "mov [rbp+var_8], rdi"], [4, "mov eax, esi"], [5, "mov [rbp+var_18], rdx"], [6, "mov [rbp+var_C], al"], [7, "mov ecx, 0"], [8, "mov edx, 0"], [9, "mov esi, 538h"], [10, "mov edi, 1"], [11, "call sub_44D294"], [12, "mov rdx, [rbp+var_18]"], [13, "mov [rdx], rax"], [14, "movzx edx, [rbp+var_C]"], [15, "mov rax, [rbp+var_18]"], [16, "mov rax, [rax]"], [17, "mov rcx, [rbp+var_8]"], [18, "mov rsi, rcx"], [19, "mov rdi, rax"], [20, "call sub_414600"], [21, "mov rax, [rbp+var_18]"], [22, "mov rax, [rax]"], [23, "mov rdi, rax"], [24, "call sub_417505"], [25, "nop"], [26, "leave"], [27, "retn"]], "data_dep": [[6, 4], [12, 5], [13, 12], [13, 11], [14, 6], [15, 5], [16, 13], [16, 15], [17, 3], [18, 17], [19, 16], [21, 5], [22, 21], [22, 13], [23, 22], [27, 24]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3_2628714fc89bbd06927f17c35c7cc10c3c4f3a82276ea56c58894e172e8f25b3.jsonl.gz", "strip_func_name": "sub_414651", "query": "\n\n\n__int64 __fastcall sub_414651(const void *a1, char a2, __int64 *a3)\n{\n*a3 = sub_44D294(1LL, 1336LL, 0LL, 0LL);\nsub_414600(*a3, a1, a2);\nreturn sub_417505(*a3);\n}\n\n\n\nQ:[a3,a1,a2,sub_414651,sub_44D294,sub_414600,sub_417505,]\nAssistant: ", "hints": "[]", "response": "{'a3': 'archive_search', 'a1': 'search_parameters', 'a2': 'buffered_search', 'sub_414651': 'archive_search_se_new', 'sub_44D294': 'mm_malloc_', 'sub_414600': 'archive_search_configure', 'sub_417505': 'archive_select_configure_se'}"}
AL_HEVC_IsRASL
5e2a239e524ee6c8d1db011c62e19bf6e5a376e8054688e7b0fce1f13117e67f
Xilinx
vcu-ctrl-sw
NA
bool AL_HEVC_IsRASL(AL_ENut eNUT) { return eNUT == AL_HEVC_NUT_RASL_N || eNUT == AL_HEVC_NUT_RASL_R; }
{"metadata": {"project_name": "lmpa-bins-ret", "function_name": "sub_43876A", "function_addr": 4425578, "binary_name": "5e2a239e524ee6c8d1db011c62e19bf6e5a376e8054688e7b0fce1f13117e67f.elf_extract.pkl\n"}, "code": [[0, "push rbp"], [1, "mov rbp, rsp"], [2, "mov [rbp+var_4], edi"], [3, "cmp [rbp+var_4], 8"], [4, "jz short loc_43877D"], [5, "cmp [rbp+var_4], 9"], [6, "jnz short loc_438784"], [7, "mov eax, 1"], [8, "jmp short loc_438789"], [9, "mov eax, 0"], [10, "and eax, 1"], [11, "pop rbp"], [12, "retn"]], "data_dep": [[3, 2], [4, 3], [5, 2], [6, 5], [10, 7], [10, 9], [11, 0], [12, 10]]}
{"prompt": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n Human: Help user generate meaningful names for variables and functions in the following code snippet.\n\n\n", "prog_name": "gh-dataset-dirty/bins/5e2a239e524ee6c8d1db011c62e19bf6e5a376e8054688e7b0fce1f13117e67f_5e2a239e524ee6c8d1db011c62e19bf6e5a376e8054688e7b0fce1f13117e67f.jsonl.gz", "strip_func_name": "sub_43876A", "query": "\n\n\n_BOOL8 __fastcall sub_43876A(int a1)\n{\nreturn a1 == 8 || a1 == 9;\n}\n\n\n\nQ:[a1,sub_43876A,]\nAssistant: ", "hints": "[]", "response": "{'a1': 'eNUT', 'sub_43876A': 'AL_HEVC_IsRASL'}"}

Dataset Card for "bimodal-lmpa-shuffled"

More Information needed

Downloads last month
12
Edit dataset card

Collections including PurCL/bimodal-lmpa-shuffled